uml - 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.

Answer

Solution:

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

Source