summaryrefslogtreecommitdiff
path: root/unperish
diff options
context:
space:
mode:
Diffstat (limited to 'unperish')
-rwxr-xr-xunperish20
1 files changed, 16 insertions, 4 deletions
diff --git a/unperish b/unperish
index 2ee408a..c6ea035 100755
--- a/unperish
+++ b/unperish
@@ -110,6 +110,11 @@ class Unperish(cliapp.Application):
self.settings.string(['web-directory'],
'put files to go on the web in DIR',
metavar='DIR')
+ self.settings.string_list(['doc'],
+ 'add FILE to docs to publish with '
+ 'publish-docs (default: %default)',
+ metavar='FILE',
+ default=['README', 'NEWS'])
self.settings.string_list(['rsync-glob'],
'publish files matching GLOB with rsync',
metavar='GLOB')
@@ -430,7 +435,16 @@ class Unperish(cliapp.Application):
self.output.write(out)
def cmd_publish_docs(self, args):
- '''Publish docs related to this project.'''
+ '''Publish docs related to this project.
+
+ By default, the README and NEWS files and any manual pages are
+ published. README and NEWS can be replaced with the --doc option.
+ Any documents get a .mdwn suffix added: it is assumed that they're
+ marked up using Markdown and published in an ikiwiki instance.
+ Manual pages are formatted into plain text and get a .txt suffix
+ added when copying.
+
+ '''
def publish(source, target_base):
target = os.path.join(self.settings['web-directory'], target_base)
@@ -442,10 +456,8 @@ class Unperish(cliapp.Application):
raise cliapp.AppException('Need --web-directory '
'for publish-docs.')
- docs = ['README', 'NEWS']
- for doc in docs:
+ for doc in self.settings['doc']:
src = self.join(self.dirname, doc)
- print 'pd: src: %s' % src
if os.path.exists(src):
publish(src, doc + '.mdwn')