[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Differentiate source blocks in export?
From: |
Marvin ‘quintus’ Gülker |
Subject: |
Re: Differentiate source blocks in export? |
Date: |
Tue, 24 Nov 2020 17:07:27 +0100 |
Hi!
Am Dienstag, dem 24. November 2020 schrieb Joost Kremers:
> I was wondering if there's a way to distinguish between different kind of
> source
> code blocks when exporting to HTML.
>
> Specifically, I would like a way to mark certain code blocks in my Org file so
> that those code blocks get a specific class in the HTML export.
You can use the BEGIN_EXPORT/END_EXPORT pair to include a literal HTML
DIV tag around your target code block. Try this:
Wrapped code block in a div with a custom class:
#+BEGIN_EXPORT html
<div class="myclass">
#+END_EXPORT
#+BEGIN_SRC c
#include <stdio.h>
int main(int argc, char* argv[])
{
printf("This is wrapped in the div\n");
return 0;
}
#+END_SRC
#+BEGIN_EXPORT html
</div>
#+END_EXPORT
Normal codeblock without:
#+BEGIN_SRC c
#include <stdio.h>
int main(int argc, char* argv[])
{
printf("This is not wrapped in anything unusual\n");
return 0;
}
#+END_SRC
Note how one of the EXPORT blocks wraps the opening tag of the DIV and
the other one wraps the closing tag.
-quintus
--
Dipl.-Jur. M. Gülker | https://mg.guelker.eu | For security:
Passau, Germany | kontakt@guelker.eu | () Avoid HTML e-mail
European Union | PGP: see homepage | /\ http://asciiribbon.org
- Differentiate source blocks in export?, Joost Kremers, 2020/11/24
- Re: Differentiate source blocks in export?, John Kitchin, 2020/11/24
- Re: Differentiate source blocks in export?,
Marvin ‘quintus’ Gülker <=
- Re: Differentiate source blocks in export?, John Kitchin, 2020/11/24
- Re: Differentiate source blocks in export?, Diego Zamboni, 2020/11/24
- Re: Differentiate source blocks in export?, Eric S Fraga, 2020/11/24
- Re: Differentiate source blocks in export?, Joost Kremers, 2020/11/24
- Re: Differentiate source blocks in export?, Eric S Fraga, 2020/11/25
- Re: Differentiate source blocks in export?, Joost Kremers, 2020/11/25
- Re: Differentiate source blocks in export?, Eric S Fraga, 2020/11/25
- Font lock in inner blocks [was: Re: Differentiate source blocks in export?], Joost Kremers, 2020/11/25
- Re: Differentiate source blocks in export?, Joost Kremers, 2020/11/24