Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use PlantUML diagram code in PHP/Phabricator

Looking for advice from developers phamiliar with PHP, or Phabricator internals, on how to make Phabricator to have PlantUML (text to UML diagrams) within wiki pages, tasks. So that this UML code snippet in GitHub/GitLab grammar

```plantuml

Bob->Alice : hello

```

would be shown as diagram on rendered wiki page.

sequence diagram generated example

"Call it from PHP" page on https://plantuml.com/demophp.php is 404 - Not Found.

UPDATE Please add answer with any further improvements or suggestions.

like image 263
Paul Verest Avatar asked Mar 18 '21 06:03

Paul Verest


People also ask

How do you create a UML diagram in PlantUML?

Use the PlantUML plugin in Rider to create UML diagrams that can be integrated into your codebase. Start by adding a . puml file. Each new file that PlantUML creates contains example PUML, which is PlantUML's own syntax for creating UML diagrams.

How do I export a PlantUML diagram?

To export to SVG or PNG: place your cursor within the desired PlantUML text, open the command palette (Ctrl-Shift-P on my PC); or right click and select Command Palette... Choose "PlantUML: Export Current Diagram"


1 Answers

The syntax you have used is for syntax highlighting of source code. I think it would be better to define a new remarkup tag for this purpose (by extending PhabricatorRemarkupCustomBlockRule in a custom extension) rather than trying to overload syntax highlighting.

Unfortunately I can't find any examples of extending PhabricatorRemarkupCustomBlockRule, but there are examples of extending PhabricatorRemarkupCustomInlineRule which should be similar, such as here: https://discourse.phabricator-community.org/t/hyperlink-to-external-bug-tracking-system/1415

like image 67
JSON Avatar answered Oct 29 '22 05:10

JSON