From 3baa61e0e58402bc50c5df529fcf669bf4b2facb Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Fri, 21 May 2021 23:44:09 +0300 Subject: [PATCH] doc: use manpage role references to external man pages Using manpage role references generates helpful links in html documentation, while retaining the same boldface style in the man pages. The external man page site is configurable. The Debian manpage site seems like a good fit for Notmuch. --- doc/conf.py | 5 +++++ doc/man1/notmuch-address.rst | 4 ++-- doc/man1/notmuch-dump.rst | 16 ++++++++-------- doc/man1/notmuch-emacs-mua.rst | 15 +++++++++------ doc/man1/notmuch-reply.rst | 2 +- doc/man1/notmuch-restore.rst | 6 +++--- doc/man1/notmuch-search.rst | 4 ++-- doc/man1/notmuch-show.rst | 2 +- doc/man1/notmuch.rst | 5 +++-- doc/man7/notmuch-search-terms.rst | 2 +- 10 files changed, 35 insertions(+), 26 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index d0f7f66c..4a4a3421 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -80,6 +80,11 @@ htmlhelp_basename = 'notmuchdoc' # Despite the name, this actually affects manual pages as well. html_use_smartypants = False +# See: +# - https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-manpages_url +# - https://manpages.debian.org/ +manpages_url = 'https://manpages.debian.org/{page}.{section}.html' + # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples diff --git a/doc/man1/notmuch-address.rst b/doc/man1/notmuch-address.rst index 2a7df6f0..9193aefe 100644 --- a/doc/man1/notmuch-address.rst +++ b/doc/man1/notmuch-address.rst @@ -21,8 +21,8 @@ Supported options for **address** include ``--format=``\ (**json**\ \|\ **sexp**\ \|\ **text**\ \|\ **text0**) Presents the results in either JSON, S-Expressions, newline character separated plain-text (default), or null character - separated plain-text (compatible with **xargs(1)** -0 option where - available). + separated plain-text (compatible with :manpage:`xargs(1)` -0 + option where available). ``--format-version=N`` Use the specified structured output format version. This is diff --git a/doc/man1/notmuch-dump.rst b/doc/man1/notmuch-dump.rst index ec6335b2..0a7a2387 100644 --- a/doc/man1/notmuch-dump.rst +++ b/doc/man1/notmuch-dump.rst @@ -27,7 +27,7 @@ the remaining arguments are search terms. Supported options for **dump** include ``--gzip`` - Compress the output in a format compatible with **gzip(1)**. + Compress the output in a format compatible with :manpage:`gzip(1)`. ``--format=(sup|batch-tag)`` Notmuch restore supports two plain text dump formats, both with @@ -36,8 +36,8 @@ Supported options for **dump** include **batch-tag** The default **batch-tag** dump format is intended to more robust against malformed message-ids and tags containing - whitespace or non-\ **ascii(7)** characters. Each line has the - form:: + whitespace or non-\ :manpage:`ascii(7)` characters. Each line + has the form:: +<*encoded-tag*\ > +<*encoded-tag*\ > ... -- id:<*quoted-message-id*\ > @@ -54,11 +54,11 @@ Supported options for **dump** include **sup** The **sup** dump file format is specifically chosen to be - compatible with the format of files produced by sup-dump. So - if you've previously been using sup for mail, then the - **notmuch restore** command provides you a way to import all - of your tags (or labels as sup calls them). Each line has the - following form:: + compatible with the format of files produced by + :manpage:`sup-dump(1)`. So if you've previously been using sup + for mail, then the **notmuch restore** command provides you a + way to import all of your tags (or labels as sup calls + them). Each line has the following form:: <*message-id*\ > **(** <*tag*\ > ... **)** diff --git a/doc/man1/notmuch-emacs-mua.rst b/doc/man1/notmuch-emacs-mua.rst index a0476136..a1e65edd 100644 --- a/doc/man1/notmuch-emacs-mua.rst +++ b/doc/man1/notmuch-emacs-mua.rst @@ -41,8 +41,9 @@ Supported options for **emacs-mua** include Even if a window system is available, use the current terminal. ``--client`` - Use **emacsclient**, rather than **emacs**. For **emacsclient** to - work, you need an already running Emacs with a server, or use + Use :manpage:`emacsclient(1)`, rather than + :manpage:`emacs(1)`. For :manpage:`emacsclient(1)` to work, you + need an already running Emacs with a server, or use ``--auto-daemon``. ``--auto-daemon`` @@ -60,9 +61,9 @@ Supported options for **emacs-mua** include Output the resulting elisp to stdout instead of evaluating it. The supported positional parameters and short options are a compatible -subset of the **mutt** MUA command-line options. The options and -positional parameters modifying the message can't be combined with the -mailto: URL. +subset of the :manpage:`mutt(1)` MUA command-line options. The options +and positional parameters modifying the message can't be combined with +the mailto: URL. Options may be specified multiple times. @@ -78,4 +79,6 @@ ENVIRONMENT VARIABLES SEE ALSO ======== -**notmuch(1)**, **emacsclient(1)**, **mutt(1)** +**notmuch(1)**, +:manpage:`emacsclient(1)`, +:manpage:`mutt(1)` diff --git a/doc/man1/notmuch-reply.rst b/doc/man1/notmuch-reply.rst index 5c64c4a6..b1c3590b 100644 --- a/doc/man1/notmuch-reply.rst +++ b/doc/man1/notmuch-reply.rst @@ -86,7 +86,7 @@ Supported options for **reply** include Use ``false`` to avoid even automatic decryption. Non-automatic decryption expects a functioning - **gpg-agent(1)** to provide any needed credentials. Without + :manpage:`gpg-agent(1)` to provide any needed credentials. Without one, the decryption will likely fail. Default: ``auto`` diff --git a/doc/man1/notmuch-restore.rst b/doc/man1/notmuch-restore.rst index c0f47f26..e7d68c08 100644 --- a/doc/man1/notmuch-restore.rst +++ b/doc/man1/notmuch-restore.rst @@ -77,9 +77,9 @@ GZIPPED INPUT ============= \ **notmuch restore** will detect if the input is compressed in -**gzip(1)** format and automatically decompress it while reading. This -detection does not depend on file naming and in particular works for -standard input. +:manpage:`gzip(1)` format and automatically decompress it while +reading. This detection does not depend on file naming and in +particular works for standard input. SEE ALSO ======== diff --git a/doc/man1/notmuch-search.rst b/doc/man1/notmuch-search.rst index ed9ff4e5..ee9d4118 100644 --- a/doc/man1/notmuch-search.rst +++ b/doc/man1/notmuch-search.rst @@ -27,8 +27,8 @@ Supported options for **search** include ``--format=``\ (**json**\ \|\ **sexp**\ \|\ **text**\ \|\ **text0**) Presents the results in either JSON, S-Expressions, newline character separated plain-text (default), or null character - separated plain-text (compatible with **xargs(1)** -0 option where - available). + separated plain-text (compatible with :manpage:`xargs(1)` -0 + option where available). ``--format-version=N`` Use the specified structured output format version. This is diff --git a/doc/man1/notmuch-show.rst b/doc/man1/notmuch-show.rst index becd3e79..c2130e47 100644 --- a/doc/man1/notmuch-show.rst +++ b/doc/man1/notmuch-show.rst @@ -130,7 +130,7 @@ Supported options for **show** include Use ``false`` to avoid even automatic decryption. Non-automatic decryption (``stash`` or ``true``, in the absence of - a stashed session key) expects a functioning **gpg-agent(1)** to + a stashed session key) expects a functioning :manpage:`gpg-agent(1)` to provide any needed credentials. Without one, the decryption will fail. diff --git a/doc/man1/notmuch.rst b/doc/man1/notmuch.rst index 48351588..7fdcc9dd 100644 --- a/doc/man1/notmuch.rst +++ b/doc/man1/notmuch.rst @@ -90,7 +90,8 @@ will do its best to detect those and ignore them. Mail storage that uses mbox format, (where one mbox file contains many messages), will not work with notmuch. If that's how your mail is currently stored, it is recommended you first convert it to maildir -format with a utility such as mb2md before running **notmuch setup .** +format with a utility such as :manpage:`mb2md(1)` before running +**notmuch setup**. Invoking ``notmuch`` with no command argument will run **setup** if the setup command has not previously been completed. @@ -152,7 +153,7 @@ of notmuch. **NOTMUCH\_TALLOC\_REPORT** Location to write a talloc memory usage report. See - **talloc\_enable\_leak\_report\_full** in **talloc(3)** for more + **talloc\_enable\_leak\_report\_full** in :manpage:`talloc(3)` for more information. **NOTMUCH\_DEBUG\_QUERY** diff --git a/doc/man7/notmuch-search-terms.rst b/doc/man7/notmuch-search-terms.rst index 28fca737..04413f81 100644 --- a/doc/man7/notmuch-search-terms.rst +++ b/doc/man7/notmuch-search-terms.rst @@ -39,7 +39,7 @@ indicate user-supplied values). Some of the prefixes with forms can be also used to restrict the results to those whose value matches a regular expression (see -**regex(7)**) delimited with //, for example:: +:manpage:`regex(7)`) delimited with //, for example:: notmuch search 'from:"/bob@.*[.]example[.]com/"'