tox fixes
This commit is contained in:
parent
7cb462ff82
commit
6d6ef1e386
@ -17,6 +17,7 @@ include requirements.txt
|
|||||||
include tox.ini
|
include tox.ini
|
||||||
include qutebrowser.py
|
include qutebrowser.py
|
||||||
|
|
||||||
|
prune www
|
||||||
prune scripts/dev
|
prune scripts/dev
|
||||||
exclude scripts/asciidoc2html.py
|
exclude scripts/asciidoc2html.py
|
||||||
exclude doc/notes
|
exclude doc/notes
|
||||||
|
@ -77,6 +77,7 @@ class AsciiDoc:
|
|||||||
self._build_docs()
|
self._build_docs()
|
||||||
|
|
||||||
def _build_docs(self):
|
def _build_docs(self):
|
||||||
|
"""Build the documentation by rendering .asciidoc files to .html sites."""
|
||||||
files = self.FILES[:]
|
files = self.FILES[:]
|
||||||
for src in glob.glob('doc/help/*.asciidoc'):
|
for src in glob.glob('doc/help/*.asciidoc'):
|
||||||
name, _ext = os.path.splitext(os.path.basename(src))
|
name, _ext = os.path.splitext(os.path.basename(src))
|
||||||
@ -86,6 +87,7 @@ class AsciiDoc:
|
|||||||
self.call(src, dst)
|
self.call(src, dst)
|
||||||
|
|
||||||
def _build_website(self):
|
def _build_website(self):
|
||||||
|
"""Prepare and build the website."""
|
||||||
theme_file = os.path.abspath(os.path.join('www', 'qute.css'))
|
theme_file = os.path.abspath(os.path.join('www', 'qute.css'))
|
||||||
shutil.copy(theme_file, self._themedir)
|
shutil.copy(theme_file, self._themedir)
|
||||||
|
|
||||||
@ -113,7 +115,7 @@ class AsciiDoc:
|
|||||||
|
|
||||||
outfp = io.StringIO()
|
outfp = io.StringIO()
|
||||||
|
|
||||||
with open(modified_src) as header_file:
|
with open(modified_src, 'r', encoding='utf-8') as header_file:
|
||||||
header = header_file.read()
|
header = header_file.read()
|
||||||
header += "\n\n"
|
header += "\n\n"
|
||||||
|
|
||||||
@ -149,12 +151,12 @@ class AsciiDoc:
|
|||||||
current_lines = outfp.getvalue()
|
current_lines = outfp.getvalue()
|
||||||
outfp.close()
|
outfp.close()
|
||||||
|
|
||||||
with open(modified_src, "w+") as final_version:
|
with open(modified_src, 'w+', encoding='utf-8') as final_version:
|
||||||
final_version.write(title + "\n\n" + header + current_lines)
|
final_version.write(title + "\n\n" + header + current_lines)
|
||||||
|
|
||||||
self.call(modified_src, dst, '--theme=qute')
|
self.call(modified_src, dst, '--theme=qute')
|
||||||
|
|
||||||
copy = {'icons':'icons', 'doc/img':'doc/img', 'www/media':'media/'}
|
copy = {'icons': 'icons', 'doc/img': 'doc/img', 'www/media': 'media/'}
|
||||||
|
|
||||||
for src, dest in copy.items():
|
for src, dest in copy.items():
|
||||||
shutil.copytree(src, os.path.join(outdir, dest))
|
shutil.copytree(src, os.path.join(outdir, dest))
|
||||||
|
Loading…
Reference in New Issue
Block a user