1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-07-22 02:43:51 +02:00

Fix htmlize

This commit is contained in:
Anthony Scemama 2021-04-21 13:17:33 +02:00
parent 59d56f6b27
commit 8882b4b3d4
4 changed files with 29 additions and 33 deletions

View File

@ -116,7 +116,7 @@ clean:
- $(RM) test_qmckl_* test_qmckl.c \ - $(RM) test_qmckl_* test_qmckl.c \
$(qmckl_h) $(qmckl_f) \ $(qmckl_h) $(qmckl_f) \
qmckl_*.f90 qmckl_*.c qmckl_*.h \ qmckl_*.f90 qmckl_*.c qmckl_*.h \
Makefile.generated *.html Makefile.generated *.html
Makefile.generated: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURCE_FILES) Makefile.generated: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURCE_FILES)
$(QMCKL_ROOT)/tools/create_makefile.sh $(QMCKL_ROOT)/tools/create_makefile.sh

View File

@ -69,7 +69,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#+begin_src makefile #+begin_src makefile
# <<header()>> # <<header()>>
.POSIX: .POSIX:
#+end_src #+end_src
** Dependencies ** Dependencies
@ -188,7 +188,7 @@ clean:
- $(RM) test_qmckl_* test_qmckl.c \ - $(RM) test_qmckl_* test_qmckl.c \
$(qmckl_h) $(qmckl_f) \ $(qmckl_h) $(qmckl_f) \
qmckl_*.f90 qmckl_*.c qmckl_*.h \ qmckl_*.f90 qmckl_*.c qmckl_*.h \
Makefile.generated *.html Makefile.generated *.html
Makefile.generated: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURCE_FILES) Makefile.generated: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURCE_FILES)
$(QMCKL_ROOT)/tools/create_makefile.sh $(QMCKL_ROOT)/tools/create_makefile.sh
@ -325,7 +325,7 @@ shared_lib=\$(QMCKL_ROOT)/lib/libqmckl.so
static_lib=\$(QMCKL_ROOT)/lib/libqmckl.a static_lib=\$(QMCKL_ROOT)/lib/libqmckl.a
qmckl_h=\$(QMCKL_ROOT)/include/qmckl.h qmckl_h=\$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=\$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90 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) shared: \$(shared_lib)
static: \$(static_lib) static: \$(static_lib)
@ -489,13 +489,13 @@ EOF
:END: :END:
First define readonly global variables. First define readonly global variables.
#+begin_src bash :noweb yes #+begin_src bash :noweb yes
readonly DOCS=${QMCKL_ROOT}/docs/ readonly DOCS=${QMCKL_ROOT}/docs/
readonly SRC=${QMCKL_ROOT}/src/ readonly SRC=${QMCKL_ROOT}/src/
readonly HTMLIZE=${DOCS}/htmlize.el 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 readonly CONFIG_TANGLE=${QMCKL_ROOT}/tools/config_tangle.el
#+end_src #+end_src
Check that all the defined global variables correspond to files. Check that all the defined global variables correspond to files.
@ -517,7 +517,7 @@ function check_preconditions()
exit 2 exit 2
fi fi
done done
for file in ${CONFIG_DOC} ${CONFIG_TANGLE} for file in ${CONFIG_DOC} ${CONFIG_TANGLE}
do do
if [[ ! -f ${file} ]] if [[ ! -f ${file} ]]
@ -537,7 +537,7 @@ function install_htmlize()
{ {
local url="https://github.com/hniksic/emacs-htmlize" local url="https://github.com/hniksic/emacs-htmlize"
local repo="emacs-htmlize" local repo="emacs-htmlize"
[[ -f ${HTMLIZE} ]] || ( [[ -f ${HTMLIZE} ]] || (
cd ${DOCS} cd ${DOCS}
git clone ${url} \ git clone ${url} \
@ -558,8 +558,8 @@ function install_htmlize()
function extract_doc() function extract_doc()
{ {
local org=$1 local org=$1
local local_html=${SRC}/${org%.org}.html local local_html=${SRC}/${org%.org}.html
local html=${DOCS}/${org%.org}.html local html=${DOCS}/${org%.org}.html
if [[ -f ${html} && ${org} -ot ${html} ]] if [[ -f ${html} && ${org} -ot ${html} ]]
then then
@ -570,23 +570,21 @@ function extract_doc()
--load ${CONFIG_DOC} \ --load ${CONFIG_DOC} \
${org} \ ${org} \
--load ${CONFIG_TANGLE} \ --load ${CONFIG_TANGLE} \
-f org-html-export-to-html -f org-html-export-to-html
mv ${local_html} ${DOCS} mv ${local_html} ${DOCS}
} }
#+end_src #+end_src
The main function of the script. The main function of the script.
#+begin_src bash :noweb yes #+begin_src bash :noweb yes
function main() { function main() {
[[ check_preconditions ]] \ check_preconditions || exit 1
|| exit 1
# Install htmlize if needed # Install htmlize if needed
[[ install_htmlize ]] \ install_htmlize || exit 2
|| exit 2
# Create documentation # Create documentation
cd ${SRC} \ cd ${SRC} \

View File

@ -5,12 +5,12 @@
# :END: # :END:
# First define readonly global variables. # First define readonly global variables.
readonly DOCS=${QMCKL_ROOT}/docs/ readonly DOCS=${QMCKL_ROOT}/docs/
readonly SRC=${QMCKL_ROOT}/src/ readonly SRC=${QMCKL_ROOT}/src/
readonly HTMLIZE=${DOCS}/htmlize.el 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 readonly CONFIG_TANGLE=${QMCKL_ROOT}/tools/config_tangle.el
@ -34,7 +34,7 @@ function check_preconditions()
exit 2 exit 2
fi fi
done done
for file in ${CONFIG_DOC} ${CONFIG_TANGLE} for file in ${CONFIG_DOC} ${CONFIG_TANGLE}
do do
if [[ ! -f ${file} ]] if [[ ! -f ${file} ]]
@ -55,7 +55,7 @@ function install_htmlize()
{ {
local url="https://github.com/hniksic/emacs-htmlize" local url="https://github.com/hniksic/emacs-htmlize"
local repo="emacs-htmlize" local repo="emacs-htmlize"
[[ -f ${HTMLIZE} ]] || ( [[ -f ${HTMLIZE} ]] || (
cd ${DOCS} cd ${DOCS}
git clone ${url} \ git clone ${url} \
@ -77,8 +77,8 @@ function install_htmlize()
function extract_doc() function extract_doc()
{ {
local org=$1 local org=$1
local local_html=${SRC}/${org%.org}.html local local_html=${SRC}/${org%.org}.html
local html=${DOCS}/${org%.org}.html local html=${DOCS}/${org%.org}.html
if [[ -f ${html} && ${org} -ot ${html} ]] if [[ -f ${html} && ${org} -ot ${html} ]]
then then
@ -89,7 +89,7 @@ function extract_doc()
--load ${CONFIG_DOC} \ --load ${CONFIG_DOC} \
${org} \ ${org} \
--load ${CONFIG_TANGLE} \ --load ${CONFIG_TANGLE} \
-f org-html-export-to-html -f org-html-export-to-html
mv ${local_html} ${DOCS} mv ${local_html} ${DOCS}
} }
@ -100,13 +100,11 @@ function extract_doc()
function main() { function main() {
[[ check_preconditions ]] \ check_preconditions || exit 1
|| exit 1
# Install htmlize if needed # Install htmlize if needed
[[ install_htmlize ]] \ install_htmlize || exit 2
|| exit 2
# Create documentation # Create documentation
cd ${SRC} \ cd ${SRC} \

View File

@ -85,7 +85,7 @@ shared_lib=\$(QMCKL_ROOT)/lib/libqmckl.so
static_lib=\$(QMCKL_ROOT)/lib/libqmckl.a static_lib=\$(QMCKL_ROOT)/lib/libqmckl.a
qmckl_h=\$(QMCKL_ROOT)/include/qmckl.h qmckl_h=\$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=\$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90 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) shared: \$(shared_lib)
static: \$(static_lib) static: \$(static_lib)