-
Notifications
You must be signed in to change notification settings - Fork 139
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
move parameter tables to CSV and read into MD #501
move parameter tables to CSV and read into MD #501
Conversation
Thanks Jamal, this is great, please go ahead! We can reuse the CSV in many other places, e.g. I have a tree-sitter grammar to parse the syntax of A small issue is the footnote, e.g. after the |
fe54a7f
to
64f6e08
Compare
I moved all the parameters to a single XML file and created a script to regenerate the CSV parameter tables when building the documentation (done with MkDocs The XML format is not set in stone and any feedback would be appreciated. It is not clear to me when it is best to use elements vs attributes. Some additional information that we could add:
Thanks for pointing me to qiaojunfeng/tree-sitter-wannier90! I had not even heard of Tree-sitter! Always interested to check out something new. |
64f6e08
to
b5319c2
Compare
The CSV files could be generated on-the-fly using MkDocs hooks, but when I tried, I kept getting a looping build, probably something to do with generating the CSV files using |
- script to generate XML file from existing CSV files - script to reconstruct CSV files from XML file
b5319c2
to
c0a53f9
Compare
Some more parameters were added to the docs after this PR was opened, which caused some conflicts. The new parameters were added to Also, |
Thanks Jamal! |
This PR moves the parameter tables from the markdown source to separate CSV files and uses
mkdocs-table-reader-plugin
to import the tables from the CSV files.One advantage of this approach is that all the parameters definitions are in a single location, separate from the documentation text. The CSV form is a bit easier to edit and manipulate without dealing with the markdown table syntax. Additionally, the CSV files can be used for other purposes, such as a VS Code extension that I am playing around with to create snippets for writing WIN files, with all the parameters documented.
If the @wannier-developers would like to continue with this approach, I will complete the move of the remaining parameter tables to CSV.