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

Add the possibility of custom sections in README #845

Open
onavas33 opened this issue Jan 30, 2025 · 3 comments
Open

Add the possibility of custom sections in README #845

onavas33 opened this issue Jan 30, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@onavas33
Copy link

Hello,
Thanks for this great tool !
I'm currently in the process of including it in the ansible roles of my organization.
In order to better fit our internal documentation requirements, we need some custom parts that can't be computed from analysis of the ansible code.
This is why I implemented a small modification of ansible-doctor (https://github.com/onavas33/ansible-doctor/tree/sections), similar to include_header functionality, but in order to give developer the possibility to include custom sections at any point in table of content and generated ouptut, at the condition that template supports the sections keys.
At this point the default readme template is modified to support two sections so that we can include if necessary a custom first or a custom last section in the readme. A french template readme-fr is also included.
Please let me know if interested in inclusion in ansible-doctor or if another approach would have been better.

@xoxys
Copy link
Member

xoxys commented Feb 1, 2025

Hi, thanks for your feedback. In general, I'm fine to add this feature, but I would only add the config and parser part and leave the default templates unchanged. As templates can be loaded from an external git repo, users can easily manage and use their own templates without code changes. Would you like to provide the PR?

@xoxys xoxys added the enhancement New feature or request label Feb 1, 2025
@onavas33
Copy link
Author

onavas33 commented Feb 3, 2025

By "default template unchanged" do you mean "with only one default template" (current readme) and no other template, but including possibility of using sections in the default template ?

Or do you mean "current readme template unmodified" ? In this case, wouldn't you find it weird that the code allows a functionality, and that documentation talks about this, but that default template wouldn't permit to use by default ? How would you like to handle this ? By another example of template ? By more documentation ?

I can prepare a PR for both cases, please let me know.

@xoxys
Copy link
Member

xoxys commented Feb 3, 2025

Or do you mean "current readme template unmodified" ? In this case, wouldn't you find it weird that the code allows a functionality, and that documentation talks about this, but that default template wouldn't permit to use by default ? How would you like to handle this ? By another example of template ? By more documentation ?

That's what I had in mind but after thinking of it again, I agree, this doesn't make much sense... My main problem is, it's not very generic. include_sections can take more or less than two keys, the keys can be named differently and that makes it kinda hard to use.

Why do we even have to register these additional files in the python code? With a custom template, can you not just include the additional files directly with Jinja?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants