se-edu / guides

Style guides and tutorials for SE student projects
MIT License
7 stars 26 forks source link

Enhance documentation on MarkBind's built-in PlantUML support with examples #88

Open mfjkri opened 1 month ago

mfjkri commented 1 month ago

Situation

Currently, in the PlantUML guide, there is a section about using MarkBind with PlantUML.

Saving the Diagram as an image

  • When using MarkBind as the site generation tool:
    • MarkBind has built-in support for PlantUML. The diagram will be generated and saved as an image automatically. No additional work needed from you.
  • When using Jekyll as the site generation tool:
    • The PlantUML integration plugin allows you to export individual diagrams to a location of your choosing. Click the Save Current Diagram Only button and choose the location to export the image file.
    • You will have to git add any new diagrams generated!

Problem

It lacks details on how the built-in support works. The current text might leave users uncertain about what this support entails and how to fully use it. This was something I faced while working on an earlier PR.

Proposed Solution

Expand on the explanation by providing a few examples of how to use PlantUML with MarkBind, giving users more clarity on its built-in support.


(Elaboration to be added)

To link to an external .puml file, add this line to your markdown:

<puml src="path/to/your/diagram.puml" width=300 />

Alternatively, you can embed the diagram directly within the markdown:

<puml width="300">
@startuml
Alice -> Bob : Hello
Bob -> Bob : Self-call
Bob -> George : Create
@enduml
</puml>
damithc commented 1 month ago

@mfjkri Good point. But describing how to use PlantUML in MarkBind should be MarkBind's job. Perhaps we add a note on how to use PlantUML with Jekyll and MarkBind, with the latter pointing to https://markbind.org/userGuide/components/imagesAndDiagrams.html#plantuml-diagrams ?

mfjkri commented 1 month ago

Hi Prof, I agree with your suggestion! If we add this note to the PlantUML guide, I believe it would fit well directly under the “Saving the Diagram as an Image” section (which is part of the broader “Creating/editing/exporting diagrams” section).

I’ve attached an illustration for clarity.

IMAGE 2024-09-25 12:49:20

Would this be suitable or would there be a better way of representing this note?

damithc commented 1 month ago

Would this be suitable or would there be a better way of representing this note?

@mfjkri Yes, I think so. Go ahead if you plan to submit a PR.