Closed maelle closed 4 years ago
I wouldn't be opposed to wrapping up into a couple of hugodown::shortcode()
helpers.
wrapping what up? the pandoc blocks? or Hugo default shortcodes?
I'm wondering whether folks wanting to use shortcodes won't just want to copy-paste from theme docs.
Hmm… isn't that only marginally better than using blogdown::shortcode()
in an inline code chunk? This solution probably also doesn't bode well for my pkg
shortcode that produces an inline <span>
as it would also introduce extra linebreaks/paragraphs, right?
I do, however, very much appreciate your dive into the 🐇 🕳️ & giving it a go 😁
@jemus42 would you mind trying the workaround on your shortcode just to see what it does? but yeah it's not magical anyway, more typing. the typing reminds us we should write an R function. :grin:
Wrapping it up just like blogdown::shortcode()
; for inline short codes you'd use an inline html element (`<a>html</a>`{=html}
)
is the gain not having to remember the syntax?
I think the advantage is that hugodown could provide wrappers for common shortcodes, and they just work: https://github.com/r-lib/hugodown/pull/54/files#diff-9b4ee5398562b8355d3176408452cfb6R45
I think the advantage of an R function here is:
Ohhh, the inline-variant is exactly what I was missing, nice! I'll give it a go when I'm home, thanks the both of you for not giving up on shortcodes :sob:
Closing in favour of #54. Thanks for discovering this @maelle!
Using pandoc raw attributes
I now feel guilty using shortcodes in hugodown Rmd but I've just found how to escape them. :smiling_imp: Would it be worth documenting in a footnote somewhere or is it best kept as a secret tip among the Hugo rebels? (the test is a POC, not a test) cc @jemus42 @apreshill
FWIW for things like embedding tweets I agree R might do a better job with safe failures.