lejmr / dokuwiki-plugin-drawio

Draw.io plugin for DokuWiki
https://www.dokuwiki.org/plugin:drawio
GNU General Public License v2.0
25 stars 13 forks source link

Using dynamic values in naming syntax #31

Open Anonymous215025 opened 4 years ago

Anonymous215025 commented 4 years ago

Right now, you have to manually define the namespace and image name in the syntax:

{{drawio>namespace:image-name}}

It would be really good if we can use dynamic values where

namespace = @NS@ and it refers to the namespace the page is on. image-name = @FILE@ referring to the page id.

So let's say you have a chocolate cake recipe diagram, instead of writing out

{{drawio>food:chocolate_cake_diagram}}

You write:

{{drawio>@NS@:@FILE@_diagram}}

And it will get you the above. Having this dynamic naming scheme allows a lot of flexibility and easier copy and pasting to other pages to generate its own name.

Here are more examples (https://www.dokuwiki.org/namespace_templates). Thank you!

lejmr commented 4 years ago

Oh thank you. I did not even know anything like this is possible. Will put it on list of features. Feel free to send me back a pull request