First a little bit of context:
I'm writing an academical article on pandoc/yaml + Leo Editor. With this combination I can write in a really organic way. Leo Editor tree is used to organize the writing in a non-linear fashion, so I can see the main topics of the writing with nested deep on them, choose what to focus on in the next writing session and put some parts of the writing on holding and so on. Yaml nodes in the tree store the bibligraphical references and a custom made script node is used to convert that Leo tree to pandoc's markdown and that file is used to create the pdf.
Today I wrote something like this:
See the image [#hs-world-map]
---
type: image
file: ../Imagenes/hackerspaces-mapa-2014-ene.png
scale: 50
alias: hs-world-map
caption: |
Mapa mundial de los hackerspaces a enero 4 de 2014 registrados en
http://hackerspaces.org. Las concentraciones de hackerspaces están denotadas
por dos indicadores: el número y el color. Los colores rojos y números
grandes indican mayor concentración de hackerspaces, seguidos por los
naranja y números medianos y terminando en los azules, con números pequeños.
Se puede ver cómo este es un fenómeno global con mayor preminencia
anglo-europea (la costa este de Estados Unidos tiene 110 hackerspaces y
Europa 175) y menor notoriedad en Sur América, India, China y Africa.
Algunos de los contrastes respecto a la cultura hackers y como se
contextualiza en el Norte Global y en el Sur Global que se han mencionado en
este escrito, se hacen evidentes en este mapa.
...
This is a yaml block inside a pandoc's markdown document (the leading "---" is not showed properly), defining some properties and syntax I would like to have for images in pandoc like scale, alias and a better way to support long captions. External to the yaml block I have put some reference to the alias figure using and invented shorthand ("[#hs-world-map]"), similar to the one of [@cite] for bibliographic references.
I have seen from lua example and pandoc scripting guide that is possible to write custom writers that modify the pandoc output, but I don't know how to extract data from the yaml blocks and if using my own shorthand for cross-referencing figures ([#alias]) will work. So my question is:
- There is any example of how to extract yaml blocks data in markdown's pandoc and using it to insert that data in a modified output (preferably LaTeX and HTML)? I wouldn't matter to learn lua if it's necessary, but would be better if that example is on python, just to focus on writing the article.
(I think that this custom syntax could be a way to evolve pandoc sharing yaml blocks and custom writers, at least is a good experiment about how this can be done).