www: Working website generation.

This commit is contained in:
Florian Bruhin 2015-10-21 07:31:47 +02:00
parent f6fffee9d3
commit daf81f5fcd
2 changed files with 23 additions and 1 deletions

View File

@ -6,6 +6,7 @@
qutebrowser qutebrowser
=========== ===========
// QUTE_WEB_HIDE
image:icons/qutebrowser-64x64.png[qutebrowser logo] *A keyboard-driven, vim-like browser based on PyQt5 and QtWebKit.* image:icons/qutebrowser-64x64.png[qutebrowser logo] *A keyboard-driven, vim-like browser based on PyQt5 and QtWebKit.*
image:https://img.shields.io/pypi/l/qutebrowser.svg?style=flat["license badge",link="https://github.com/The-Compiler/qutebrowser/blob/master/COPYING"] image:https://img.shields.io/pypi/l/qutebrowser.svg?style=flat["license badge",link="https://github.com/The-Compiler/qutebrowser/blob/master/COPYING"]
@ -14,6 +15,7 @@ image:https://img.shields.io/github/issues/The-Compiler/qutebrowser.svg?style=fl
image:https://requires.io/github/The-Compiler/qutebrowser/requirements.svg?branch=master["requirements badge",link="https://requires.io/github/The-Compiler/qutebrowser/requirements/?branch=master"] image:https://requires.io/github/The-Compiler/qutebrowser/requirements.svg?branch=master["requirements badge",link="https://requires.io/github/The-Compiler/qutebrowser/requirements/?branch=master"]
image:https://travis-ci.org/The-Compiler/qutebrowser.svg?branch=master["Build Status", link="https://travis-ci.org/The-Compiler/qutebrowser"] image:https://travis-ci.org/The-Compiler/qutebrowser.svg?branch=master["Build Status", link="https://travis-ci.org/The-Compiler/qutebrowser"]
image:https://ci.appveyor.com/api/projects/status/9gmnuip6i1oq7046?svg=true["AppVeyor build status", link="https://ci.appveyor.com/project/The-Compiler/qutebrowser"] image:https://ci.appveyor.com/api/projects/status/9gmnuip6i1oq7046?svg=true["AppVeyor build status", link="https://ci.appveyor.com/project/The-Compiler/qutebrowser"]
// QUTE_WEB_HIDE_END
qutebrowser is a keyboard-focused browser with a minimal GUI. It's based qutebrowser is a keyboard-focused browser with a minimal GUI. It's based
on Python, PyQt5 and QtWebKit and free software, licensed under the GPL. on Python, PyQt5 and QtWebKit and free software, licensed under the GPL.

View File

@ -20,6 +20,7 @@
"""Generate the html documentation based on the asciidoc files.""" """Generate the html documentation based on the asciidoc files."""
import re
import os import os
import os.path import os.path
import sys import sys
@ -111,13 +112,32 @@ class AsciiDoc:
with open(modified_src, 'a', encoding='utf-8') as outfp: with open(modified_src, 'a', encoding='utf-8') as outfp:
with open(src, 'r', encoding='utf-8') as infp: with open(src, 'r', encoding='utf-8') as infp:
outfp.write(infp.read()) outfp.write('\n')
hidden = False
for line in infp:
if line.strip() == '// QUTE_WEB_HIDE':
assert not hidden
hidden = True
elif line.strip() == '// QUTE_WEB_HIDE_END':
assert hidden
hidden = False
# Let's see if this looks good everywhere...
if re.match(r'^=+$', line):
line = line.replace('=', '-')
elif re.match(r'^= .+', line):
line = '==' + line[1:]
if not hidden:
outfp.write(line)
self.call(modified_src, dst, '--theme=qute') self.call(modified_src, dst, '--theme=qute')
for path in ['icons', 'doc/img']: for path in ['icons', 'doc/img']:
shutil.copytree(path, os.path.join(outdir, path)) shutil.copytree(path, os.path.join(outdir, path))
os.symlink('README.html', os.path.join(outdir, 'index.html'))
def _get_asciidoc_cmd(self): def _get_asciidoc_cmd(self):
"""Try to find out what commandline to use to invoke asciidoc.""" """Try to find out what commandline to use to invoke asciidoc."""
if self._args.asciidoc is not None: if self._args.asciidoc is not None: