7 ms·
One thing I love about pandoc that I don't see mentioned here is the ability to apply filters to transform documents mid-conversion. I'm using Pandoc to write
by cosmic_quanta 6y ago
One thing I love about pandoc that I don't see mentioned here is the ability to apply filters to transform documents mid-conversion.
I'm using Pandoc to write my PhD thesis at the moment, from Markdown source, using certain filters to "augment" what Markdown can do. Examples:
https://github.com/LaurentRDC/pandoc-plot https://github.com/LaurentRDC/pandoc-plot
https://github.com/lierdakil/pandoc-crossref https://github.com/lierdakil/pandoc-crossref
More info here: https://pandoc.org/filters.html https://pandoc.org/filters.html
- vaccinator 6y agoIt must be pretty slow if you have time to change the settings while it is converting?
- recursive 6y agoNone of this has anything to do with how much time is taken. The whole thing could run in a millisecond.
- vaccinator 6y ago> One thing I love about pandoc that I don't see mentioned here is the ability to apply filters to transform documents mid-conversion. I read that as "mid-conversion" meaning that he can apply filters while the document is being converted
- BHSPitMonkey 6y agoPandoc applies the filters, not the user.
- schwartzworld 6y agolike using Middleware
- Forricide 6y agoNot sure if this is a joke but if you read the linked docs [0] you'll see that the concept of filters is that you the user can write programs (essentially plugin-style) that modify the AST Pandoc generates in order to perform the conversion. But this explanation is ultimately worse than the actual doc page, so I'd recommend just reading that. https://pandoc.org/filters.html https://pandoc.org/filters.html
- flobosg 6y agoWhat a coincidence! I am also writing my PhD thesis with pandoc and filters, but I use panflute for the latter: http://scorreia.com/software/panflute/ http://scorreia.com/software/panflute/
- zzleeper 6y agoI'm the author of panflute, and--in fact--wrote my PhD thesis in pandoc+panflute!
- ThisNameIsTaken 6y agoI'll be starting a PhD soon and would love to use a pandoc-based workflow (with MD or another format) for the gross of my writing. How did you all structure the commenting on your writing? I find converting to odt/doc before sending, managing all the exported versions with comments etc. becomes quite tedious. But I'm a bit reluctant to force my supervisors to use eg. git+criticmarkup[1]. I would love to hear you experiences! [1]: http://criticmarkup.com http://criticmarkup.com
- zzleeper 6y agoA few things: - In my case, my supervisors mostly had handwritten notes which rendered that point a bit moot. However, when I send the almost-complete draft to a professional copy editor, it was indeed a pain to add the comments. Either handwritten+scanned, as acrobat comments, or word comments, they had to be manually input into the markdown file. - Everything else worked relatively better. It was a bit tedious to type loooong pandoc commands "pandoc --filter=... etc etc" so I recently coded pandocmk [1] to make my life easier. It's not super well documented (but it's a quite short script, so readable), but the idea is that you type the command line options as metadata at the top. [1] https://github.com/sergiocorreia/pandocmk https://github.com/sergiocorreia/pandocmk
- kps 6y agoI've used that to process tables, essentially using markdown as a commented CSV format. The only nuisance is that a table can't yet have attributes — https://github.com/jgm/pandoc/issues/6317 https://github.com/jgm/pandoc/issues/6317 — the workaround being a pre-filter to copy them from a surrounding div. I've also toyed with using it to process code blocks, as a dead-simple literate programming tool.
- mb2100 6y agoPandoc tables can have attributes now! see https://github.com/jgm/pandoc-types/blob/master/src/Text/Pandoc/Definition.hs#L302 https://github.com/jgm/pandoc-types/blob/master/src/Text/Pan...
- jiggunjer 6y agomy uni requires MS Word...
- fn1 6y agoThat is the point of pandoc. You can write in markdown and then convert it to word for your uni.
- number6 6y agoFor MS Word Pandoc is a blessing: I configured a master file and now pandoc does all the tedious formatting!
- chrisseaton 6y agoWhat do you do when your advisor sends you back changes using the Word track feature? Can Pandoc apply the diff?
- mb2100 6y agoyes, see the `--track-changes` option: https://pandoc.org/MANUAL.html#option--track-changes https://pandoc.org/MANUAL.html#option--track-changes
- frobozz 6y agoI wrote my MSc in markdown with Pandoc. Loved it.
- yowlingcat 6y agoThis is going on a decade old, but I wrote my bachelor's thesis in pandoc. It made the otherwise painful very straightforward.
- phiresky 6y agoYeah, filters are great. Writing filters is easy: Pandoc basically converts the input document into a universal AST (json), and a filter is just any program that takes this json as an input and outputs a modified json AST. I wrote a filter that automatically converts URL citstions in markdown to "real" citations in any style you want - very useful for writing papers without fighting with bibtex and managing bibliographies manually: https://github.com/phiresky/pandoc-url2cite https://github.com/phiresky/pandoc-url2cite