Skip to content
Snippets Groups Projects
Select Git revision
  • hotfix/issue-3
  • develop default
  • converters
  • v1.0.0
  • master protected
  • feature/imposition
  • imponer
  • feature/bundle-by-categories
  • 0.4.0
  • 0.3.0
  • 0.2.9.1
  • 0.2.9
  • 0.2.8
  • 0.2.7
  • 0.2.6
  • 0.2.5
  • 0.2.4
  • 0.2.3
  • 0.2.2
  • 0.2.1
  • 0.2.0
  • 0.0.7
  • 0.0.6
  • 0.0.5
  • issue-mpj
  • 0.0.4
  • issue-3
  • 0.0.3
28 results

jekyll-pandoc-multiple-formats

  • Clone with SSH
  • Clone with HTTPS
  • Nicolás Reynolds's avatar
    Issue #3 - Remove trailing dash
    fauno authored
    4780d304
    History
    Name Last commit Last update
    LICENSE
    README.md
    pandoc.rb

    Another pandoc plugin for jekyll

    This jekyll plugin was inspired by jekyll-pandoc-plugin but it was changed to generate multiple outputs, rather than just using pandoc to generate jekyll html posts. Besides, it doesn't require the 'pandoc-ruby' gem.

    It's used on En Defensa del Software Libre.

    What does it do

    First, it replaces the html generation for pandoc. This means you will have support for pandoc's markdown extensions, like strikethrough and [@cite].

    Second, it'll also generate the post in other formats you like, so your blog can be made available in different formats at the same time. Epub for ebook readers, mediawiki for copy&paste to wikis, etc.

    Configuration

    Add to _config.yml:

    pandoc:
      skip: false
      output: ./tmp
      flags: '--smart --bibliography=ref.bib'
      site_flags: '--toc'
      outputs:
        pdf: '--latex-engine=latex'
        epub:
        markdown:
    • skip allows you to skip the other formats generation and proceed with the regular jekyll site build.

    • flags is a string with the flags you will normally pass to pandoc on cli. It's used with all output types.

    • outputs is a hash of output formats (even markdown!). You can add output-specific flags.

    IMPORTANT: If you were using this plugin before 2013-07-17 you have to change your _config.yml syntax, change pandoc.outputs from array to hashes (see the example :)

    Front Matter

    Support for epub covers has been added. You can add the path to a cover on the front matter of the article to have pandoc add a cover image on the epub result.

    ---
    author: you
    title: awesome stuff
    cover: images/awesome.png
    ---
    
    etc...

    Layout

    Add this liquid snippet on your _layout/post.html to generate links to the other available formats from the post itself:

      <ul>
        {% for format in site.pandoc.outputs %}
        {% capture extension %}{{ format | first }}{% endcapture %}
        <li>
          <a href="{{ extension }}{{ page.url | remove:'.html' }}.{{ extension }}">
            {{ extension }}
          </a>
        </li>
        {% endfor %}
      </ul>

    How to run

    Execute jekyll build normally :D