mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-04 16:38:14 +01:00
doc: remove support for rst2man
It was becoming increasingly complicated to support rst2man, and there were apparently not many people that relied on it.
This commit is contained in:
parent
7fcd100a2f
commit
d241a486fa
6 changed files with 13 additions and 104 deletions
7
INSTALL
7
INSTALL
|
@ -75,14 +75,11 @@ Talloc, and zlib which are each described below:
|
||||||
Building Documentation
|
Building Documentation
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
By default the documentation for notmuch is built using sphinx.
|
To build the documentation for notmuch you need at least version 1.0
|
||||||
|
of sphinx (Jul. 2010).
|
||||||
|
|
||||||
Sphinx is available from www.sphinx-doc.org.
|
Sphinx is available from www.sphinx-doc.org.
|
||||||
|
|
||||||
If you prefer, you can build the man pages using rst2man, from the
|
|
||||||
python docutils package. See doc/INSTALL for details.
|
|
||||||
|
|
||||||
|
|
||||||
Installing Dependencies from Packages
|
Installing Dependencies from Packages
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
|
|
6
NEWS
6
NEWS
|
@ -1,5 +1,11 @@
|
||||||
Notmuch 0.20 (UNRELEASED)
|
Notmuch 0.20 (UNRELEASED)
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Support for using rst2man in place of sphinx to build the
|
||||||
|
docmumentation has been removed.
|
||||||
|
|
||||||
Contrib
|
Contrib
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|
20
configure
vendored
20
configure
vendored
|
@ -447,19 +447,9 @@ printf "Checking if sphinx is available and supports nroff output... "
|
||||||
if hash sphinx-build > /dev/null 2>&1 && ${python} -m sphinx.writers.manpage > /dev/null 2>&1 ; then
|
if hash sphinx-build > /dev/null 2>&1 && ${python} -m sphinx.writers.manpage > /dev/null 2>&1 ; then
|
||||||
printf "Yes.\n"
|
printf "Yes.\n"
|
||||||
have_sphinx=1
|
have_sphinx=1
|
||||||
have_rst2man=0
|
|
||||||
else
|
else
|
||||||
printf "No (falling back to rst2man).\n"
|
printf "No (so will not install man pages).\n"
|
||||||
have_sphinx=0
|
have_sphinx=0
|
||||||
|
|
||||||
printf "Checking if rst2man is available... "
|
|
||||||
if rst2man -V > /dev/null 2>&1; then
|
|
||||||
printf "Yes.\n"
|
|
||||||
have_rst2man=1
|
|
||||||
else
|
|
||||||
printf "No (so will not install man pages).\n"
|
|
||||||
have_rst2man=0
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
libdir_in_ldconfig=0
|
libdir_in_ldconfig=0
|
||||||
|
@ -848,9 +838,6 @@ HAVE_EMACS = ${have_emacs}
|
||||||
# Whether there's a sphinx-build binary available for building documentation
|
# Whether there's a sphinx-build binary available for building documentation
|
||||||
HAVE_SPHINX=${have_sphinx}
|
HAVE_SPHINX=${have_sphinx}
|
||||||
|
|
||||||
# Whether there's a rst2man binary available for building documentation
|
|
||||||
HAVE_RST2MAN=${have_rst2man}
|
|
||||||
|
|
||||||
# Whether there's a doxygen binary available for building api documentation
|
# Whether there's a doxygen binary available for building api documentation
|
||||||
HAVE_DOXYGEN=${have_doxygen}
|
HAVE_DOXYGEN=${have_doxygen}
|
||||||
|
|
||||||
|
@ -978,9 +965,8 @@ cat > sh.config <<EOF
|
||||||
# Whether the Xapian version in use supports compaction
|
# Whether the Xapian version in use supports compaction
|
||||||
NOTMUCH_HAVE_XAPIAN_COMPACT=${have_xapian_compact}
|
NOTMUCH_HAVE_XAPIAN_COMPACT=${have_xapian_compact}
|
||||||
|
|
||||||
# Whether there's either sphinx or rst2man available for building
|
# do we have man pages?
|
||||||
# documentation
|
NOTMUCH_HAVE_MAN=$((have_sphinx))
|
||||||
NOTMUCH_HAVE_MAN=$((have_sphinx || have_rst2man))
|
|
||||||
|
|
||||||
# Name of python interpreter
|
# Name of python interpreter
|
||||||
NOTMUCH_PYTHON=${python}
|
NOTMUCH_PYTHON=${python}
|
||||||
|
|
13
doc/INSTALL
13
doc/INSTALL
|
@ -1,9 +1,6 @@
|
||||||
This file contains some more detailed information about building and
|
This file contains some more detailed information about building and
|
||||||
installing the documentation.
|
installing the documentation.
|
||||||
|
|
||||||
Building with sphinx.
|
|
||||||
---------------------
|
|
||||||
|
|
||||||
- You need sphinx at least version 1.0.
|
- You need sphinx at least version 1.0.
|
||||||
|
|
||||||
- You can build build and install man pages with 'make install-man'
|
- You can build build and install man pages with 'make install-man'
|
||||||
|
@ -12,13 +9,3 @@ Building with sphinx.
|
||||||
(currently only the man pages) with
|
(currently only the man pages) with
|
||||||
|
|
||||||
'make install-{man|info|html|pdf}'
|
'make install-{man|info|html|pdf}'
|
||||||
|
|
||||||
Building the man pages
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
- You can build the man pages with rst2man (from python-docutils) with
|
|
||||||
'make rst2man'.
|
|
||||||
|
|
||||||
- Currently there is no support to automagically install the resulting
|
|
||||||
nroff files, but it should work to modify the target install-man
|
|
||||||
in doc/Makefile.local.
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ SPHINXOPTS := -q
|
||||||
SPHINXBUILD = sphinx-build
|
SPHINXBUILD = sphinx-build
|
||||||
DOCBUILDDIR := $(dir)/_build
|
DOCBUILDDIR := $(dir)/_build
|
||||||
|
|
||||||
prerst2man := python $(srcdir)/$(dir)/prerst2man.py
|
|
||||||
mkdocdeps := python $(srcdir)/$(dir)/mkdocdeps.py
|
mkdocdeps := python $(srcdir)/$(dir)/mkdocdeps.py
|
||||||
|
|
||||||
# Internal variables.
|
# Internal variables.
|
||||||
|
@ -50,8 +49,6 @@ ifeq ($(HAVE_SPHINX),1)
|
||||||
mkdir -p $(DOCBUILDDIR)/man/man$${section}; \
|
mkdir -p $(DOCBUILDDIR)/man/man$${section}; \
|
||||||
mv $(DOCBUILDDIR)/man/*.$${section} $(DOCBUILDDIR)/man/man$${section}; \
|
mv $(DOCBUILDDIR)/man/*.$${section} $(DOCBUILDDIR)/man/man$${section}; \
|
||||||
done
|
done
|
||||||
else ifeq ($(HAVE_RST2MAN),1)
|
|
||||||
$(prerst2man) $(srcdir)/doc $(DOCBUILDDIR)/man
|
|
||||||
else
|
else
|
||||||
@echo "Fatal: build dependency fail."
|
@echo "Fatal: build dependency fail."
|
||||||
@false
|
@false
|
||||||
|
@ -79,10 +76,10 @@ endif
|
||||||
|
|
||||||
# Do not try to build or install man pages if a man page converter is
|
# Do not try to build or install man pages if a man page converter is
|
||||||
# not available.
|
# not available.
|
||||||
ifeq ($(HAVE_SPHINX)$(HAVE_RST2MAN),00)
|
ifeq ($(HAVE_SPHINX),0)
|
||||||
build-man:
|
build-man:
|
||||||
install-man:
|
install-man:
|
||||||
@echo "No sphinx or rst2man, will not install man pages."
|
@echo "No sphinx, will not install man pages."
|
||||||
else
|
else
|
||||||
build-man: ${MAN_GZIP_FILES}
|
build-man: ${MAN_GZIP_FILES}
|
||||||
install-man: ${MAN_GZIP_FILES}
|
install-man: ${MAN_GZIP_FILES}
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
from sys import argv
|
|
||||||
from datetime import date
|
|
||||||
from os.path import dirname, isdir
|
|
||||||
from os import makedirs, system
|
|
||||||
import re
|
|
||||||
|
|
||||||
sourcedir = argv[1]
|
|
||||||
outdir = argv[2]
|
|
||||||
|
|
||||||
if not isdir(outdir):
|
|
||||||
makedirs(outdir, 0o755)
|
|
||||||
|
|
||||||
with open(sourcedir + "/conf.py") as cf:
|
|
||||||
exec(cf.read())
|
|
||||||
|
|
||||||
|
|
||||||
def header(file, startdocname, command, description, authors, section):
|
|
||||||
file.write("""
|
|
||||||
{0:s}
|
|
||||||
{1:s}
|
|
||||||
{2:s}
|
|
||||||
|
|
||||||
:Date: {3:s}
|
|
||||||
:Version: {4:s}
|
|
||||||
:Manual section: {5:d}
|
|
||||||
:Manual group: {6:s}
|
|
||||||
|
|
||||||
""".format(
|
|
||||||
'-' * len(description),
|
|
||||||
description,
|
|
||||||
'-' * len(description),
|
|
||||||
date.today().isoformat(), release, section, project))
|
|
||||||
|
|
||||||
blankre = re.compile("^\s*$")
|
|
||||||
for page in man_pages:
|
|
||||||
outdirname = outdir + '/' + dirname(page[0])
|
|
||||||
if not isdir(outdirname):
|
|
||||||
makedirs(outdirname, 0o755)
|
|
||||||
filename = outdir + '/' + page[0] + '.rst'
|
|
||||||
outfile = open(filename, 'w')
|
|
||||||
infile = open(sourcedir + '/' + page[0] + '.rst', 'r')
|
|
||||||
|
|
||||||
# this is a crude hack. We look for the first blank line, and
|
|
||||||
# insert the rst2man header there.
|
|
||||||
#
|
|
||||||
# XXX consider really parsing input
|
|
||||||
|
|
||||||
count = 0
|
|
||||||
lines = infile.readlines()
|
|
||||||
for line in lines:
|
|
||||||
outfile.write(line)
|
|
||||||
if (blankre.match(line)):
|
|
||||||
break
|
|
||||||
count = count + 1
|
|
||||||
|
|
||||||
del lines[0:count + 1]
|
|
||||||
|
|
||||||
header(outfile, *page)
|
|
||||||
|
|
||||||
outfile.write("".join(lines))
|
|
||||||
outfile.close()
|
|
||||||
|
|
||||||
system('set -x; rst2man {0} {1}/{2}.{3}'
|
|
||||||
.format(filename, outdir, page[0], page[4]))
|
|
Loading…
Reference in a new issue