Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabitoju/barrancas
barrancas is a simple document generator that uses Markdown and Jinja2 to format and generate HTML documents or static web sites. It's inspired in Jekyll and written in Python.
https://github.com/gabitoju/barrancas
Last synced: 26 days ago
JSON representation
barrancas is a simple document generator that uses Markdown and Jinja2 to format and generate HTML documents or static web sites. It's inspired in Jekyll and written in Python.
- Host: GitHub
- URL: https://github.com/gabitoju/barrancas
- Owner: gabitoju
- License: other
- Created: 2012-12-19T16:46:02.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2024-09-12T01:29:26.000Z (2 months ago)
- Last Synced: 2024-09-12T11:26:23.347Z (2 months ago)
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# barrancas
By Juan Gabito ([@gabitoju](https://twitter.com/gabitoju))
**barrancas** is a simple document generator that uses Markdown and Jinja2
to format and generate HTML documents or static web sites. It's inspired in
[Jekyll](http://jekyllrb.com/) and written in Python.## Dependencies
barrancas has the following dependencies:
+ [path.py](https://pypi.python.org/pypi/path.py)
+ [PyYAML](http://pyyaml.org/)
+ [Markdown](https://pypi.python.org/pypi/Markdown)
+ [Jinja2](http://jinja.pocoo.org/)## Usage
### Directory structure
barracas uses the following directory structure:
. // directory that contains the md files
|-- templates // directory that contains the html templates files
|-- general.html // basic templates
|-- file1.md
|-- file2.md### Templates
barrancas use Jinja2 templates to generate html files. This templates are located in the *templates* directory and you must have at least the *general.html* template.
The following variables are available to use inside the templates:
+ ${title}: the article or page title
+ ${content}: thiw varible would be replaced with the content that it's generated from the md files. It also can be used inside the general template to include other templates.
+ ${menu}: this variable can be replaced with the content of a special template that contains the site or documentation menu. The name of this template must be *menu.html*.
+ ${quick\_menu}: It allows to have a small menu to link to document or page items (like an article section). The template file for this option is *quick_menu.html*.This is a simple *general.html* template example:
${title}
${content}
The following examples uses an aditional template *article.html* (the file name does not matter):
My Site
${content}
${title}
${content}The ${content} in *general.html* will bi replaces with the content of *article.html* and the md file will be included in the article template.
### Writing
barrancas read .md files and generates a .html file. For example, the post1.md will be generated as post1.html.
You can write the md file using Markdown, html or a combination of both.
Also, you can use the following yaml properties:
+ title: the article or document title.
+ template: the name of the template that will be used to generate this document. For example, if the template is *article.html* the property value will be *article*.
+ order: the order of the document in the menu.This is an md example:
---
title: "Example Article"
template: article
order: 1
---
# My first article*This* is an article showing the usage of barrancas.
### Generating the files
To generate the files you have to run *barrancas.py* in the directory that contains the md files. You can run *barrancas.py* with no arguments or with the *--generate* option.