Skip to content

Alternative approach Improve settings catalog documentation#249

Open
snodecoder wants to merge 2 commits intoalmenscorner:devfrom
snodecoder:enrich-documentation
Open

Alternative approach Improve settings catalog documentation#249
snodecoder wants to merge 2 commits intoalmenscorner:devfrom
snodecoder:enrich-documentation

Conversation

@snodecoder
Copy link
Contributor

@snodecoder snodecoder commented Oct 11, 2025

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:

  • Improved the clarity and readability of settings catalog documentation.
  • Added --enrich-documentation to use the improved settings catalog documentation functionality.
  • Moved the storage of enrichment information to separate files (instead of adding it to backedup jsons)
  • Avoided certain changes from the first approach to keep this PR simpler and easier to review, did not do:
    • HTML table collapses for long values (XML, JSON), instead kept it with MD table syntax.
    • Fixes for decoding value bugs (especially around base64 detection for script content). (I will create a separate issue for this later)

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
@almenscorner
Copy link
Owner

I have started to look in to this, so far I like the fact that its optional and it is separate from everything default!

@snodecoder
Copy link
Contributor Author

@almenscorner happy new year!
Did you had any time to review this further?
Let me know if I can help in any way ;)
Thanks!

@snodecoder
Copy link
Contributor Author

@almenscorner do you have an update on this? I'd love to start using this new functionality :)

@almenscorner
Copy link
Owner

I added some comments above in my review with some small tweaks I'd like to be implemented :)

@snodecoder
Copy link
Contributor Author

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?

Comment on lines 88 to 108
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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the above fix has been applied I'm good with merging this addition @snodecoder

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initialized settings_json and categories_json as None

@almenscorner
Copy link
Owner

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?

Sorry I don't think the review was submitted for some reason, can you see it now?

@snodecoder
Copy link
Contributor Author

@almenscorner I've added the init's as None for both variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants