-
Notifications
You must be signed in to change notification settings - Fork 344
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
Allow shortcodes expansion in icon
attribute/YAML/code cell option
#10004
Comments
Is shortcode allowed on Div syntax attributes in general ? Your issue is quite specific to dashboard and valuebox, but I think using shortcodes on Fenced Div attributes is not working in general. Shortcode replacement for this happens in AST processing, but our reader does not see initially a Div. Take this ---
title: test
keep-md: true
format: html
---
::: {.custom title="{{< meta title >}}"}
Content
::: But using trace, the starting Doc is a Para first
So I don't know enough about Shortcode handling to see how / if this could be supported |
The use case was indeed mostly the dashboard, but the enhancement could be more broad. |
There's a few things to check here. One of them is that when using shortcodes inside attributes, we currently have a limitation where we expect the attributes to be specified with single quotes. So this works:
However, I think that is won't work for |
What's going onShortcodes are processed in the shortcodes filter: quarto-cli/src/resources/filters/main.lua Line 262 in 79bdce8
This shortcode filter does process shortcodes inside attributes; the issue is that by the time we get to the shortcodes filter, the content is no longer inside an attribute. That happens because custom AST nodes are processed in We need that specific order, because shortcodes in the main markdown body are actually custom AST nodes (we made that design choice to fix old bugs like I don't like the fact that we'll have shortcode resolution happening in different stages, but I don't think we can avoid that. |
For other Quarto components, you can use the
text: "{{< iconify octicon:issue-opened-16 >}} Opened Issues"
to get an icon from a shortcode in most places (instead oficon: name
), but for value box, you can't do that as the icon gets a particular treatment for it to appear on the left of the content of the value box.It would be nice to be able to use more icons than the limited set of Bootstrap in particular in value box in dashboard as there are no alternatives/workarounds:
The approach of allowing shortcode inside
icon
could also be expanded to allicon
everywhere in Quarto.The text was updated successfully, but these errors were encountered: