# HG changeset patch # User Steve Losh # Date 1373496445 14400 # Node ID 8e1156959046841848fd503b733360e1c3d6fcb9 # Parent 3134a7a14ee028a3454a1c950855e941605b7e01 dat unicode diff -r 3134a7a14ee0 -r 8e1156959046 LICENSE.markdown --- a/LICENSE.markdown Sat Jul 07 00:00:59 2012 -0400 +++ b/LICENSE.markdown Wed Jul 10 18:47:25 2013 -0400 @@ -1,4 +1,4 @@ -Copyright (c) 2012 Steve Losh and contributors +Copyright (c) 2013 Steve Losh and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff -r 3134a7a14ee0 -r 8e1156959046 d/base.py --- a/d/base.py Sat Jul 07 00:00:59 2012 -0400 +++ b/d/base.py Wed Jul 10 18:47:25 2013 -0400 @@ -13,6 +13,7 @@ + {title_tag} @@ -29,6 +30,7 @@ + {title_tag} @@ -51,6 +53,12 @@ +def _read(f): + return f.read().decode('utf-8') + +def _write(f, content): + return f.write(content.encode('utf-8')) + def _get_target_url(path, destination): return os.path.split(_get_target(path, destination))[-1] @@ -68,7 +76,7 @@ def _get_project_title(source): if os.path.isfile(j(source, 'title')): with open(j(source, 'title')) as f: - return f.read().strip() + return _read(f).strip() else: current = dirname(source).lower() if current not in ['doc', 'docs', 'documentation']: @@ -90,7 +98,7 @@ target = j(source, filename); if os.path.isfile(target): with open(target) as f: - return md.convert(f.read()) + return md.convert(_read(f)) return '' @@ -133,7 +141,8 @@ else: e('.markdown').prepend('

' + fallback_title + '

') - return unicode(e) + # What the fuck, pyquery? + return u'\n' + unicode(e) def _ensure_dir(path): if not os.path.isdir(path): @@ -175,7 +184,7 @@ def _render(title, header, footer, source, destination, page_type, toc=None): with open(source) as f: - data = f.read() + data = _read(f) fallback_title = _get_fallback_title(source) @@ -197,7 +206,7 @@ os.makedirs(destination) with open(j(destination, 'index.html'), 'w') as f: - f.write(content) + _write(f, content) return page_title diff -r 3134a7a14ee0 -r 8e1156959046 docs/02-usage.markdown --- a/docs/02-usage.markdown Sat Jul 07 00:00:59 2012 -0400 +++ b/docs/02-usage.markdown Wed Jul 10 18:47:25 2013 -0400 @@ -15,7 +15,7 @@ mkdir docs cd docs -Write some docs: +Write some docs (UTF-8): :::bash touch index.markdown diff -r 3134a7a14ee0 -r 8e1156959046 docs/footer.markdown --- a/docs/footer.markdown Sat Jul 07 00:00:59 2012 -0400 +++ b/docs/footer.markdown Wed Jul 10 18:47:25 2013 -0400 @@ -2,17 +2,3 @@ Inspired by [t](http://stevelosh.com/projects/t/).
Rochester Made - - diff -r 3134a7a14ee0 -r 8e1156959046 setup.py --- a/setup.py Sat Jul 07 00:00:59 2012 -0400 +++ b/setup.py Wed Jul 10 18:47:25 2013 -0400 @@ -2,7 +2,7 @@ setup( name='d', - version='0.2.0', + version='0.2.1', author='Steve Losh', author_email='steve@stevelosh.com', packages=['d'],