Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/generate pattern docs merge #52

Merged
merged 21 commits into from
Jan 7, 2024
Merged

Conversation

loparcog
Copy link
Collaborator

@loparcog loparcog commented Jan 3, 2024

Merged with master, generating docs seems to work without issue

@loparcog loparcog linked an issue Jan 3, 2024 that may be closed by this pull request
Copy link
Owner

@ideoforms ideoforms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome PR - thanks for all your work on this! The output is fantastic and will make reading the documentation a much nicer experience. Great code quality and clarity too.

I think it would be great to integrate your new logic into the main generate-docs script, so we would have simply:

generate-docs.py --library # generates the pattern library including markdown index
generate-docs.py --readme # generates the readme
generate-docs.py --all # generates both

Feel free to restructure/refactor/throw away elements of my old generate-docs code.

It would also be great to have an index for each pattern category - auto-generating an index page for (e.g) /patterns/chance/index.md that contains an index of each class within each category, just a list of bulletpoints with its one-line description and a link to the pattern documentation page.

Added a few comments inline, but it's mostly fairly cosmetic stuff and a few tips.

auxiliary/scripts/pull-descriptions.py Outdated Show resolved Hide resolved
auxiliary/scripts/pull-descriptions.py Outdated Show resolved Hide resolved
auxiliary/scripts/pull-descriptions.py Outdated Show resolved Hide resolved
auxiliary/scripts/pull-descriptions.py Outdated Show resolved Hide resolved
auxiliary/scripts/pull-descriptions.py Outdated Show resolved Hide resolved
auxiliary/scripts/pull-descriptions.py Outdated Show resolved Hide resolved
@loparcog
Copy link
Collaborator Author

loparcog commented Jan 5, 2024

Going to get on the above changes over the weekend and I'll throw a progress update in here on Sunday

@loparcog
Copy link
Collaborator Author

loparcog commented Jan 6, 2024

I'm getting the index files going now, but I wanted to confirm for the generate-docs.py args, did you want these to just print the output like how generate-docs.py is doing currently or actually write the markdown files like how pull-descriptions.py currently works with the --generate-markdown argument?

@ideoforms
Copy link
Owner

@loparcog Let's switch to writing the files directly, much simpler usage that way. Might be a bit more regex-fu needed to overwrite only the relevant part of the README!

@loparcog
Copy link
Collaborator Author

loparcog commented Jan 7, 2024

Newest push has a pretty big load of things added in

  • Index pages are now a thing and are referenced in the main pattern classes library page by clicking on the name of the file
  • README updater has been put in place in generate-docs.py, the only thing it changes right now is it lists the files in alphabetical order for the Pattern Classes section, which can easily be changed just up to preference
  • Arguments have been added into generate-docs.py (as well as all of the code from pull-descriptions.py) to tuck everything in and have it working with the arguments you provided. If you want to keep the original code in pull-descriptions and just reference it instead lemme know

@ideoforms
Copy link
Owner

@loparcog Looking and working great! 🎉 Love the index pages and class ordering, and auto-generated examples listing.

A few last things, all cosmetic / tidyups really:

  • args param to parse_class_data(args) is no longer needed so can be removed
  • pull-descriptions.py can now be removed as it's obsoleted by this nice new tool
  • I'm now trying to add type hints and pydocs to all functions for consistency (as you advocated a few months ago) - so the leading comments in (e.g.) update_readme should be enclosed in triple-quotes with Google-style pydocs, and with class_data hinted as list[dict]. This is a work-in-progress through the codebase but see Timeline for an example.\
  • Finally, I am a big fan of making command-line tools relatively verbose about their status so that the user has some feedback about what's going on. So a few logger.info()s would be helpful - perhaps one to announce that it's about to generate docs, specifying the path that it's generating to, and then one line per page of class docs that are generated, plus indices. Same for README process.

Then all good to go. Looking forward to publishing the new docs!

@ideoforms ideoforms merged commit f05b983 into master Jan 7, 2024
1 check passed
@ideoforms ideoforms deleted the feature/generate-pattern-docs branch January 7, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate documentation pages for each Pattern subclass
2 participants