Update README

This commit is contained in:
pR0Ps 2014-12-25 00:41:29 -05:00
parent 67e080a663
commit 008f240a8c

View File

@ -1,5 +1,5 @@
pelican-md-yaml pelican-md-metayaml
=============== ===================
This [Pelican](https://github.com/getpelican/pelican) plugin adds a reader for Markdown files with [YAML](https://en.wikipedia.org/wiki/YAML) metadata. This [Pelican](https://github.com/getpelican/pelican) plugin adds a reader for Markdown files with [YAML](https://en.wikipedia.org/wiki/YAML) metadata.
As the well-known static site generator [Jekyll](https://github.com/jekyll/jekyll) uses Markdown files with YAML metadata, this eases migration from Jekyll to Pelican. As the well-known static site generator [Jekyll](https://github.com/jekyll/jekyll) uses Markdown files with YAML metadata, this eases migration from Jekyll to Pelican.
@ -16,54 +16,37 @@ Dependencies
Installation Installation
------------ ------------
Copy the `md_yaml` directory to the `plugins` directory of your Pelican project (or whatever directory you specified for plugins in Pelican's `PLUGIN_PATHS` setting) and add `'md_yaml'` to the list of plugins (Pelican setting `PLUGINS`) of your project. Clone this repo (and it's submodules) to the `plugins` directory of your Pelican project (or whatever directory you specified for plugins in Pelican's `PLUGIN_PATHS` setting) and add `'md_metayaml'` to the list of plugins (Pelican setting `PLUGINS`) of your project.
To make sure the submodule is included use `git clone --recursive [repo] [path]`
Alternatively, you can clone normally, then run `git submodule update --init` to checkout the submodule
Usage Usage
----- -----
All your Markdown files (ending in `.md`, `.markdown`, `.mkd` and `.mdown`) will now be interpreted as using YAML for their metadata. All your Markdown files (ending in `.md`, `.markdown`, `.mkd` and `.mdown`) will now be interpreted as using YAML for their metadata.
The following example shows a very simple article (only one line of text at the bottom) but with quite complex metadata (everything between the `---`): The following example shows a very simple article (only one line of text at the bottom) but with quite complex metadata (everything between the `---`):
``` ```
--- ---
template: article_recipe title: Some title
title: Tiramisù author: Some person
components: tags:
- name: Tiramisù - tag 1
for: 10 - tag 2
ingredients: date: 2014-12-25 00:00
- - 4 data:
- eggs - name: some name
- - 150g options:
- sugar - opt 1
- - 10 small cups - opt 2
- espresso - opt 3
- - 500g
- mascarpone
- - 1 package
- ladyfingers
steps: steps:
- Cook the espresso, pour it into a soup plate. - Step 1
- Separate the eggs very carefully. - Step 2
- Add very little salt to the egg white. - Step 3
- Blend egg yolk and sugar and mix it extensively for some minutes using a mixer, until you obtain a homogenous mass.
- Add mascarpone and mix again very extensively.
- Beat the egg white and fold it into the other mass.
- Construct the tiramisù: First a layer of cream, then a layer of ladyfingers dipped into espresso, cream, ladyfingers, ..., cream. Sprinkle with cacao.
- Put the tiramisù into the fridge for about a night, serve cold!
--- ---
Thank you Silvia for the recipe! This is the only text in the article.
``` ```
Warranty
--------
No warranty whatsoever is provided for either the code or the recipe provided above! ;) Use only at your own risk!
References
----------
* This Pelican plugin uses the Markdown extension `mdx_meta_yaml` found here: <https://github.com/teoric/python-markdown-yaml-meta-data>
* The Pelican plugin `markdown-pullquote` was used as an example for a Pelican plugin providing a Markdown extension and can be found here: <https://github.com/arocks/markdown-pullquote>
* A similar approach to YAML metadata in Markdown files can be found here: <http://ianbarton.net/posts/2013/Apr/06/blogging-with-emacs-org-mode-and-pelican/>