dokufreaks / plugin-include

A DokuWiki plugin for including other wiki pages into the current one.
http://www.dokuwiki.org/plugin:include
GNU General Public License v2.0
62 stars 54 forks source link

Add parameter support #293

Open alexdraconian opened 1 year ago

alexdraconian commented 1 year ago

Replaces #267

Add mediawiki-like parameter support. Since original branch("template" branch) is far behind from present, I just implemented template functionality myself.

  1. Added "{{{name}}}" syntax as placeholders. This syntax will be hidden on render. Example: {{{1}}}, {{{2}}}, {{{some_name}}}

  2. Parameter syntax is like this: {{page>pagename#section&parameters=param1|param2|param3...}} {{page>pagename#section&parameters=name1=param1|name2=param2|name3=param3...}}

Wiki syntax can be used as parameter value.

vertical bar can be escaped with backslash. like this: {{page>pagename?parameters=value\|with\|vertical bar|this is value 2}} Which resolves to: {{{1}}} -> value|with|vertical bar {{{2}}} -> this is value 2

When name is not provided, they will be automatically resolved as integer names - 1, 2, 3, so on.

Wiki syntax can be used with parameter.

{{page>pagename?parameters=[[link\|some link]]}} Which resolves to: {{{1}}} -> [[link|some link]] (Rendered as internal wiki link)