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

Inserting backslash at beginning of C++ includes in highlight shortcode #228

Closed
ghost opened this issue Oct 24, 2018 · 4 comments
Closed

Comments

@ghost
Copy link

ghost commented Oct 24, 2018

Exporting

{{< highlight cpp >}}
#include <iostream>
#include <stdio>
{{< /highlight >}}

results in

\#include <iostream>
\#include <stdio>

Trying

{{< highlight cpp >}}
=#= include <iostream>
=#= include <stdio>
{{< /highlight >}}

results in

`#` include <iostream>
`#` include <stdio>
@kaushalmodi
Copy link
Owner

Org doesn't understand the Hugo shortcode syntax.

You need to write the code block in Org syntax. How does the below export?

#+begin_src cpp
,#include <iostream>
,#include <stdio>
#+end_src

@kaushalmodi
Copy link
Owner

I am not at comp, so I haven't tried the above, may be you don't even need those comma escapes on the 2 lines.

@ghost
Copy link
Author

ghost commented Oct 24, 2018

That worked. Just had to set pygmentsCodefences = true in my config file instead of using the shortcode (and the commas are not needed). Thank you!

@ghost ghost closed this as completed Oct 24, 2018
@kaushalmodi
Copy link
Owner

ox-hugo can always export to the highlight shortcode syntax in Markdown if you set #+hugo_code_fence: nil at the top of your Org file.

But I have set the default value of that config to t so that the standard triple-backtick code blocks are generated, because:

See this doc page for complete details on Org Source block support in ox-hugo: https://ox-hugo.scripter.co/doc/source-blocks/.

This issue was closed.
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

No branches or pull requests

1 participant