[Template] Update : enabling/disabling comments & easy disabling generating graph #76
Mara-Li
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone!
Following a request, I little edited the comments system and the graph building.
Enable or disable globally & for each page the comments system
To do that, I updated the
overrides/hooks/on_env.py
file (because Jinja doesn't work as I want...) and add this function:I also, obviously, updated the
def on_env()
function:After that, I updated the file
overrides/partials/comments.html
like that:Now, you can play with two things : Your
mkdocs.yml
(in extra and by each file using the frontmatter. The two use the samecomments
key.comments: false
in yourmkdocs.yml
, it will disable globally the comments. In this case, if you want to enable the comments, you need to setcomments: true
in the frontmatter of the choosen file.comments: true
and disable for each file usingcomments: false
Disable graph generator without editing the python file
I can be pretty inconvenient to edit the file if you want to disable the graph, mainly for testing purpose. Now, you can enable the graph generation using the
mkdocs.yml
, as here.To do that, I edited the
def on_env
inon_env.py
:And I removed the line
generate_graph()
right after the functionPar default, the graph will be generated (aka if you don't set any key). You need to add
generate_graph: false
to disable it.In case you need, just download the edited file from the template !
Beta Was this translation helpful? Give feedback.
All reactions