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

Automatically generate tables in docs from data in source code #492

Open
1 task done
SouthEndMusic opened this issue Oct 29, 2024 · 0 comments
Open
1 task done
Labels
documentation Improvements or additions to documentation

Comments

@SouthEndMusic
Copy link
Contributor

Wflow version checks

  • I have checked that the issue still exists on the latest versions of the docs on master here

Kind of issue

Docs are wrong

Location of the documentation

Multiple

Documentation problem

(Follow-up of #448)

Multiple tables are now hardcoded in the documentation, e.g. here. If the data for the table can be obtained from the Wflow package, then the table can be automatically generated:

using Wflow
using DataFrames: DataFrame
using MarkdownTables

df = DataFrame(parameter = collect(fieldnames(Wflow.SBM)))
df.unit = Wflow.get_units.(Wflow.SBM, df.parameter)

markdown_table(df)

This yields the following result:

Image.

However, not all data that we want to have in this table is easily accessible, i.e. variable descriptions and default values. That would require some refactoring in the core to achieve. Default values can be added to the struct definitions in the way that is allowed by @with_kw, for the metadata I am not quite sure (in principle using @metadata as used in the example above is possible).

Suggested fix for documentation

No response

@SouthEndMusic SouthEndMusic added the documentation Improvements or additions to documentation label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant