-
Notifications
You must be signed in to change notification settings - Fork 253
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
Build settings docs from settings.json schema #5363
Build settings docs from settings.json schema #5363
Conversation
Can we find out if it's ok to change this to yaml? |
…e content to settings.yaml
I went ahead with doing so. I've asked the cloud folks for a 👍 but in the worst case if they absolutely need a json file, we can auto-generate one as a part of the docs build. |
nautobot/docs/user-guide/administration/configuration/optional-settings.md
Outdated
Show resolved
Hide resolved
@@ -382,7 +382,6 @@ | |||
SESSION_FILE_PATH = os.getenv("NAUTOBOT_SESSION_FILE_PATH", None) | |||
SHORT_DATE_FORMAT = os.getenv("NAUTOBOT_SHORT_DATE_FORMAT", "Y-m-d") | |||
SHORT_DATETIME_FORMAT = os.getenv("NAUTOBOT_SHORT_DATETIME_FORMAT", "Y-m-d H:i") | |||
SHORT_TIME_FORMAT = os.getenv("NAUTOBOT_SHORT_TIME_FORMAT", "H:i:s") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't look like Django has ever supported this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that's why I removed it. Sorry for not commenting on that fact.
I noticed that we removed |
Same for |
Removal of |
FWIW, from a quick python check of the schema:
|
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
nautobot/docs/user-guide/administration/configuration/required-settings.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
I can't approve since I opened the PR, but looks good! |
Closes #5099 (and progress toward #1150 as well)
What's Changed
mkdocs-macros-plugin
as a docs dependencysettings.json
withsettings.yaml
as trying to represent Markdown-formatted text in JSON is a pain.settings.yaml
into the rendering environment for the docs and use its contents to generateoptional-settings.md
andrequired-settings.md
Because we already have Django and Jinja templating text in the raw Markdown of other docs files, I configured the plugin's Jinja2 environment to use[[...]]
and[[%...%]]
instead of Jinja's default{{...}}
and{%...%}
tags so as to introduce the minimal number of unrelated changes to other docs files.settings.yaml
to support more fully replicating the existing docs:details
- additional text beyond what's included indescription
, including hyperlinks to related reference material and so forthdefault_literal
- a string to render in the docs in cases where the givendefault
isn't clear otherwise. Only used in 1 or 2 places at present.environment_variable
- the environment variable that can control this settingversion_added
- the Nautobot version a setting was first added intois_constance_setting
- a boolean indicating that this setting is configurable via Constance.is_required_setting
- a boolean controlling whether this setting is documented inoptional-settings
orrequired-settings
.see_also
- a dict of (link_text => link) entries for related documentationThe work is not complete at this time but I wanted to get this draft PR open to gather initial feedback and confirm that we want to continue down this road.
In particular, I'm concerned that JSON's requirement to escape all newlines makes thedetails
of many settings rather difficult to read in the JSON and presumably to maintain longer-term.Screenshots
TODO