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

shortcodes filter #231

Closed
wants to merge 1 commit into from
Closed

shortcodes filter #231

wants to merge 1 commit into from

Conversation

jjallaire
Copy link

Shortcodes are a feature of Quarto implemented as a Lua filter that @nichtich asked us to factor out and contribute here (quarto-dev/quarto-cli#904) so that they can be used outside of Quarto.

Shortcodes are a form of parameterized macro substitution, with syntax based on that already used by Hugo shortcodes. For example, the following shortcode prints the title from document metadata:

{{< meta title >}}

Shortcodes can return an inline or block element (or list of either) and can be used in both inline and block contexts (the results are normalized as appropriate).

The shortcodes.lua filter supports several shortcodes natively:

Shortcode Description
meta Print value from document metadata
env Print system environment variable
pagebreak Insert a native page-break

In addition, you can create custom shortcodes in Lua (see details in README.md).

@jjallaire
Copy link
Author

Discussing this w/ @tarleb he pointed out that there is some debate about how these filters should be aggregated (repo w/ embedded source code as is now, list of links, etc.): #207. I'll close this PR for now pending resolution of that discussion (happy to contribute this in whatever fashion makes after there is more clarity)

@jjallaire jjallaire closed this May 18, 2022
@tarleb
Copy link
Member

tarleb commented May 18, 2022

For reference: The filter has been published at https://github.com/quarto-dev/quarto-shortcodes.

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.

2 participants