Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add ridiculous setup.py, tweak some generation

  • Loading branch information...
commit a7c690b4a9b5f20c538b9dfaf78f8a886ce184af 1 parent b3102af
@brendonh authored
View
2  README.md
@@ -5,7 +5,7 @@ Synopsis
--------
```bash
-pip install markdown mako PyYAML git+git@github.com:brendonh/rantbase.git
+pip install markdown mako PyYAML git+git://github.com/brendonh/rantbase.git
mkdir mysite
cd mysite
python -m rantbase init
View
1  rantbase/__main__.py
@@ -17,6 +17,5 @@
action='store_const', const=True)
update.set_defaults(func=commands.runUpdate)
-
args = parser.parse_args()
args.func(args)
View
12 rantbase/update.py
@@ -46,7 +46,11 @@ def update(dir, force=False):
continue
(baseName, ext) = os.path.splitext(webPath)
- if ext.lower() == '.md':
+ ext = ext.lower()
+
+ if ext.endswith("~"):
+ continue
+ elif ext.lower() == '.md':
collection = markdowns
webPath = "%s.html" % baseName
else:
@@ -81,12 +85,12 @@ def update(dir, force=False):
for docPath, webPath in markdowns:
print "Markdowning", docPath, "to", webPath
- title = os.path.splitext(os.path.basename(docPath))[0].replace('_', ' ').title()
+ title = os.path.splitext(os.path.basename(docPath))[0].replace('-', ' ').title()
markupFile = codecs.open(docPath, mode="r", encoding="utf-8")
tagLine = markupFile.next().strip()
-
+
if tagLine.startswith('#'):
tags = tagRE.findall(tagLine)
webUrl = os.path.relpath(webPath, os.path.join(dir, 'web'))
@@ -96,7 +100,7 @@ def update(dir, force=False):
markupFile.seek(0)
tags = []
- markup = markupFile.read()
+ markup = u''.join(markupFile)
content = markdown.markdown(markup)
html = template.render_unicode(
View
34 setup.py
@@ -0,0 +1,34 @@
+import os, itertools
+
+from setuptools import setup, find_packages
+
+dataFiles = list(
+ itertools.chain.from_iterable(
+ [(fs[0], [fs[0] + '/' + f]) for f in fs[2] if not f.endswith('~')]
+ for fs in os.walk('rantbase/priv')))
+
+setup(name="rantbase",
+ version="0.1",
+
+ description="Simple markdown document collection",
+ author="Brendon Hogger",
+ author_email="brendonh@gmail.com",
+ url="https://github.com/brendonh/rantbase",
+ long_description=open('README.md').read(),
+
+ download_url="https://github.com/brendonh/rantbase/zipball/master",
+
+ packages = find_packages(),
+ zip_safe = False,
+
+ install_requires = [
+ ],
+
+ data_files = dataFiles,
+
+ # include_package_data = True,
+ # package_data = {
+ # '': ['priv/**']
+ # },
+
+)
Please sign in to comment.
Something went wrong with that request. Please try again.