-
Notifications
You must be signed in to change notification settings - Fork 129
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
Code blocks exported from src_foo
blocks know their language
#638
Comments
There's code to do pretty much exactly this in |
I do that for my blog with this small workaround below, because Hugo doesn't yet support inline code block rendering natively. It's a 2-part implementation, and so I haven't baked it into Making
|
Right. I'm not really looking to highlight inline code, just have something
that can be styled with CSS independently of `~code~` fragments.
…On Wed, 18 May 2022 at 11:51, Kaushal Modi ***@***.***> wrote:
I do that for my blog with this small workaround below, because Hugo
doesn't yet support inline code block rendering natively.
It's a 2-part implementation, and so I haven't baked it into ox-hugo.
Making inline-src-block export to a custom shortcode
https://github.com/kaushalmodi/.emacs.d/blob/7cb6c4286f5ec2a4cd0852f7d49a8ff1c28f98ae/setup-files/setup-hugo.el#L36-L51
The inline_src shortcode
{{- transform.Highlight .Inner (.Get 0) (.Get 1 | default "")
| replaceRE `^<div class="highlight"><pre [^>]+>((.|\n)+)</pre></div>$`
`<span class="inline-src chroma">${1}</span>`
| replaceRE `<span class="line">((.|\n)+)</span>[ \n]*</code>`
`${1}</code>`
| safeHTML -}}
------------------------------
I had opened this issue on Hugo (gohugoio/hugo#9442
<gohugoio/hugo#9442>), we also almost had a
solution that would allow the built-in highlight shortcode to do the
inline code rendering, but that's stuck in limbo for a while.
—
Reply to this email directly, view it on GitHub
<#638 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABICAJ4MB6OQZBAMWTZ6DVKTDR7ANCNFSM5WH4D7ZA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@pdcawley This is now implemented! You can find an example in #578 (comment). |
@pdcawley Or you can see this update ox-hugo test: https://ox-hugo.scripter.co/test/posts/inline-code-blocks/#using-custom-css-for-inline-src-blocks Aside.. looks like we triggered a bug in Hugo.. the smart quotes rendering done by GoldMark happens inside the HTML |
Given some org source like this:
the current version of ox-hugo exports the following:
it would be immensely useful to me if the resulting markdown looked something like:
which allows me to distinguish in my stylesheets between actual code and generic code-ish stuff.
Essentially I want to be able to write, say:
in my stylesheets and have only
src_foo{...}
blocks wrapped in corner brackets.The text was updated successfully, but these errors were encountered: