From 4f99cd19bd96783adf370e60e669253052ecf603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 25 Aug 2016 15:00:11 +0000 Subject: [PATCH] better doxygen --- scripts/ax_init_standard_project.m4 | 30 +++++++++++-- scripts/bootstrap.sh | 69 +++++++++++++++++++++++++++-- 2 files changed, 92 insertions(+), 7 deletions(-) diff --git a/scripts/ax_init_standard_project.m4 b/scripts/ax_init_standard_project.m4 index 03b827c..6f19ed2 100644 --- a/scripts/ax_init_standard_project.m4 +++ b/scripts/ax_init_standard_project.m4 @@ -170,15 +170,33 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [ AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_TARNAME//[^a-zA-Z0-9]/_}'" AX_SUBST(NUMBERS) AX_SUBST(HOME) - README=$(tail -n +3 README) + if test -f README.md; then + README=$() + DESCRIPTION=$(head -1 README.md) + else + README=$(tail -n +3 README) + DESCRIPTION=$(head -1 README) + fi + if which pandoc 2>&1 > /dev/null; then + README_HTML=$(echo "$README" | pandoc -f markdown_github -t html | sed ':a;N;$!ba;s,\\n,\\\\\\\\n,g;s/\n/\\n/g;s,",\\",g') + else + README_HTML="${README}" + fi AX_SUBST(README) _AM_SUBST_NOTMAKE([README]) - DESCRIPTION=$(head -1 README) + AX_SUBST(README_HTML) + _AM_SUBST_NOTMAKE([README_HTML]) AX_SUBST(DESCRIPTION) _AM_SUBST_NOTMAKE([DESCRIPTION]) AUTHOR=$(head -1 AUTHORS) + AUTHOR_NAME=$(echo $AUTHOR | sed 's, *[[<(]].*$,,') + AUTHOR_URL=$(echo $AUTHOR | sed 's,.*(\(http[[^)]]*\)).*,\1,') + AUTHOR_MAIL=$(echo $AUTHOR | sed 's,.*<\(.*@.*\)>.*,\1,') AX_SUBST(AUTHOR) _AM_SUBST_NOTMAKE([AUTHOR]) + AX_SUBST(AUTHOR_NAME) + AX_SUBST(AUTHOR_URL) + AX_SUBST(AUTHOR_MAIL) DISTRO=$(lsb_release -sc 2>/dev/null || uname -s 2>/dev/null) AX_SUBST(DISTRO) ARCH=$((@<:@@<:@ $(uname -sm) =~ 64 @:>@@:>@ && echo amd64) || (@<:@@<:@ $(uname -sm) =~ 'i?86' @:>@@:>@ && echo i386 || uname -sm)) @@ -444,7 +462,11 @@ EOF # use this in configure.ac to support debian packages AC_DEFUN([AX_USE_DEBIAN_PACKAGING], [ - README_DEB=$(tail -n +3 README | sed -e 's/^ *$/./g' -e 's/^/ /g') + if test -f README.md; then + README_DEB=$(tail -n +3 README.md | sed -e 's/^ *$/./g' -e 's/^/ /g') + else + README_DEB=$(tail -n +3 README | sed -e 's/^ *$/./g' -e 's/^/ /g') + fi AC_SUBST(README_DEB) _AM_SUBST_NOTMAKE([README_DEB]) AC_CONFIG_FILES([debian/changelog debian/control]) @@ -506,7 +528,7 @@ AC_DEFUN([AX_USE_DOXYGEN], [ AC_MSG_WARN([Missing program mscgen! - when you rebild documentation, there are no message state charts - there are precompiled derived files in the distribution]); fi - AC_CONFIG_FILES([doc/makefile doc/doxyfile]) + AC_CONFIG_FILES([doc/makefile doc/doxyfile doc/header.html doc/footer.html]) AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-documentation], [doc/makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([distclean-am], [distclean-documentation], [doc/makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-documentation], [doc/makefile.in]) diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index a7777ee..e073d6c 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -151,6 +151,9 @@ GENERATED FILES * scripts/makefile.am - if you enabled AX_USE_SCRIPTS * doc/makefile.am - if you enabled AX_USE_DOXYGEN * doc/doxyfile.in - if you enabled AX_USE_DOXYGEN + * doc/header.html.in - if you enabled AX_USE_DOXYGEN + * doc/footer.html.in - if you enabled AX_USE_DOXYGEN + * doc/style.css - if you enabled AX_USE_DOXYGEN * test/makefile.am - if you enabled AX_USE_CPPUNIT and AX_USE_CXX * test/${DEFAULT_PROJECT_NAME#lib}.cxx - if you enabled AX_BUILD_TEST or AX_USE_CPPUNIT * examples/makefile.am - if you enabled AX_BUILD_EXAMPLES @@ -873,6 +876,58 @@ www_DATA = MAINTAINERCLEANFILES = makefile.in EOF +to --condition AX_USE_DOXYGEN doc/header.html.in < + + + + + + +\$projectname: \$title +\$title + + + +\$treeview +\$search +\$mathjax + +\$extrastylesheet + + +
+ +
+
+ +
\$projectname \$projectnumber
+
\$projectbrief
+
+ +
+EOF +to --condition AX_USE_DOXYGEN doc/footer.html.in < + +
+ + +EOF +to --condition AX_USE_DOXYGEN doc/style.css <@AUTHOR_NAME@\\n"' doxyadd ALIASES '"license=\\par License\\n"' doxyadd ALIASES '"classmutex=\\par Reentrant:\\nAccess is locked with class static mutex @c "' doxyadd ALIASES '"instancemutex=\\par Reentrant:\\nAccess is locked with per instance mutex @c "' doxyadd ALIASES '"mutex=\\par Reentrant:\\nAccess is locked with mutex @c "' doxyadd ALIASES '"api=\\xrefitem api \\"API Call\\" \\"\\""' + doxyadd ALIASES '"description=@DESCRIPTION@"' + doxyadd ALIASES '"readme=@README_HTML@"' + doxyadd ALIASES '"author=@AUTHOR_NAME@"' doxyreplace ENABLE_PREPROCESSING YES doxyreplace MACRO_EXPANSION YES doxyadd PREDEFINED '"NAMESPACE=@PACKAGE_NAME@"' @@ -927,7 +985,13 @@ if testtag AX_USE_DOXYGEN; then fi doxyreplace FILE_PATTERNS '*.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.idl *.ddl *.odl *.h *.hh *.hxx *.hpp *.h++ *.cs *.d *.php *.php4 *.php5 *.phtml *.inc *.m *.markdown *.md *.mm *.dox *.py *.f90 *.f *.for *.tcl *.vhd *.vhdl *.ucf *.qsf *.as *.js *.wt *.sql' doxyreplace RECURSIVE YES - doxyreplace EXCLUDE_PATTERNS "moc_* uic_* qrc_*" + doxyreplace EXCLUDE_PATTERNS "moc_* uic_* qrc_* version.[ch]xx" + doxyreplace HTML_HEADER header.html + doxyreplace HTML_FOOTER footer.html + doxyreplace HTML_EXTRA_STYLESHEET style.css + doxyreplace HTML_DYNAMIC_SECTIONS YES + doxyreplace DISABLE_INDEX YES + doxyreplace GENERATE_TREEVIEW YES if testtag AX_BUILD_EXAMPLES; then doxyreplace EXAMPLE_PATH @top_srcdir@/examples fi @@ -936,7 +1000,6 @@ if testtag AX_USE_DOXYGEN; then doxyreplace SOURCE_BROWSER YES doxyreplace INLINE_SOURCES YES doxyreplace GENERATE_TESTLIST YES - doxyreplace GENERATE_TREEVIEW NO doxyreplace SEARCHENGINE NO doxyreplace GENERATE_HTML YES doxyreplace GENERATE_LATEX NO