Giter Site home page Giter Site logo

jekyll-rst's Introduction

Overview

This plugin adds ReStructuredText support to Jekyll and Octopress. It renders ReST in posts and pages, and provides a custom directive to support Octopress-compatible syntax highlighting.

Requirements

  • Jekyll or Octopress >= 2.0
  • Docutils
  • Pygments
  • RbST

Installation

  1. Install Docutils and Pygments.

    The most convenient way is to use virtualenv_burrito:

    $ curl -s https://raw.github.com/brainsik/virtualenv-burrito/master/virtualenv-burrito.sh | bash
    $ source /Users/xdissent/.venvburrito/startup.sh
    $ mkvirtualenv jekyll-rst
    $ pip install docutils pygments
    
  2. Install RbST.

    If you use bundler with Octopress, add gem 'RbST' to your Gemfile in the development group, then run bundle install. Otherwise, gem install RbST.

  3. Install the plugin.

    For Jekyll:

    $ cd <jekyll-project-path>
    $ git submodule add https://github.com/xdissent/jekyll-rst.git _plugins/jekyll-rst
    

    For Octopress:

    $ cd <octopress-project-path>
    $ git submodule add https://github.com/xdissent/jekyll-rst.git plugins/jekyll-rst
    
  4. Start blogging in ReStructuredText. Any file with the .rst extension will be parsed as ReST and rendered into HTML.

    Note

    Be sure to activate the jekyll-rst virtualenv before generating the site by issuing a workon jekyll-rst. I suggest you follow Harry Marr's advice and create a .venv file that will automatically activate the jekyll-rst virtualenv when you cd into your project.

Source Code Highlighting

A code-block ReST directive is registered and aliased as sourcecode. It adds syntax highlighting to code blocks in your documents:

.. code-block:: ruby

   # Output "I love ReST"
   say = "I love ReST"
   puts say

Optional arguments exist to supply a caption, link, and link title:

.. code-block:: console
   :caption: Read Hacker News on a budget
   :url: http://news.ycombinator.com
   :title: Hacker News

   $ curl http://news.ycombinator.com | less

Octopress already includes style sheets for syntax highlighting, but you'll need to generate one yourself if using Jekyll:

$ pygmentize -S default -f html > css/pygments.css

Octopress Tips

  • Use .. more in your ReST documents to indicate where Octopress's excerpt tag should split your content for summary views.

jekyll-rst's People

Contributors

pelletier avatar vhanda avatar xdissent avatar

Watchers

 avatar  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.