From 8882b4b3d42e24e5b03b2979632890841947486d Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 21 Apr 2021 13:17:33 +0200 Subject: [PATCH] Fix htmlize --- src/Makefile | 2 +- tools/Building.org | 34 ++++++++++++++++------------------ tools/build_doc.sh | 24 +++++++++++------------- tools/create_makefile.sh | 2 +- 4 files changed, 29 insertions(+), 33 deletions(-) diff --git a/src/Makefile b/src/Makefile index 316aab1..abad9d4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -116,7 +116,7 @@ clean: - $(RM) test_qmckl_* test_qmckl.c \ $(qmckl_h) $(qmckl_f) \ qmckl_*.f90 qmckl_*.c qmckl_*.h \ - Makefile.generated *.html + Makefile.generated *.html Makefile.generated: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURCE_FILES) $(QMCKL_ROOT)/tools/create_makefile.sh diff --git a/tools/Building.org b/tools/Building.org index 5f2ba8e..69fd55f 100644 --- a/tools/Building.org +++ b/tools/Building.org @@ -69,7 +69,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #+begin_src makefile # <> -.POSIX: +.POSIX: #+end_src ** Dependencies @@ -188,7 +188,7 @@ clean: - $(RM) test_qmckl_* test_qmckl.c \ $(qmckl_h) $(qmckl_f) \ qmckl_*.f90 qmckl_*.c qmckl_*.h \ - Makefile.generated *.html + Makefile.generated *.html Makefile.generated: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURCE_FILES) $(QMCKL_ROOT)/tools/create_makefile.sh @@ -325,7 +325,7 @@ shared_lib=\$(QMCKL_ROOT)/lib/libqmckl.so static_lib=\$(QMCKL_ROOT)/lib/libqmckl.a qmckl_h=\$(QMCKL_ROOT)/include/qmckl.h qmckl_f=\$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90 -munit=\$(QMCKL_ROOT)/munit/munit.c +munit=\$(QMCKL_ROOT)/munit/munit.c shared: \$(shared_lib) static: \$(static_lib) @@ -489,13 +489,13 @@ EOF :END: First define readonly global variables. - + #+begin_src bash :noweb yes readonly DOCS=${QMCKL_ROOT}/docs/ readonly SRC=${QMCKL_ROOT}/src/ readonly HTMLIZE=${DOCS}/htmlize.el -readonly CONFIG_DOC=${QMCKL_ROOT}/tools/config_doc.el -readonly CONFIG_TANGLE=${QMCKL_ROOT}/tools/config_tangle.el +readonly CONFIG_DOC=${QMCKL_ROOT}/tools/config_doc.el +readonly CONFIG_TANGLE=${QMCKL_ROOT}/tools/config_tangle.el #+end_src Check that all the defined global variables correspond to files. @@ -517,7 +517,7 @@ function check_preconditions() exit 2 fi done - + for file in ${CONFIG_DOC} ${CONFIG_TANGLE} do if [[ ! -f ${file} ]] @@ -537,7 +537,7 @@ function install_htmlize() { local url="https://github.com/hniksic/emacs-htmlize" local repo="emacs-htmlize" - + [[ -f ${HTMLIZE} ]] || ( cd ${DOCS} git clone ${url} \ @@ -558,8 +558,8 @@ function install_htmlize() function extract_doc() { local org=$1 - local local_html=${SRC}/${org%.org}.html - local html=${DOCS}/${org%.org}.html + local local_html=${SRC}/${org%.org}.html + local html=${DOCS}/${org%.org}.html if [[ -f ${html} && ${org} -ot ${html} ]] then @@ -570,23 +570,21 @@ function extract_doc() --load ${CONFIG_DOC} \ ${org} \ --load ${CONFIG_TANGLE} \ - -f org-html-export-to-html + -f org-html-export-to-html mv ${local_html} ${DOCS} } #+end_src The main function of the script. - + #+begin_src bash :noweb yes function main() { - - [[ check_preconditions ]] \ - || exit 1 - + + check_preconditions || exit 1 + # Install htmlize if needed - [[ install_htmlize ]] \ - || exit 2 + install_htmlize || exit 2 # Create documentation cd ${SRC} \ diff --git a/tools/build_doc.sh b/tools/build_doc.sh index 6eede96..7b91389 100755 --- a/tools/build_doc.sh +++ b/tools/build_doc.sh @@ -5,12 +5,12 @@ # :END: # First define readonly global variables. - + readonly DOCS=${QMCKL_ROOT}/docs/ readonly SRC=${QMCKL_ROOT}/src/ readonly HTMLIZE=${DOCS}/htmlize.el -readonly CONFIG_DOC=${QMCKL_ROOT}/tools/config_doc.el +readonly CONFIG_DOC=${QMCKL_ROOT}/tools/config_doc.el readonly CONFIG_TANGLE=${QMCKL_ROOT}/tools/config_tangle.el @@ -34,7 +34,7 @@ function check_preconditions() exit 2 fi done - + for file in ${CONFIG_DOC} ${CONFIG_TANGLE} do if [[ ! -f ${file} ]] @@ -55,7 +55,7 @@ function install_htmlize() { local url="https://github.com/hniksic/emacs-htmlize" local repo="emacs-htmlize" - + [[ -f ${HTMLIZE} ]] || ( cd ${DOCS} git clone ${url} \ @@ -77,8 +77,8 @@ function install_htmlize() function extract_doc() { local org=$1 - local local_html=${SRC}/${org%.org}.html - local html=${DOCS}/${org%.org}.html + local local_html=${SRC}/${org%.org}.html + local html=${DOCS}/${org%.org}.html if [[ -f ${html} && ${org} -ot ${html} ]] then @@ -89,7 +89,7 @@ function extract_doc() --load ${CONFIG_DOC} \ ${org} \ --load ${CONFIG_TANGLE} \ - -f org-html-export-to-html + -f org-html-export-to-html mv ${local_html} ${DOCS} } @@ -100,13 +100,11 @@ function extract_doc() function main() { - - [[ check_preconditions ]] \ - || exit 1 - + + check_preconditions || exit 1 + # Install htmlize if needed - [[ install_htmlize ]] \ - || exit 2 + install_htmlize || exit 2 # Create documentation cd ${SRC} \ diff --git a/tools/create_makefile.sh b/tools/create_makefile.sh index f6e8951..7c15a48 100755 --- a/tools/create_makefile.sh +++ b/tools/create_makefile.sh @@ -85,7 +85,7 @@ shared_lib=\$(QMCKL_ROOT)/lib/libqmckl.so static_lib=\$(QMCKL_ROOT)/lib/libqmckl.a qmckl_h=\$(QMCKL_ROOT)/include/qmckl.h qmckl_f=\$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90 -munit=\$(QMCKL_ROOT)/munit/munit.c +munit=\$(QMCKL_ROOT)/munit/munit.c shared: \$(shared_lib) static: \$(static_lib)