dokuwiki_plugin_wrap icon indicating copy to clipboard operation
dokuwiki_plugin_wrap copied to clipboard

Alternative short-hand syntax

Open GJRobert opened this issue 5 years ago • 0 comments

Hi, wrap plugin is really an intensely used one, because its versatile ability of creating nearly every kind of inline/block elements.

Before using DokuWiki, I have long been using TiddlyWiki Classic which comes with span/div syntax too:

{{customClassName{Some random text}}} ← <span>

{{customClassName{
 Some random text
}}}
↑<div>

The syntax was simple: almost the same {{xx{YYY}}} for both spans and divs, and adding a linefeed in it makes them become divs.

I've always wonder if we can have similar syntaxes for wrap plugin for years. Of course {{...}} is not available since it's for DokuWiki media files; and of course we don't have to use one syntax to rule them both.

Will it be possible to make something like below?

{[class #id width[ for spans ]}

{[class #id width[{ for divs }]}

I just tried to hack in the current wrap plugin file, with which I can yield a span, but CSS class and other attributes not yet effective: https://github.com/GJRobert/dokuwiki_plugin_wrap/commit/a81e284ecf60ab7d2ded15dd31ed0e0ca6b75dbf

I definitely lack enough knowledge of regex, which is the reason I'm stuck. Can you provide a hint to make it work?

GJRobert avatar Oct 29 '20 14:10 GJRobert