mikitex70 / plantuml-markdown

PlantUML plugin for Python-Markdown
BSD 2-Clause "Simplified" License
192 stars 55 forks source link

PlantUML JSON support #54

Closed ldeluigi closed 3 years ago

ldeluigi commented 3 years ago

Please add support for json: https://plantuml.com/json

Maybe with ::json::

::end-json::

And

```plantjson
{
...
}
mikitex70 commented 3 years ago

Hi @ldeluigi, have you tried to use @startjson and @endjson in the code diagram, inside the fence? It should work...

ldeluigi commented 3 years ago

I tried putting an !include Value.puml directive

Value.puml contains @startjson and @endjson

And it doesn't work:

It gives syntax error at line 3

At line 3 I have the first open curly bracket of the json

mikitex70 commented 3 years ago

Without includes it works. Example:

# Title

```uml
@startjson
{
   "fruit":"Apple",
   "size":"Large",
   "color":"Red"
}
@endjson

Output:
![immagine](https://user-images.githubusercontent.com/2070527/119018702-a89f9700-b99c-11eb-8081-676bb5afe2cf.png)
mikitex70 commented 3 years ago

It works with include also. Example (test.md):

# Title

```uml
@startjson
!include value.json
@endjson
value.json:
```json
{
   "fruit":"Apple",
   "size":"Large",
   "color":"Red"
}

output: immagine

ldeluigi commented 3 years ago

Curious: I'll try more use cases and I will let you know

ldeluigi commented 3 years ago

image

ldeluigi commented 3 years ago

I didnt' put the !include inside two @startjson @endjson But now I think I need to do it

ldeluigi commented 3 years ago

Ok now it works! Well thanks for the support