unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Floris Bruynooghe <flub@devork.be>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Cc: David Bremner <david@tethera.net>
Subject: Re: [PATCH 2/2] doc: add new python bindings to main documentatation tree.
Date: Tue, 14 Jul 2020 23:21:54 +0200	[thread overview]
Message-ID: <87o8ohbxn1.fsf@powell.devork.be> (raw)
In-Reply-To: <20200711132027.1449094-2-david@tethera.net>

Oh, this is very nice!  I've been thinking for a while I should attempt
this.  Great to see it being done!

On Sat 11 Jul 2020 at 10:20 -0300, David Bremner wrote:

> A seperate conf.py and doc directory will be needed if someone wants
> to build the bindings docs separately from notmuch.
> ---
>  configure               | 4 ++++
>  doc/conf.py             | 8 ++++++++
>  doc/index.rst           | 1 +
>  doc/python-bindings.rst | 5 +++++
>  4 files changed, 18 insertions(+)
>  create mode 100644 doc/python-bindings.rst
>
> diff --git a/configure b/configure
> index 177432db..36fe4a9d 100755
> --- a/configure
> +++ b/configure
> @@ -801,6 +801,7 @@ if [ $have_python3 -eq 1 ]; then
>      if "$python" -c 'import cffi,setuptools; cffi.FFI().verify()' >/dev/null 2>&1; then
>          printf "Yes.\n"
>          have_python3_cffi=1
> +        WITH_PYTHON_DOCS=1
>      else
>          printf "No (will not install CFFI-based python bindings).\n"
>      fi
> @@ -1554,6 +1555,9 @@ EOF
>  if [ $WITH_EMACS = "1" ]; then
>      printf "tags.add('WITH_EMACS')\n" >> sphinx.config
>  fi
> +if [ $WITH_PYTHON_DOCS = "1" ]; then
> +    printf "tags.add('WITH_PYTHON')\n" >> sphinx.config
> +fi
>  printf "rsti_dir = '%s'\n" $(realpath emacs) >> sphinx.config
>  
>  # Finally, after everything configured, inform the user how to continue.
> diff --git a/doc/conf.py b/doc/conf.py
> index fdff2a2c..94e266af 100644
> --- a/doc/conf.py
> +++ b/doc/conf.py
> @@ -4,6 +4,8 @@
>  import sys
>  import os
>  
> +extensions = [ 'sphinx.ext.autodoc' ]
> +
>  # The suffix of source filenames.
>  source_suffix = '.rst'
>  
> @@ -22,6 +24,9 @@ for pathdir in ['.', '..']:
>          with open(version_file,'r') as infile:
>              version=infile.read().replace('\n','')
>  
> +# for autodoc
> +sys.path.insert(0, os.path.join(location, '..', 'bindings', 'python-cffi', 'notmuch2'))
> +
>  # read generated config
>  for pathdir in ['.', '..']:
>      conf_file = os.path.join(location,pathdir,'sphinx.config')
> @@ -50,6 +55,9 @@ else:
>      # the docstring include files
>      exclude_patterns.append('notmuch-emacs.rst')
>  
> +if not tags.has('WITH_PYTHON'):
> +    exclude_patterns.append('python-bindings.rst')
> +
>  # The name of the Pygments (syntax highlighting) style to use.
>  pygments_style = 'sphinx'
>  
> diff --git a/doc/index.rst b/doc/index.rst
> index 4440d93a..a3bf3480 100644
> --- a/doc/index.rst
> +++ b/doc/index.rst
> @@ -26,6 +26,7 @@ Contents:
>     man7/notmuch-search-terms
>     man1/notmuch-show
>     man1/notmuch-tag
> +   python-bindings
>  
>  Indices and tables
>  ==================
> diff --git a/doc/python-bindings.rst b/doc/python-bindings.rst
> new file mode 100644
> index 00000000..e1ad26ad
> --- /dev/null
> +++ b/doc/python-bindings.rst
> @@ -0,0 +1,5 @@
> +Python Bindings
> +===============
> +
> +.. automodule:: notmuch2
> +   :members:

  parent reply	other threads:[~2020-07-14 21:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-11 13:20 [PATCH 1/2] doc: replace use of environment variables with a generated config David Bremner
2020-07-11 13:20 ` [PATCH 2/2] doc: add new python bindings to main documentatation tree David Bremner
2020-07-12 12:02   ` [PATCH] doc: set up for autoapi / readthedocs compatibility David Bremner
2020-07-14 21:42     ` Floris Bruynooghe
2020-07-15 11:53       ` David Bremner
2020-07-14 21:21   ` Floris Bruynooghe [this message]
2020-07-11 14:00 ` [PATCH 1/2] doc: replace use of environment variables with a generated config Tomi Ollila
2020-07-14 21:43   ` Floris Bruynooghe
2020-07-15 12:28   ` David Bremner
2020-07-15 12:36     ` [PATCH] configure: replace multiple redirects with redirected block David Bremner
2020-07-18 15:00       ` David Bremner
2020-07-14 21:15 ` [PATCH 1/2] doc: replace use of environment variables with a generated config Floris Bruynooghe
2020-07-17 10:07   ` Tomi Ollila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8ohbxn1.fsf@powell.devork.be \
    --to=flub@devork.be \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).