aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-08-17 19:31:18 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-08-17 19:31:18 -0300
commit8e4c6ec0ddd9944012f93e1b0f4c1762f35ee94e (patch)
tree232486c9331dcf3b6acf25982822547a299a3f50
parent063096c98c3922da7931152084be2a02897a82ba (diff)
downloadblogc-8e4c6ec0ddd9944012f93e1b0f4c1762f35ee94e.tar.gz
blogc-8e4c6ec0ddd9944012f93e1b0f4c1762f35ee94e.tar.bz2
blogc-8e4c6ec0ddd9944012f93e1b0f4c1762f35ee94e.zip
updated README.md
-rw-r--r--README.md86
1 files changed, 9 insertions, 77 deletions
diff --git a/README.md b/README.md
index 908b56f..c83b06f 100644
--- a/README.md
+++ b/README.md
@@ -5,85 +5,17 @@
A blog compiler.
-## Design Notes
+## Quickstart
-The main idea is simple: a source file is read by the compiler, and a result file is written by the compiler.
+Clone the [Git repository](https://github.com/blogc/blogc) or grab the [latest release](https://github.com/blogc/blogc/releases) and extract it.
-The source file must provide (almost) all the data needed to build the result file, including any variables. The result file is built using a template, that defines how the information provided by the source file should be used to generate a reasonable result file.
+Inside the source directory, run the following commands:
-The compiler will always generate a single file, no matter how many source files are provided. If more than one source file is provided, the compiler (and the template) must know how to convert them to a single result file.
+ $ ./autogen.sh # if installing from git
+ $ ./configure
+ $ make
+ # make install
-The templates can define blocks. These are the block rules:
+If some unexpected error happens, please [file an issue](https://github.com/blogc/blogc/issues/new).
-- If something is defined outside of blocks, its raw content should be always included.
-- If something is defined inside a block, it should only be included if the block matches the compiler argument expectations, e.g.:
- - ``entry`` should be include if just one source file is provided.
- - ``listing`` should be included if more than one source file is provided, being included once for each source file, if the compiler is called with ``-l``.
- - ``listing_once`` should be inclueded if more than one source file is provided, but only once, if the compiler is called with ``-l``.
-- Template blocks can be defined multiple times in the same template, but can't be nested.
-
-The variables defined in source files are only available inside of blocks. The variables defined in the command line are global and available everywhere. Inside blocks, variables defined in source files are always used, even if a global variable with the same name exists.
-
-The templates can use conditional statements: ``{% ifdef VARIABLE %}`` or ``{% ifndef VARIABLE %}``, and ``{% endif %}``. They check if a variable is defined or not.
-
-Variables defined in source files are not available in ``listing_once`` blocks, because it is not possible to guess which source file would provide the variable contents. Global variables, defined in the command line are available.
-
-As the compiler is output-agnostic, Atom feeds and sitemaps should be generated using templates as well.
-
-The compiler won't touch the content. If the user write pre-formatted text it will stay pre-formatted, and the user may want to enclose the ``{{ CONTENT }}`` statement with ``<pre>`` and ``</pre>`` tags in the templates. For more flexibility, the user can even write raw HTML in the source content.
-
-The compiler is designed to be easily used with any POSIX-compatible implementation of ``make``.
-
-
-### Source file syntax
-
-```
-TITLE: My nice post
-DATE: 2007-04-05 12:30:00
-----
-test content.
-
-more test content.
-```
-
-If more than one source file is provided to the compiler with the ``-t`` argument, they won't be sorted, and will be included by ``listing`` blocks in the order that they were provided in the command line.
-
-Variables are single-line, and all the whitespace characters, including tabs, before the leading non-whitespace character and after the trailing non-whitespace character will be removed.
-
-``DATE`` variable, if provided in the correct format, as shown in the example, will be parsed and set to ``DATE_FORMATTED`` variable. User can set ``DATE_FORMAT`` variable with ``strftime(3)`` format string, to change the default formatting, e.g. using the -D command line argument: ``-D DATE_FORMAT="%H:%M:%S"``
-
-Raw content is available in template blocks as the ``CONTENT`` variable.
-
-
-### Template file syntax
-
-```html
-<html>
- <head>
- {% block entry %}
- <title>My cool blog >> {{ TITLE }}</title>
- {% endblock %}
- {% block listing_once %}
- <title>My cool blog - Main page</title>
- {% endblock %}
- </head>
- <body>
- <h1>My cool blog</h1>
- {% block entry %}
- <h2>{{ TITLE }}</h2>
- {% if DATE_FORMATTED %}<h4>Published in: {{ DATE_FORMATTED }}</h4>{% endif %}
- <pre>{{ CONTENT }}</pre>
- {% endblock %}
- {% block listing_once %}<ul>{% endblock %}
- {% block listing %}<p><a href="{{ FILENAME }}.html">{{ TITLE }}</a>{% if DATE_FORMATTED %} - {{ DATE_FORMATTED }}{% endif %}</p>{% endblock %}
- {% block listing_once %}</ul>{% endblock %}
- </body>
-</html>
-```
-
-This template would generate a list of posts, if multiple source files were provided with ``-t``, and single pages for each post, if only one source file was provided. The ``FILENAME`` variable is generated by the compiler, and is the source file base name without its last extension.
-
-
-## Roadmap
-
-The first release will happen as soon as ``blogc`` can build its own website (http://blogc.org/). ;-)
+-- Rafael G. Martins <rafael@rafaelmartins.eng.br>