Skip to content

Auto-generate environment_variables.rst from menu.json

🎯 Goal

Provide scripts to generate/update the satnogs-config menu.yml, the satnogs-client docs/userguide.rst and the proposed upcoming Station Configuration Schema based on a single source of truth for the variables accepted by satnogs-client.

The purpose of this script is to deprecate the current method of copy-pasting lists of variables between the repositories. It's purpose is not to auto-generate these files automatically, updating them should be remain a human-controlled operation. As mentioned previously auto-generating them would introduce release dependencies/blockers between the different components.

Methods

  • Normalize the documentation markup (!594 (merged))
  • Develop a custom parser (contrib/create_menujson.py) to read the environment_variables.rst and write the data into a preliminary config/menu.json
  • Develop a script (contrib/refresh-docs.py) to generate the environment_variables.rst from a given config/menu.json
  • Manually fix newlines in the documentation fields of the preliminary config/menu.json until the auto-generated environment_variables.rst matches the original input
  • Mark environment_variables.rst as auto-generated and only allow manual editing of config/menu.json in the future

📛 Disadvantages

The update of documentation requires the manual invocation of contrib/refresh-docs.py now.

Edited by Fabian P. Schmidt

Merge request reports