aristanetworks / avd

Arista Validated Designs
https://avd.arista.com
Apache License 2.0
285 stars 203 forks source link

allow to skip the TOC on fabric and device documentation #2243

Open gusmb opened 1 year ago

gusmb commented 1 year ago

Enhancement summary

Make the rendering of the TOC optional

Which component of AVD is impacted

eos_designs, eos_cli_config_gen

Use case example

In my project I use one repo to generate configs and documentation for multiple sites and fabrics. I am using mkdocs to consolidate the generated documents and build the aggregated docs nicely in one interface. mkdocs with material theme automatically generates navigation lings with TOC on the right panel.

Therefore if I build documentation like this, I would like to leverage the AVD generated markdown documents but would like to skip the TOC on each of them since this is already handled for me with mkdocs.

Describe the solution you would like

TOC rendering with the option to disable it on input vars

Describe alternatives you have considered

Forking the documentation templates or building a custom template for device and fabric documentation.

Additional context

No response

Contributing Guide

gusmb commented 1 year ago

As a note, the rendering seemed correct on this demo for fabric:

https://github.com/arista-netdevops-community/ansible-avd-cloudvision-demo/blob/master/inventory/documentation/DC1_FABRIC/DC1_FABRIC.md?plain=1

But not for devices:

https://github.com/arista-netdevops-community/ansible-avd-cloudvision-demo/blob/master/inventory/documentation/devices/DC1-L2LEAF1A.md?plain=1

ClausHolbechArista commented 1 year ago

Partially duplicate of #1748

ClausHolbechArista commented 1 year ago

I suggest to change this request to only the optional TOC, and then add your input on headers to #1748.

gusmb commented 1 year ago

I suggest to change this request to only the optional TOC, and then add your input on headers to #1748.

Sounds good. I have edited the issue description accordingly and added my comment to the other issue.

ClausHolbechArista commented 1 year ago

For skipping TOC on device docs, we just need to adjust this to "{{ device_documentation_toc | arista.avd.default(true) }}" (or whatever key we decide on)

gusmb commented 1 year ago

Sounds good. I think that variable name is clear enough, and would only be used to disable the TOC. Maybe using the same variable name documentation_toc for both eos_cli_config_gen and eos_designs? Then people only have to define it once in group_vars (if you want to disable the TOC usually you would want to do it everywhere). And could pass var with different value explicitly to only one role if desired

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. The issue will be reviewed by a maintainer and may be closed

gusmb commented 1 year ago

This issue is still relevant.

ClausHolbechArista commented 1 year ago

Sure. We have removed the auto-close, so it will stay open.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. The issue will be reviewed by a maintainer and may be closed