Git Product home page Git Product logo

jekyll-pandoc-multiple-formats's Introduction

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
  impose: 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.

  • impose creates ready to print PDFs if you're creating PDF output.

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 install

Add this snippet to your \_config.yml on jekyll 1.3

gems: [ 'jekyll-pandoc-multiple-formats' ]

Alternative, see here.

How to run

Execute jekyll build normally :D

jekyll-pandoc-multiple-formats's People

Contributors

candlerb avatar fauno avatar mauriciopasquier avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.