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

Added plantuml diagrams support #165

Merged
merged 7 commits into from
Jun 28, 2024
Merged

Added plantuml diagrams support #165

merged 7 commits into from
Jun 28, 2024

Conversation

DanZ-ix
Copy link
Contributor

@DanZ-ix DanZ-ix commented Jun 10, 2024

Summary

Added plantuml plugin, added plugin method process_md_before_html_convert(md: str) -> str, added dcoumentation

Details

Plantuml plugin support

New plugin can be used with tags [[plantuml start]] CODE [[plantuml end]], for example:

[[plantuml start]]
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml
[[plantuml end]]

This block is rendered using plantuml server (default is plantuml.com, custom can be defined with config) as an png diagram.
Plantuml code can be edited in .md file and after saving the diagram would be changed.
Two or more plantuml blocks are supported

New optional plugin method

Added new optional plugin method process_md_before_html_convert(md: str) -> str, that is called before converting .md file to html, but after saving it to the filesystem. It allows to make changes in md file that are not saved, but rendered in html.

Checks

  • In case of new feature, add short overview in docs/<corresponding file>
  • Tested changes

@Linbreux
Copy link
Owner

Linbreux commented Jun 23, 2024

Hi @DanZ-ix,

Thats again a nice implementation. Did not have the time to test it yet.

Would it be possible to make it like the mermaid plugin, inside a codeblock? (I know there is no documentation on this one yet...). I guess that makes more sense to me.

```mermaid
graph LR
A[Square Rect] -- Link text --> B((Circle))
A --> C(Round Rect)
B --> D{Rhombus}
C --> D
```

So it would be

```plantuml
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml
```

Copy link
Owner

@Linbreux Linbreux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a few small changes need to be made and then its ready for merging. It worked great!

docs/plugins.md Outdated Show resolved Hide resolved
docs/plugins.md Outdated Show resolved Hide resolved
docs/plugins.md Outdated Show resolved Hide resolved
docs/plugins.md Outdated Show resolved Hide resolved
docs/plugins.md Outdated Show resolved Hide resolved
docs/plugins.md Outdated Show resolved Hide resolved
src/wikmd/wiki_template/homepage.md Outdated Show resolved Hide resolved
docs/plugins.md Outdated Show resolved Hide resolved
@DanZ-ix DanZ-ix requested a review from Linbreux June 27, 2024 17:07
@Linbreux Linbreux merged commit 707fb09 into Linbreux:main Jun 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants