fauno / jekyll-pandoc-multiple-formats

Use pandoc on jekyll to generate posts in multiple formats. Development has moved to https://0xacab.org/edsl/jekyll-pandoc-multiple-formats
https://endefensadelsl.org
Other
89 stars 28 forks source link

pass post metadata to pandoc #16

Closed bewest closed 9 years ago

bewest commented 9 years ago

If someone is using a sophisticated template, this would allow an author to eg mark an article as a draft, allowing the template to take advantage of the metadata from the post.

This passes the metadata in the post to pandoc. In my use case, I wanted to mark articles/technical reports as drafts, and my template will take advantage of this only if the metadata is passed in.

fauno commented 9 years ago

hey, so this makes use of the pandoc's yaml_metadata_block extension? :)

doesn't it need "---" before?

bewest commented 9 years ago

Ahh, I thought it might need --- prefixed, but found it's already included in the output... Figured it must be side-effect from to_yaml? I saw that the tail one did need to be appended, and thought the inconsistency was puzzling.

Yes, I'm using this to set version:or draft: true, and then conditionally including draftwatermark in a standalone template. This, and other tricks, like setting documentclass to letter all work without explicitly including that extension, per default, I haven't even gotten around to experimenting with all the features yet.

FWIW, I <3 your work on that en defense... journal, very nice. I'm hoping to use this to similarly organize technical reports, and formal FDA submissions.

fauno commented 9 years ago

haha way to get your pr accepted :P

i have to go but when i get back i'll merge it, thanks!

bewest commented 9 years ago

I posted my tweaks to a junk repo here: https://github.com/bewest/towards-markdown-tr

In roadmap I set draft: true. Then I specify an extra template for pdf output that includes some special lines:

The template is just pandoc -D latex with the following stanza added:

$if(draft)$
\usepackage{draftwatermark}
$endif$

In my usage here, pandoc is being fed two --template switches, but it doesn't seem to mind at all. Hope this helps! It would be cool to see some kind of document versioning, but that's probably outside your scope/concerns. I didn't quite fully understand how you version "editions" of the journal vs the posts... the Makefile in one of the branches has some special rules for compiling the journal as a whole? Thanks again for awesome work.

fauno commented 9 years ago

mmm the branch you should be looking at is queue, we should make a release to the master branch soon.

the makefile is an ugly patch to jekyll, because we haven't found a way to tell jekyll to bundle articles together like chapters of a book. the makefile concatenates the posts and creates a collection, which we later print as a book.

fauno commented 9 years ago

the posts in src/_posts should be removed, because we moved them to another repo called articulos.git. so far we've been working on them in that other repo and copying them whole to edsl.org