From 598a4d882236a413fee69393826463c895f5287f Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Sun, 19 Aug 2018 16:59:28 -0400 Subject: [PATCH] Don't make Pandoc convert HTML spans to Pandoc style classes Use -bracketed_spans Fixes https://github.com/kaushalmodi/ox-hugo/issues/191. --- ox-hugo-pandoc-cite.el | 12 +++- test/site/content-org/all-posts.org | 28 ++++++++ .../citations-with-captions/nested-boxes.svg | 20 ++++++ .../posts/citations-with-captions/index.md | 65 +++++++++++++++++++ .../citations-with-captions/nested-boxes.svg | 20 ++++++ 5 files changed, 143 insertions(+), 2 deletions(-) create mode 100644 test/site/content-org/images/citations-with-captions/nested-boxes.svg create mode 100644 test/site/content/posts/citations-with-captions/index.md create mode 100644 test/site/content/posts/citations-with-captions/nested-boxes.svg diff --git a/ox-hugo-pandoc-cite.el b/ox-hugo-pandoc-cite.el index cee6194..3d31d04 100644 --- a/ox-hugo-pandoc-cite.el +++ b/ox-hugo-pandoc-cite.el @@ -13,8 +13,13 @@ ;; TODO: Change the defconst to defvar (defvar org-hugo-pandoc-cite-pandoc-args-list - '("-f" "markdown" - "-t" "markdown-citations-simple_tables+pipe_tables-fenced_divs-fenced_code_attributes" + `("-f" "markdown" + "-t" ,(concat "markdown-citations" + "-simple_tables" + "+pipe_tables" + "-fenced_divs" + "-fenced_code_attributes" + "-bracketed_spans") "--atx-headers" "--id-prefix=fn:") "Pandoc arguments used in `org-hugo-pandoc-cite--run-pandoc'. @@ -37,6 +42,9 @@ -fenced_code_attributes : Create fenced code blocks like \"``` lang .. ```\" instead of \"``` {.lang} .. ```\". + -bracketed_spans : Do not replace HTML tags with Pandoc + bracketed class notation \"{.some-class}\". + --atx-headers : Use \"# foo\" style heading for output markdown. --id-prefix=fn: : Create footnote ID's like \"[^fn:1]\" instead of diff --git a/test/site/content-org/all-posts.org b/test/site/content-org/all-posts.org index 94b30c7..f99ccc0 100644 --- a/test/site/content-org/all-posts.org +++ b/test/site/content-org/all-posts.org @@ -4853,6 +4853,34 @@ But that generates neither a Pandoc warning nor error. As the final Pandoc output Markdown ends up with *no* references, the Pandoc output is discarded, and the original ~ox-hugo~ output is used instead. +** DONE Citations with captions +CLOSED: [2018-08-19 Sun 16:24] +:PROPERTIES: +:EXPORT_HUGO_BUNDLE: citations-with-captions +:EXPORT_FILE_NAME: index +:EXPORT_HUGO_CUSTOM_FRONT_MATTER+: :link-citations true +:END: +{{{oxhugoissue(191)}}} +*** Why an electronic lab notebook? +At an age where data is moving from paper to electronic form, the +amount and *shape* of data is not very paper-compatible, and the +analysis of that same data becomes more complex, it is just obvious +that the move to an electronic notebook has to happen. +*** Why use Org mode? +Check out the code block in [[code__plantuml_nested_boxes]]. +*** Using code blocks +#+name: code__plantuml_nested_boxes +#+caption: Nested Boxes +#+begin_src plantuml :file images/citations-with-captions/nested-boxes.svg :eval yes :exports both +rectangle ", , etc." as a { + rectangle "
..." as b #antiquewhite { + rectangle "