Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Fri, 29 Aug 2014 12:10:56 UTC
Commit: 8d5e666d9eab5518f300b45a71295027b2e9047a
https://github.com/geany/geany/commit/8d5e666d9eab5518f300b45a71295027b2e90…
Log Message:
-----------
Build HTML documentation automatically during the build process
This is an improvement as requested in #322 to update the HTML docs
after geany.txt or geany.css have changed.
Also, with this change the resulting HTML will be generated in the outdir,
not in srcdir/doc anymore.
Modified Paths:
--------------
wscript
Modified: wscript
43 lines changed, 23 insertions(+), 20 deletions(-)
===================================================================
@@ -232,6 +232,9 @@ def configure(conf):
conf.env['minimum_gtk_version'] = minimum_gtk_version
conf.env['use_gtk3'] = conf.options.use_gtk3
+ # rst2html for the HTML manual
+ conf.env['RST2HTML'] = _find_rst2html(conf)
+
# Windows specials
if is_win32:
if conf.env['PREFIX'].lower() == tempfile.gettempdir().lower():
@@ -456,6 +459,18 @@ def build(bld):
install_path = '${LOCALEDIR}',
appname = 'geany')
+ # HTML documentation (build if it is not part of the tree already, as it is required for install)
+ html_doc_filename = os.path.join(bld.out_dir, 'doc', 'geany.html')
+ if bld.env['RST2HTML']:
+ rst2html = bld.env['RST2HTML']
+ bld(
+ source = ['doc/geany.txt'],
+ deps = ['doc/geany.css'],
+ target = 'doc/geany.html',
+ name = 'geany.html',
+ cwd = os.path.join(bld.path.abspath(), 'doc'),
+ rule = '%s -stg --stylesheet=geany.css geany.txt %s' % (rst2html, html_doc_filename))
+
# geany.pc
if is_win32:
# replace backward slashes by forward slashes as they could be interepreted as escape
@@ -514,11 +529,6 @@ def build(bld):
'top_builddir': bld.out_dir,
'top_srcdir': bld.top_dir,})
- # build HTML documentation if it is not part of the tree already, as it is required for install
- # FIXME: replace this with automatic building if source changed/destination is missing
- if not bld.path.find_resource('doc/geany.html'):
- htmldoc(bld)
-
###
# Install files
###
@@ -541,18 +551,21 @@ def build(bld):
# Docs
base_dir = '${PREFIX}' if is_win32 else '${DOCDIR}'
ext = '.txt' if is_win32 else ''
- html_dir = '' if is_win32 else 'html/'
- html_name = 'Manual.html' if is_win32 else 'index.html'
for filename in 'AUTHORS ChangeLog COPYING README NEWS THANKS TODO'.split():
basename = _uc_first(filename, bld)
destination_filename = '%s%s' % (basename, ext)
destination = os.path.join(base_dir, destination_filename)
bld.install_as(destination, filename)
- start_dir = bld.path.find_dir('doc/images')
- bld.install_files('${DOCDIR}/%simages' % html_dir, start_dir.ant_glob('*.png'), cwd=start_dir)
+ # install HTML documentation only if it exists, i.e. it was built before
+ if os.path.exists(html_doc_filename):
+ html_dir = '' if is_win32 else 'html/'
+ html_name = 'Manual.html' if is_win32 else 'index.html'
+ start_dir = bld.path.find_dir('doc/images')
+ bld.install_files('${DOCDIR}/%simages' % html_dir, start_dir.ant_glob('*.png'), cwd=start_dir)
+ bld.install_as('${DOCDIR}/%s%s' % (html_dir, html_name), 'doc/geany.html')
+
bld.install_as('${DOCDIR}/%s' % _uc_first('manual.txt', bld), 'doc/geany.txt')
- bld.install_as('${DOCDIR}/%s%s' % (html_dir, html_name), 'doc/geany.html')
bld.install_as('${DOCDIR}/ScintillaLicense.txt', 'scintilla/License.txt')
if is_win32:
bld.install_as('${DOCDIR}/ReadMe.I18n.txt', 'README.I18N')
@@ -677,16 +690,6 @@ def apidoc(ctx):
os.chdir('..')
-def htmldoc(ctx):
- """generate HTML documentation"""
- # first try rst2html.py as it is the upstream default, fall back to rst2html
- cmd = _find_rst2html(ctx)
- os.chdir('doc')
- Logs.pprint('CYAN', 'Generating HTML documentation')
- ctx.exec_command('%s -stg --stylesheet=geany.css %s %s' % (cmd, 'geany.txt', 'geany.html'))
- os.chdir('..')
-
-
def _find_program(ctx, cmd, **kw):
def noop(*args):
pass
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Wed, 27 Aug 2014 17:06:22 UTC
Commit: 102169ee3200176178bfd2290ae5db45b545df4f
https://github.com/geany/geany/commit/102169ee3200176178bfd2290ae5db45b545d…
Log Message:
-----------
Merge branch 'doc/untrack-geany.html'
Closes PR#322.
Modified Paths:
--------------
.gitignore
doc/Makefile.am
doc/geany.html
m4/geany-docutils.m4
wscript
Modified: .gitignore
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -99,6 +99,7 @@ Makefile.in
/doc/Doxyfile
/doc/Doxyfile.stamp
/doc/geany.1
+/doc/geany.html
/doc/hacking.html
/doc/*.pdf
/doc/*.aux
Modified: doc/Makefile.am
28 lines changed, 11 insertions(+), 17 deletions(-)
===================================================================
@@ -56,16 +56,17 @@ geany.html: $(srcdir)/geany.css $(srcdir)/geany.txt
hacking.html: $(srcdir)/geany.css $(top_srcdir)/HACKING
$(AM_V_GEN)$(RST2HTML) -stg --stylesheet=$(srcdir)/geany.css $(top_srcdir)/HACKING $@
-all-html-local: geany.html hacking.html
+all-local: geany.html hacking.html
+# clean on 'maintainer-clean' rather than 'clean' in case it was not
+# built by Make but rather part of the distribution. This is fine even
+# then, as configure will properly require what is needed to build it
+# again if it is missing.
+maintainer-clean-local: clean-html-local
clean-html-local:
-rm -f hacking.html
-# FIXME: why is the generated HTML manual checked-in to VCS?
-# -rm -f geany.html
+ -rm -f geany.html
-else
-all-html-local:;
-clean-html-local:;
endif
# PDF user manual
@@ -74,14 +75,12 @@ if WITH_RST2PDF
geany-$(VERSION).pdf: geany.txt
$(AM_V_GEN)$(RST2PDF) $(srcdir)/geany.txt -o $@
-all-pdf-local: geany-$(VERSION).pdf
+all-local: geany-$(VERSION).pdf
+clean-local: clean-pdf-local
clean-pdf-local:
-rm -f geany-$(VERSION).pdf
-else
-all-pdf-local:;
-clean-pdf-local:;
endif
# API Documentation
@@ -100,19 +99,14 @@ doxygen_sources = \
Doxyfile.stamp: Doxyfile $(doxygen_sources)
$(AM_V_GEN)$(DOXYGEN) Doxyfile && echo "" > $@
-all-api-docs-local: Doxyfile.stamp
+all-local: Doxyfile.stamp
+clean-local: clean-api-docs-local
clean-api-docs-local:
-rm -rf reference/ Doxyfile.stamp
-else
-all-api-docs-local:;
-clean-api-docs-local:;
endif
-all-local: all-html-local all-pdf-local all-api-docs-local
-clean-local: clean-html-local clean-pdf-local clean-api-docs-local
-
uninstall-local:
rm -rf $(DOCDIR);
Modified: doc/geany.html
6970 lines changed, 0 insertions(+), 6970 deletions(-)
===================================================================
No diff available, check online
Modified: m4/geany-docutils.m4
20 lines changed, 15 insertions(+), 5 deletions(-)
===================================================================
@@ -12,11 +12,19 @@ dnl For HTML documentation generation
dnl
AC_DEFUN([GEANY_CHECK_DOCUTILS_HTML],
[
+ AC_REQUIRE([GEANY_CHECK_REVISION])
+
+ dnl we require rst2html by default unless we don't build from Git
+ dnl and already have the HTML manual built in-tree
+ html_docs_default=yes
+ AS_IF([test "$REVISION" = "-1" && test -f "$srcdir/doc/geany.html"],
+ [html_docs_default=auto])
+
AC_ARG_ENABLE([html-docs],
[AS_HELP_STRING([--enable-html-docs],
- [generate HTML documentation using rst2html [default=no]])],
+ [generate HTML documentation using rst2html [default=auto]])],
[geany_enable_html_docs="$enableval"],
- [geany_enable_html_docs="no"])
+ [geany_enable_html_docs="$html_docs_default"])
AC_ARG_VAR([RST2HTML], [Path to Docutils rst2html executable])
AS_IF([test "x$geany_enable_html_docs" != "xno"],
[
@@ -26,7 +34,9 @@ dnl TODO: try rst2html.py first
AS_IF([test "x$RST2HTML" != "xno"],
[geany_enable_html_docs="yes"],
[test "x$geany_enable_html_docs" = "xyes"],
- [AC_MSG_ERROR([Documentation enabled but rst2html not found])],
+ [AC_MSG_ERROR([Documentation enabled but rst2html not found.
+You can explicitly disable building of the HTML manual with --disable-html-docs,
+but you then may not have a local copy of the HTML manual.])],
[geany_enable_html_docs="no"])
])
AM_CONDITIONAL([WITH_RST2HTML], [test "x$geany_enable_html_docs" != "xno"])
@@ -40,9 +50,9 @@ AC_DEFUN([GEANY_CHECK_DOCUTILS_PDF],
[
AC_ARG_ENABLE([pdf-docs],
[AS_HELP_STRING([--enable-pdf-docs],
- [generate PDF documentation using rst2pdf [default=no]])],
+ [generate PDF documentation using rst2pdf [default=auto]])],
[geany_enable_pdf_docs="$enableval"],
- [geany_enable_pdf_docs="no"])
+ [geany_enable_pdf_docs="auto"])
AC_ARG_VAR([RST2PDF], [Path to Docutils rst2pdf executable])
AS_IF([test "x$geany_enable_pdf_docs" != "xno"],
[
Modified: wscript
5 lines changed, 5 insertions(+), 0 deletions(-)
===================================================================
@@ -514,6 +514,11 @@ def build(bld):
'top_builddir': bld.out_dir,
'top_srcdir': bld.top_dir,})
+ # build HTML documentation if it is not part of the tree already, as it is required for install
+ # FIXME: replace this with automatic building if source changed/destination is missing
+ if not bld.path.find_resource('doc/geany.html'):
+ htmldoc(bld)
+
###
# Install files
###
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Wed, 27 Aug 2014 17:02:24 UTC
Commit: 64910a4ea1f3f902ffa08dfdf6422c8e69ad98fd
https://github.com/geany/geany/commit/64910a4ea1f3f902ffa08dfdf6422c8e69ad9…
Log Message:
-----------
Fix Waf build after HTML documentation untracking
Modified Paths:
--------------
wscript
Modified: wscript
5 lines changed, 5 insertions(+), 0 deletions(-)
===================================================================
@@ -514,6 +514,11 @@ def build(bld):
'top_builddir': bld.out_dir,
'top_srcdir': bld.top_dir,})
+ # build HTML documentation if it is not part of the tree already, as it is required for install
+ # FIXME: replace this with automatic building if source changed/destination is missing
+ if not bld.path.find_resource('doc/geany.html'):
+ htmldoc(bld)
+
###
# Install files
###
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).