unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [RFC PATCH] doc: add support for adding configure options as Sphinx tags
@ 2017-02-26 20:56 Jani Nikula
  2017-03-09 12:47 ` David Bremner
  0 siblings, 1 reply; 2+ messages in thread
From: Jani Nikula @ 2017-02-26 20:56 UTC (permalink / raw)
  To: notmuch

Add the configure options specified in $(TAGS) that equal 1 as tags on
the Sphinx command line using the -t option. The tags may be used to
conditionally include documentation using the Sphinx "only" directive
[1].

As an example, indicate in the documentation whether the Xapian field
processor is likely to be available (assuming the notmuch binary was
built in the same environment as the documentation).

[1] http://www.sphinx-doc.org/en/stable/markup/misc.html#including-content-based-on-tags

---

Just an idea, not sure if it makes sense.
---
 doc/Makefile.local                | 7 ++++++-
 doc/man7/notmuch-search-terms.rst | 8 ++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/doc/Makefile.local b/doc/Makefile.local
index c6f05ca879c0..24fc457cab14 100644
--- a/doc/Makefile.local
+++ b/doc/Makefile.local
@@ -7,8 +7,13 @@ SPHINXOPTS    := -q
 SPHINXBUILD   = sphinx-build
 DOCBUILDDIR      := $(dir)/_build
 
+# Configure options to be added as Sphinx tags.
+# Add "-t <tag>" for each make variable in TAGS that equals 1.
+TAGS := HAVE_XAPIAN_FIELD_PROCESSOR HAVE_XAPIAN_COMPACT
+TAGOPTS := $(patsubst %=1,-t %,$(filter %=1,$(foreach tag,$(TAGS),$(tag)=$(value $(tag)))))
+
 # Internal variables.
-ALLSPHINXOPTS   := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(srcdir)/$(dir)
+ALLSPHINXOPTS   := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(TAGOPTS) $(srcdir)/$(dir)
 APIMAN		:= $(DOCBUILDDIR)/man/man3/notmuch.3
 DOXYFILE	:= $(srcdir)/$(dir)/doxygen.cfg
 
diff --git a/doc/man7/notmuch-search-terms.rst b/doc/man7/notmuch-search-terms.rst
index de93d7332472..0a2f74ce57a6 100644
--- a/doc/man7/notmuch-search-terms.rst
+++ b/doc/man7/notmuch-search-terms.rst
@@ -392,6 +392,14 @@ notmuch was built against a sufficiently recent version of Xapian by running
 
   % notmuch config get built_with.field_processor
 
+.. only:: HAVE_XAPIAN_FIELD_PROCESSOR
+
+   The documentation was built on a host with field processor support.
+
+.. only:: not HAVE_XAPIAN_FIELD_PROCESSOR
+
+   The documentation was built on a host without field processor support.
+
 Currently the following features require field processor support:
 
 - non-range date queries, e.g. "date:today"
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC PATCH] doc: add support for adding configure options as Sphinx tags
  2017-02-26 20:56 [RFC PATCH] doc: add support for adding configure options as Sphinx tags Jani Nikula
@ 2017-03-09 12:47 ` David Bremner
  0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2017-03-09 12:47 UTC (permalink / raw)
  To: Jani Nikula, notmuch

Jani Nikula <jani@nikula.org> writes:

> Add the configure options specified in $(TAGS) that equal 1 as tags on
> the Sphinx command line using the -t option. The tags may be used to
> conditionally include documentation using the Sphinx "only" directive
> [1].
>
> As an example, indicate in the documentation whether the Xapian field
> processor is likely to be available (assuming the notmuch binary was
> built in the same environment as the documentation).
>
> [1] http://www.sphinx-doc.org/en/stable/markup/misc.html#including-content-based-on-tags
>

It does seem like it could potentially help people find what optional
features are available.

A couple of observations

1) Many people read documentation on-line, even in cases where some of
   us might not think it makes sense.

2) We might eventually (per an outstanding request) provide a seperate
tarball of prebuilt docs.

Both of those suggest a need to build a "generic" version of the docs.

d

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-09 12:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-26 20:56 [RFC PATCH] doc: add support for adding configure options as Sphinx tags Jani Nikula
2017-03-09 12:47 ` David Bremner

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).