Implement inline source blocks

https://orgmode.org/manual/Structure-of-Code-Blocks.html
This commit is contained in:
Niklas Fasching 2020-04-16 14:28:40 +02:00
parent 6ed46ba95d
commit 3018ace8d0
8 changed files with 83 additions and 21 deletions

View file

@ -97,6 +97,16 @@ func (w *OrgWriter) WriteBlock(b Block) {
w.WriteString("#+END_" + b.Name + "\n")
}
func (w *OrgWriter) WriteInlineBlock(b InlineBlock) {
w.WriteString(b.Name + "_" + b.Parameters[0])
if len(b.Parameters) > 1 {
w.WriteString("[" + strings.Join(b.Parameters[1:], " ") + "]")
}
w.WriteString("{")
WriteNodes(w, b.Children...)
w.WriteString("}")
}
func (w *OrgWriter) WriteDrawer(d Drawer) {
w.WriteString(w.indent + ":" + d.Name + ":\n")
WriteNodes(w, d.Children...)