This commit is contained in:
Kovid Goyal 2008-02-29 19:55:17 +00:00
parent 19a9d901ef
commit 862f75bf2c
5 changed files with 15 additions and 7 deletions

View File

@ -7,7 +7,7 @@ url: http://libprs500.kovidgoyal.net
# The list of modules to document. Modules can be named using # The list of modules to document. Modules can be named using
# dotted names, module filenames, or package directory names. # dotted names, module filenames, or package directory names.
# This option may be repeated. # This option may be repeated.
modules: src/libprs500/*.py, struct modules: libprs500.devices, libprs500.ebooks.lrf.web.profiles
output: pdf output: pdf
target: docs/pdf target: docs/pdf

View File

@ -7,7 +7,7 @@ url: http://libprs500.kovidgoyal.net
# The list of modules to document. Modules can be named using # The list of modules to document. Modules can be named using
# dotted names, module filenames, or package directory names. # dotted names, module filenames, or package directory names.
# This option may be repeated. # This option may be repeated.
modules: src/libprs500/*.py, struct modules: libprs500.devices, libprs500.ebooks.lrf.web.profiles
# Write html output to the directory "docs" # Write html output to the directory "docs"
output: html output: html

View File

@ -7,7 +7,7 @@
<meta name="author" content="Kovid Goyal" /> <meta name="author" content="Kovid Goyal" />
<meta name="copyright" content="&copy; 2008 Kovid Goyal" /> <meta name="copyright" content="&copy; 2008 Kovid Goyal" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title> <title>Frequently Asked Questions</title>
<link rel="stylesheet" type="text/css" href="styles/common.css" /> <link rel="stylesheet" type="text/css" href="styles/common.css" />
<style type="text/css"> <style type="text/css">
h2 { h2 {

View File

@ -179,7 +179,7 @@ def qhp():
open('libprs500.qhp', 'wb').write(tostring(root, encoding='UTF-8')) open('libprs500.qhp', 'wb').write(tostring(root, encoding='UTF-8'))
compile_help() compile_help()
def generate_cli_docs(): def cli_docs():
documented_cmds = [] documented_cmds = []
undocumented_cmds = [] undocumented_cmds = []
@ -201,7 +201,8 @@ def generate_cli_docs():
for cmd, parser in documented_cmds: for cmd, parser in documented_cmds:
output = open('cli-%s.html'%cmd, 'wb') output = open('cli-%s.html'%cmd, 'wb')
template = open('templates/basic.html', 'rb').read() template = open('templates/basic.html', 'rb').read().decode('utf-8')
template = re.sub('<title>\s*</title>', '<title>%s</title>'%cmd, template)
usage = [sanitize_text(i) for i in parser.usage.replace('%prog', cmd).splitlines(True) if i] usage = [sanitize_text(i) for i in parser.usage.replace('%prog', cmd).splitlines(True) if i]
usage[0] = '<pre class="runcmd">%s</pre>'%usage[0] usage[0] = '<pre class="runcmd">%s</pre>'%usage[0]
usage[1:] = [i.replace(cmd, '<span class="cmd">%s</span>'%cmd) for i in usage[1:]] usage[1:] = [i.replace(cmd, '<span class="cmd">%s</span>'%cmd) for i in usage[1:]]
@ -250,6 +251,9 @@ def generate_cli_docs():
body += '<h2 class="sectionHeading">Documented commands</h2>\n'+dc_html body += '<h2 class="sectionHeading">Documented commands</h2>\n'+dc_html
body += '<h2 class="sectionHeading">Undocumented commands</h2>\n'+uc_html body += '<h2 class="sectionHeading">Undocumented commands</h2>\n'+uc_html
body += '<p>You can see usage for undocumented commands by executing them without arguments in a terminal</p>' body += '<p>You can see usage for undocumented commands by executing them without arguments in a terminal</p>'
template = open('templates/basic.html', 'rb').read().decode('utf-8')
template = re.sub('<title>\s*</title>', '<title>%s</title>'%'Command Line Interface', template)
open('cli-index.html', 'wb').write(template.replace('%body', body)) open('cli-index.html', 'wb').write(template.replace('%body', body))
@ -288,7 +292,7 @@ def html(src='libprs500.qhp'):
def all(opts): def all(opts):
clean() clean()
generate_cli_docs() cli_docs()
qhp() qhp()
html() html()
if opts.validate: if opts.validate:

View File

@ -55,6 +55,7 @@ def build_installer(installer, vm, timeout=25):
minutes += 1 minutes += 1
print minutes, print minutes,
sys.stdout.flush() sys.stdout.flush()
print
if not os.path.exists(installer): if not os.path.exists(installer):
raise Exception('Failed to build windows installer') raise Exception('Failed to build windows installer')
finally: finally:
@ -115,7 +116,10 @@ def upload_user_manual():
try: try:
check_call('python make.py --validate') check_call('python make.py --validate')
check_call('ssh castalia rm -rf %s/\\*'%USER_MANUAL) check_call('ssh castalia rm -rf %s/\\*'%USER_MANUAL)
check_call('scp -r *.html styles images castalia:%s/'%USER_MANUAL) check_call('ssh castalia mkdir %(um)s/styles %(um)s/images'%dict(um=USER_MANUAL))
check_call('scp *.html castalia:%s/'%USER_MANUAL)
check_call('scp styles/* castalia:%s/styles/'%USER_MANUAL)
check_call('scp images/* castalia:%s/images/'%USER_MANUAL)
finally: finally:
os.chdir(cwd) os.chdir(cwd)