Alternative approach Improve settings catalog documentation#249
Alternative approach Improve settings catalog documentation#249snodecoder wants to merge 2 commits intoalmenscorner:devfrom
Conversation
Adds --enrich-documentation flag to both backup and documentation commands to enable enhanced Settings Catalog documentation Implements new documentation functions for handling enriched Settings Catalog configurations with categorization and detailed descriptions Updates escape_markdown function to preserve URLs while escaping markdown characters in other text
|
I have started to look in to this, so far I like the fact that its optional and it is separate from everything default! |
|
@almenscorner happy new year! |
|
@almenscorner do you have an update on this? I'd love to start using this new functionality :) |
|
I added some comments above in my review with some small tweaks I'd like to be implemented :) |
@almenscorner Thanks! But where can I find your comments? I do not see them in the Files Changed tab of the pull request? |
| if enrich_documentation: | ||
| settings_lookup = {} | ||
| categories_lookup = {} | ||
|
|
||
| settings_path = os.path.join(configpath, "configurationSettings.json") | ||
| categories_path = os.path.join(configpath, "configurationCategories.json") | ||
| if os.path.exists(settings_path): | ||
| with open(settings_path, "r", encoding="utf-8") as f: | ||
| settings_json = json.load(f) | ||
| if os.path.exists(categories_path): | ||
| with open(categories_path, "r", encoding="utf-8") as f: | ||
| categories_json = json.load(f) | ||
|
|
||
| # Build lookup dictionaries for enrichment | ||
| if settings_json: | ||
| for s in settings_json.get("value", []): | ||
| settings_lookup[s.get("id")] = s | ||
| if categories_json: | ||
| for c in categories_json.get("value", []): | ||
| categories_lookup[c.get("id")] = c | ||
|
|
There was a problem hiding this comment.
In here, settings_json and categories_json should be initialised and set to none in the beginning. If they are not when running with the enrich flag a UnboundLocalError will be thrown if the files does not exist. Also if both files are not found the enrich flag should be set to false to not throw other errors when running the documentation
There was a problem hiding this comment.
After the above fix has been applied I'm good with merging this addition @snodecoder
There was a problem hiding this comment.
Initialized settings_json and categories_json as None
Sorry I don't think the review was submitted for some reason, can you see it now? |
|
@almenscorner I've added the init's as None for both variables |
Pull request related to issue: #242
The main goal was to enrich and improve the readability of the settings catalog documentation for IntuneCD. This PR provides an alternative, simplified approach based on feedback from my first approach in PR #245.
Key Changes: