From 5ff0da0a719dd5e151004e41a5c18fbc7efb814a Mon Sep 17 00:00:00 2001 From: p4bl0 Date: Sat, 24 Jul 2010 13:22:39 +0200 Subject: added preprocessing possibilities for article (to enable use of Markdown, textile or whatever) --- README | 39 +++++++++++++++++++++++---------------- install.sh | 3 ++- post-commit.sh | 7 +++++++ 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/README b/README index b8a514f..f18a888 100644 --- a/README +++ b/README @@ -14,7 +14,7 @@ fugitive README file
git clone git://gitorious.org/fugitive/fugitive.git fugitive
- Then simply go in the newly created directory: cd fugitive, and + Then go in the newly created directory: cd fugitive, and run the build script: ./build.sh.
This will generate an executable file "fugitive". @@ -35,7 +35,7 @@ fugitive README file

Update

- Simply run fugitive --install-hooks <dir>.
+ Run fugitive --install-hooks <dir>.
This will only (re)install fugitive hooks scripts.
If <dir> isn't specified then the current working directory is used.

@@ -43,37 +43,44 @@ fugitive README file

Configuration

- There are three item in the "fugitive" section of the git config: + There are three paths in the "fugitive" section of the git config:

NOTE: You must NOT put a trailing '/' at the end of any of those paths.

+

+ If you want your article to be preprocessed by an external tool (markdown, + textile...) you need to set preproc to a command line that will take + the file path as argument and write to stdout. +

Usage

General use

Article you want to publish should be file without the .html extension in the - "articles-dir" directory (see CONFIGURATION). + articles-dir directory (see CONFIGURATION).

The first line of the file will be used as title and the rest of the file as @@ -81,8 +88,8 @@ fugitive README file

/!\ WARNINGS:
- DO NOT CREATE AN ARTICLE FILE NAMED "archives".
- DO NOT CREATE AN ARTICLE FILE NAMED "index". + DO NOT CREATE AN ARTICLE FILE NAMED "archives".
+ DO NOT CREATE AN ARTICLE FILE NAMED "index".

Template system

*TODO*

diff --git a/install.sh b/install.sh index 8505ef9..a24f3c3 100644 --- a/install.sh +++ b/install.sh @@ -34,10 +34,11 @@ fugitive_install() { echo -n "Creating default directory tree... " mkdir -p _drafts _articles _templates echo "done." - echo -n "Adding default directory paths to git config... " + echo -n "Adding default directory paths and settings to git config... " git config --add --path fugitive.templates-dir "_templates" git config --add --path fugitive.articles-dir "_articles" git config --add --path fugitive.public-dir "." + git config --add --path fugitive.preproc "" echo "done." echo -n "Writing default template files... " fugitive_write_template > _templates/article.html < "$f" + fi art="${f#$articles_dir/}" echo -n "[fugitive] Generating $public_dir/$art.html from $f... " cat "$templates_dir/article.html" | \ @@ -207,6 +213,7 @@ for f in $added_files $new $modified_files; do echo "$art.html" >> .git/info/exclude echo "done." fi + if [ "$preproc" != "" ]; then mv "$preproc_bak" "$f"; fi fi if [ "$f" = "$new" ]; then new=""; fi done -- cgit v1.2.3