Summary | Placeholder Forms will let you build dynamic documentation, by creating a form that replaces any occurrence of a =PATTERN= in your post with the value from a text or selectable input field. | |
Preview | Preview on Discourse Theme Creator | |
Repository Link | https://github.com/discourse/discourse-placeholder-theme-component | |
New to Discourse Themes? | Beginnerās guide to using Discourse Themes |
Install this theme component
Features
Add placeholders to posts in this format:
[wrap=placeholder key=NAME description="Your name"][/wrap]
[wrap=placeholder key=COUNTRY default=US defaults=FR,DE,US,CN,AU,CA][/wrap]
Your email: =NAME=-=COUNTRY=@example.com
And this will result in:
This is used in mailing list
Your email: =ZNAME=-=ZCOUNTRY=@example.com
As seen above, text inside the wrapper will be used as a long description.
[wrap=placeholder key=NAME description="Your name"]
This is used in mailing list
[/wrap]
Available keys
- key: The key that should be replaced in your post
- default/defaults: default value(s)
- description: a placeholder text for the input
Examples
# create a new plugin
rails g plugin =PLUGIN_NAME=
cd plugins/=PLUGIN_NAME=
We use it to create runbooks, howtos and reusable templates (it will work in code blocks). Please share your use cases!
Settings
Translation | Default |
---|---|
toolbar.builder | Add Placeholder |
builder.errors.no_key | A key is required. |
builder.title | Add Placeholder |
builder.insert | Insert |
builder.key.label | Key |
builder.key.description | The =Key= to be replaced in the post. |
builder.description.label | Description |
builder.description.description | Description displayed on input with no value set. |
builder.values.label | Default value(s) |
builder.values.description | Optional value(s) for your placeholder, if multiple values are defined, a select will be used. |
Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.
Last edited by @JammyDodger 2024-06-13T22:28:45Z
Check document
Perform check on document: