gmunguia / markdown-it-plantuml

:herb: :book: plantuml diagrams in your markdown
MIT License
98 stars 21 forks source link

Make plantuml server url configurable #5

Closed chbndrhnns closed 6 years ago

chbndrhnns commented 6 years ago

In case I would like to use a private instance of a plantuml server, I would like to be able to configure the markdown plugin to use a custom URL.

gmunguia commented 6 years ago

Hi! Thanks your using this plugin =)

It should be possible to do what you want using the generateSource option:

function customSrcGenerator (umlCode) { 
    return `https://your.server/plant-uml/${yourEncodeFunction(umlCode)}`; 
}

var md = require('markdown-it')()
    .use(require('markdown-it-plantuml'), { generateSource: customSrcGenerator });

Let me know how it goes!

chbndrhnns commented 6 years ago

I wanted to suggest this feature to the Boostnote IO developers and now I posted your example to the corresponding issue.

https://github.com/BoostIO/Boostnote/issues/1592

gmunguia commented 6 years ago

Great! I have updated the docs to include the example.