Skip to content

Commit

Permalink
changed plugin declaration, added docs for plantuml, mermaid
Browse files Browse the repository at this point in the history
  • Loading branch information
DanZ-ix committed Jun 24, 2024
1 parent cdfd57e commit 154246a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ For now there are only a few supported.
- `[[ page: some-page ]]` Allows to show an other page in the current one.
- `[[swagger link]]` Allows to insert a **swagger** block into the wiki page. Link in annotation should lead
to a GET endpoint with .json openapi file. `[[swagger https://petstore3.swagger.io/api/v3/openapi.json]]`
can be used as an example.
- `[[plantuml start]]`, `[[plantuml end]]` Allows to embed a plantuml diagram. [Plantuml](https://plantuml.com) code
can be used as an example.
- \`\`\`plantuml CODE \`\`\` Allows to embed a plantuml diagram. [Plantuml](https://plantuml.com) code
should be between those tags. A custom plantuml server can be defined using configuration file.

- \`\`\`mermaid CODE \`\`\` Allows to embed a mermaid diagram. [Mermaid](https://mermaid.js.org/intro/) code
should be between those tags.

## Adding a plugin

Add the plugin to the `plugins` folder and add the `foldername` to section `plugins` in the `wikmd-config.yaml` file.
Expand Down
3 changes: 2 additions & 1 deletion src/wikmd/plugins/plantuml/plantuml.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def process_md_before_html_convert(self, md: str) -> str:
"""
returns the md file after before html convertation
"""
plantuml_code_blocks = re.findall(r"(\[\[plantuml_start]](.*?)\[\[plantuml_end]])", md, re.DOTALL)
plantuml_code_blocks = re.findall(r"(```plantuml(.*?)```)", md, re.DOTALL)
print(plantuml_code_blocks)
for code_block in plantuml_code_blocks:
full_block, code = code_block
compressed_code = self.encode_plantuml(code)
Expand Down

0 comments on commit 154246a

Please sign in to comment.