Add more documentation.

This commit is contained in:
Florian Bruhin 2014-09-08 12:18:54 +02:00
parent 880758d04e
commit 070d5ae300
5 changed files with 71 additions and 11 deletions

View File

@ -74,7 +74,7 @@ Get the value from a section/option.
[[help]]
=== help
Syntax: +:help 'topic'+
Syntax: +:help ['topic']+
Show help about a command or setting.

50
doc/help/index.asciidoc Normal file
View File

@ -0,0 +1,50 @@
qutebrowser help
================
Documentation
-------------
The following help pages are currently available:
* link:FAQ.html[Frequently asked questions]
* link:commands.html[Documentation of commands]
* link:settings.html[Documentation of settings]
Getting help
------------
You can get help in the IRC channel
irc://irc.freenode.org/#qutebrowser[`#qutebrowser`] on
http://freenode.net/[Freenode]
(https://webchat.freenode.net/?channels=#qutebrowser[webchat]), or by writing a
message to the
https://lists.schokokeks.org/mailman/listinfo.cgi/qutebrowser[mailinglist] at
mailto:qutebrowser@lists.qutebrowser.org[].
Bugs
----
If you found a bug or have a feature request, you can report it in several
ways:
* Use the built-in `:report` command or the automatic crash dialog.
* Open an issue in the Github issue tracker.
* Write a mail to the
https://lists.schokokeks.org/mailman/listinfo.cgi/qutebrowser[mailinglist] at
mailto:qutebrowser@lists.qutebrowser.org[].
License
-------
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@ -669,7 +669,7 @@ class CommandDispatcher:
@cmdutils.register(instance='mainwindow.tabs.cmd', name='help',
completion=[usertypes.Completion.helptopic])
def show_help(self, topic):
def show_help(self, topic=None):
r"""Show help about a command or setting.
Args:
@ -678,7 +678,9 @@ class CommandDispatcher:
- :__command__ for commands.
- __section__\->__option__ for settings.
"""
if topic.startswith(':'):
if topic is None:
path = 'index.html'
elif topic.startswith(':'):
command = topic[1:]
if command not in cmdutils.cmd_dict:
raise cmdexc.CommandError("Invalid command {}!".format(

View File

@ -22,6 +22,7 @@
import os
import sys
import glob
import html
import shutil
import os.path
@ -416,15 +417,22 @@ def main():
print("{}Generating asciidoc files...{}".format(
col.Fore.CYAN, col.Fore.RESET))
regenerate_manpage('doc/qutebrowser.1.asciidoc')
generate_settings('doc/settings.asciidoc')
generate_commands('doc/commands.asciidoc')
generate_settings('doc/help/settings.asciidoc')
generate_commands('doc/help/commands.asciidoc')
regenerate_authors('README.asciidoc')
asciidoc_files = [('doc/qutebrowser.1.asciidoc', None),
('doc/settings.asciidoc',
'qutebrowser/html/doc/settings.html'),
('doc/commands.asciidoc',
'qutebrowser/html/doc/commands.html'),
('README.asciidoc', None)]
asciidoc_files = [
('doc/qutebrowser.1.asciidoc', None),
('README.asciidoc', None),
('doc/FAQ.asciidoc', 'qutebrowser/html/doc/FAQ.html'),
]
try:
os.mkdir('qutebrowser/html/doc')
except FileExistsError:
pass
for src in glob.glob('doc/help/*.asciidoc'):
name, _ext = os.path.splitext(os.path.basename(src))
dst = 'qutebrowser/html/doc/{}.html'.format(name)
asciidoc_files.append((src, dst))
for src, dst in asciidoc_files:
call_asciidoc(src, dst)