HTML export: Export src block language as css class
Org mode exports source blocks with the language as a css-class of the exported source block - it's easy enough to do the same.
This commit is contained in:
parent
f1a747ad72
commit
37d33c1206
8 changed files with 30 additions and 2 deletions
|
@ -108,7 +108,8 @@ func (w *HTMLWriter) WriteBlock(b Block) {
|
|||
if len(b.Parameters) >= 1 {
|
||||
lang = strings.ToLower(b.Parameters[0])
|
||||
}
|
||||
w.WriteString(w.HighlightCodeBlock(content, lang) + "\n")
|
||||
content = w.HighlightCodeBlock(content, lang)
|
||||
w.WriteString(fmt.Sprintf("<pre class=\"src src-%s\">\n%s\n</pre>\n", lang, content))
|
||||
case name == "EXAMPLE":
|
||||
w.WriteString(`<pre class="example">` + "\n" + content + "\n</pre>\n")
|
||||
case name == "EXPORT" && len(b.Parameters) >= 1 && strings.ToLower(b.Parameters[0]) == "html":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue