Permalink
Browse files

updated readme

  • Loading branch information...
1 parent db1e4ac commit ebb32f39cac0532bcaada6e5230feb78b9637350 @dz committed Mar 3, 2009
Showing with 23 additions and 2 deletions.
  1. +21 −0 README
  2. +2 −2 chisel.py
View
21 README
@@ -8,6 +8,23 @@ USAGE
$ python chisel.py
+SAMPLE ENTRY
+===========
+
+sample.markdown:
+-------# start of file
+The First Line Contains the Title
+3/2/2009 <-- second line contains date. Must be in this format by default. Change via ENTRY_TIME_FORMAT setting.
+<a blank line separate title/date from post body>
+This is now the body of the post. By default, the body is evaluated and parsed with markdown.
+Another line
+
+New paragraph
+
+Another paragraph
+-------# end of file
+
+
ADDING STEPS
============
@@ -56,6 +73,10 @@ TIME_FORMAT:
Format of human readable timestamp.
Default: "%B %d, %Y - %I:%M %p"
+ENTRY_TIME_FORMAT:
+Format of date declaration in second line of posts
+Default: "%m/%d/%Y"
+
FORMAT:
Callable that takes in text and returns formatted
text.
View
@@ -21,7 +21,7 @@
'archive': "archive.html",
}
TIME_FORMAT = "%B %d, %Y"
-
+ENTRY_TIME_FORMAT = "%m/%d/%Y"
#FORMAT should be a callable that takes in text
#and returns formatted text
FORMAT = lambda text: markdown.markdown(text, ['footnotes',])
@@ -45,7 +45,7 @@ def get_tree(source):
path = os.path.join(root, name)
f = codecs.open(path, "r", encoding="utf-8")
title = f.readline()
- date = time.strptime(f.readline().strip(), "%m/%d/%Y")
+ date = time.strptime(f.readline().strip(), ENTRY_TIME_FORMAT)
year, month, day = date[:3]
files.append({
'title': title,

0 comments on commit ebb32f3

Please sign in to comment.