markdown-it-plantuml icon indicating copy to clipboard operation
markdown-it-plantuml copied to clipboard

[FeatureRequest] Add additional diagram types

Open hschaefer123 opened this issue 3 years ago • 2 comments

Hi gmunguia, it would be great, if your plugin would support also addtional diagram types like JSON Data (@startjson) and YAML Data (@startyaml) or Word Breakdown (@startwbs).

Sadly they have an addional syntax and i would have to copy your branch to support it.

The best place would be your plugin supporting the addtional syntaxes as well, if this would be easily possible for you.

Thanks for creating this heavily used plugin.

Best Regards Holger

hschaefer123 avatar Jul 11 '21 08:07 hschaefer123

It already supports this. You'll have to use the plugin once for each of the diagram types you want to support.

md.use(require('markdown-it-plantuml'), {
  openMarker: '```plantuml',
  closeMarker: '```',
  diagramName: 'uml',
  imageFormat: 'svg',
});
//Work Breakdown Structure https://plantuml.com/wbs-diagram
md.use(require('markdown-it-plantuml'), {
  openMarker: '```wbs',
  closeMarker: '```',
  diagramName: 'wbs',
  imageFormat: 'svg',
});
// JSON https://plantuml.com/json
md.use(require('markdown-it-plantuml'), {
  openMarker: '```jsondiagrom',
  closeMarker: '```',
  diagramName: 'json',
  imageFormat: 'svg',
});
// YAML https://plantuml.com/yaml
md.use(require('markdown-it-plantuml'), {
  openMarker: '```yamldiagram',
  closeMarker: '```',
  diagramName: 'yaml',
  imageFormat: 'svg',
});

carlo-quinonez avatar Oct 19 '21 21:10 carlo-quinonez

Hi Carlo, sorry, that i forgot to say thank you for the tip!

Just tried it with ditaa and ran into issues, but figured out, that svg is not supported (just rendering images).

md.use(require('markdown-it-plantuml'), {
  openMarker: '```ditaa',
  closeMarker: '```',
  diagramName: 'ditaa',
  imageFormat: 'png',
});

Thanks for the great plugin!

BTW: How can i pass in ditaa params? Using @startuml i can control it with the seconde line like ditaa(-E)

How is this working, if i am using custom start params like ```ditaa?

I am heavily using it at btp.udina.de

Best Regards Holger

hschaefer123 avatar Feb 23 '22 09:02 hschaefer123