From 0a28c4a15e98d5ceb8f3897632cd33700897b04c Mon Sep 17 00:00:00 2001 From: boyska Date: Wed, 16 Dec 2015 15:40:25 +0100 Subject: [PATCH] real manpage coming; refs #234 well, almost --- doc/source/clickdoc.py | 4 +++- doc/source/commands.rst | 8 ++++++++ doc/source/commands/libreant-db.rst | 21 +++++++++++++++++++++ doc/source/commands/libreant.rst | 24 ++++++++++++++++++++++++ doc/source/conf.py | 6 ++++-- doc/source/index.rst | 1 + 6 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 doc/source/commands.rst create mode 100644 doc/source/commands/libreant-db.rst create mode 100644 doc/source/commands/libreant.rst diff --git a/doc/source/clickdoc.py b/doc/source/clickdoc.py index 146e000..21ae2c1 100644 --- a/doc/source/clickdoc.py +++ b/doc/source/clickdoc.py @@ -35,9 +35,11 @@ def format_param(param): class UsageDirective(SingleArgDirective): + optional_arguments = 1 + def run(self): command = get_command(self.get_arg()) - ctx = command.make_context( command.name, []) + ctx = command.make_context( command.name, self.arguments[1:]) doc = ViewList() doc.append(command.get_usage(ctx), '') diff --git a/doc/source/commands.rst b/doc/source/commands.rst new file mode 100644 index 0000000..0b1ef31 --- /dev/null +++ b/doc/source/commands.rst @@ -0,0 +1,8 @@ +Command-line tools +===================== + +.. toctree:: + :maxdepth: 1 + + /commands/libreant + /commands/libreant-db diff --git a/doc/source/commands/libreant-db.rst b/doc/source/commands/libreant-db.rst new file mode 100644 index 0000000..c3d86cd --- /dev/null +++ b/doc/source/commands/libreant-db.rst @@ -0,0 +1,21 @@ +Libreant-db +=========== + +This program manages the volume database of libreant. It does not handle users db. + +Synopsis +-------- + +.. click:usage :: cli.libreant_db:libreant_db + libreant-db + +Options +------- + +.. click:all_options :: cli.libreant_db:libreant_db + +Examples +-------- + +Environment variables +---------------------- diff --git a/doc/source/commands/libreant.rst b/doc/source/commands/libreant.rst new file mode 100644 index 0000000..f214740 --- /dev/null +++ b/doc/source/commands/libreant.rst @@ -0,0 +1,24 @@ +Libreant +========= + +This command will run the libreant HTTPserver. + +Synopsis +-------- + +.. click:usage :: cli.libreant:libreant + +Summary +-------- + + +Options +------- + +.. click:all_options :: cli.libreant:libreant + +Examples +-------- + +Environment variables +---------------------- diff --git a/doc/source/conf.py b/doc/source/conf.py index 826b278..d840d3c 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -231,8 +231,10 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'libreant', 'libreant Documentation', - ['insomnialab'], 1) + ('commands/libreant-db', 'libreant-db', 'manage libreant db', + ['insomnialab'], 8), + ('commands/libreant', 'libreant', '(e)Book archive focused on small grassroot archives', + ['insomnialab'], 8), ] # If true, show URL addresses after external links. diff --git a/doc/source/index.rst b/doc/source/index.rst index df6cc0c..886582c 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -18,6 +18,7 @@ Contents: documentation developer api/modules + commands