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

Auto-doc ymls #35

Draft
wants to merge 71 commits into
base: docs
Choose a base branch
from
Draft

Auto-doc ymls #35

wants to merge 71 commits into from

Conversation

james-trayford
Copy link
Owner

@james-trayford james-trayford commented Nov 11, 2024

(CC @SamYoules @soleyhyman @rosedshepherd)

For a while we've been struggling with the best way to document the YAML files - which is key as they contain all the defaults and parameters that people can map their data to - a handy well-formatted reference would be ideal.

@SamYoules found that all the existing solution for YAML => markdown or rst wouldn't work or wouldn't do what we wanted so I've written a script myself as a prototype - yamls_to_tables.py

running this in the strauss environment will print a Markdown representation of the tables which could be output as a file, making use of in the _meta section docstrings we've been adding. In the _meta section, I also came up with a syntax for documenting the section and file as a whole. This is demonstrated in the Sampler YAML (src/strauss/presets/sampler/default.yml) which adds text to the top of the relevant section. All the parameters then get tabulated with their meta string, default value, default ranges and units

running python yamls_to_tables.py in the strauss top directory will print the markdown which can be copied or piped to clipboard, and displayed in a markdown viewer, e.g. this. If this is viable, I'm hopeful we can add running this script into the documentation generation step, or even get sphinx to run it internally, which would be ideal. Note, github also does a good job rendering markdown, but we don't want to version control the output files of this - instead the documentation can be run on the fly from the existing YAML files.

These files I think also make it a lot clearer to see where documentation is missing / insufficient for these parameters so should make finishing up & maintaining the documentation a lot easier.

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.

3 participants