Skip to content

Commit

Permalink
Minor modifications (comments + github shield)
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Franceschetti committed Apr 30, 2023
1 parent 82cb831 commit b167c41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI](https://img.shields.io/pypi/v/mkdocs-mermaid2-plugin)](https://pypi.org/project/mkdocs-mermaid2-plugin/)
![Github](https://img.shields.io/github/v/tag/fralau/mkdocs-mermaid2-plugin?label=github%20tag)
![Downloads(PyPI)](https://img.shields.io/pypi/dm/mkdocs-mermaid2-plugin)


Expand Down
6 changes: 3 additions & 3 deletions mermaid2/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def full_config(self):
@property
def mermaid_args(self):
"""
The arguments for mermaid.
The arguments for mermaid, found in the config file.
"""
return self._mermaid_args

Expand Down Expand Up @@ -249,13 +249,13 @@ def on_post_page(self, output_content, config, page, **kwargs):
new_tag = BeautifulSoup(self.mermaid_script, 'html.parser')
soup.body.append(new_tag)
# info(new_tag)
# initialization command
# insertion of the <script> tag, with the initialization arguments
# (self.mermaid_args), as found in the config file.
new_tag = soup.new_tag("script")
if self.activate_custom_loader:
# if the superfences extension is present, use the specific loader
self.mermaid_args['startOnLoad'] = False
js_args = pyjs.dumps(self.mermaid_args)
#new_tag.string = "window.mermaidConfig = {\n default: %s\n}" % js_args
new_tag.string = "window.mermaidConfig = {default: %s}" % js_args
else:
js_args = pyjs.dumps(self.mermaid_args)
Expand Down

0 comments on commit b167c41

Please sign in to comment.