Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter support #293

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

alexdraconian
Copy link

@alexdraconian alexdraconian commented Jun 7, 2023

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)

Add mediawiki-like parameter support
Fix escaping "&" symbol
Add alias flag to 'parameters'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant