diff --git a/tools/manual/cp2k_input.xsl b/tools/manual/cp2k_input.xsl
index ce102dd1aa..cc92d95ef2 100644
--- a/tools/manual/cp2k_input.xsl
+++ b/tools/manual/cp2k_input.xsl
@@ -702,42 +702,27 @@
How to generate the CP2K input reference manual
-
- Prepare a CP2K executable. It does not matter which type of CP2K executable (e.g. sopt) you are using.
+ Prepare a CP2K executable. It does not matter which type of CP2K executable (e.g. psmp) you are using,
+ since running a CP2K executable with the flag --xml like:
+
+ will generate a file named cp2k_input.xml with an XML dump of the entire CP2K input structure
+ in the same directory describing all features of the actual CP2K executable.
+ That XML output in cp2k_input.xml has to be transformed to HTML using an XML 2.0 compliant
+ translator like SAXON. Preferentially, you may want to employ the platform independent Java version of SAXON, which
+ can be downloaded from https://sourceforge.net/projects/saxon.
-
- Run the CP2K executable with the flag --xml like:
+ Alternatively, you can also run the script
- - cp2k.sopt --xml
+ - update_manual local psmp
- which will generate a file named cp2k_input.xml with a XML dump of the CP2K input
- structure in the same directory.
+ in the folder cp2k/tools/manual/ which will perform all steps using the CP2K executable cp2k/exe/local/cp2k.psmp.
-
- Copy the XSLT file cp2k_input.xsl from cp2k/tools/manual/ to
- your working directory, if needed.
-
- -
- Transform the XML output in cp2k_input.xml to HTML using a XML 2.0 compliant
- translator like SAXON.
- If you have the SAXON package already installed, then just run:
-
- - saxon -o index.html cp2k_input.xml cp2k_input.xsl
-
- Alternatively, you may employ the platform independent Java version of SAXON
-
- - java -jar saxon8.jar -o index.html cp2k_input.xml cp2k_input.xsl
-
- which can be downloaded from
- https://sourceforge.net/projects/saxon.
- The latter choice might be more convenient, if you have the Java Runtime Environment 1.5 or higher installed anyway.
- You may check your installed Java version with:
-
-
- -
- Launch your favorite web browser and load the index.html file generated in the
- previous step.
+ Launch your favorite web browser and load the generated index.html file, e.g. in cp2k/tools/manual/local/psmp
+ from the previous step.
-
Happy browsing!
diff --git a/tools/manual/update_manual b/tools/manual/update_manual
index c01ef0337e..204ee1ec81 100755
--- a/tools/manual/update_manual
+++ b/tools/manual/update_manual
@@ -1,38 +1,42 @@
#!/bin/sh
-echo Update CP2K manual:
+cwd=${PWD}
if [[ -z $1 ]]; then
- if [[ -z ${regtest} ]]; then
- arch=Linux-x86-64-${FORT_C_NAME}
- else
- arch=Linux-x86-64-${FORT_C_NAME}-regtest
- fi
+ arch=local
else
arch=$1
shift
fi
if [[ -z $1 ]]; then
- version=pdbg
+ version=psmp
else
version=$1
shift
fi
-cp2kexe=../../exe/${arch}/cp2k.${version}
-echo "CP2K executable: ${cp2kexe}"
+cp2kexe=${cwd}/../../exe/${arch}/cp2k.${version}
+echo "CP2K executable: ${cp2kexe}"
+version_string=$(${cp2kexe} -v | head -1)
+if [[ -n $(echo ${version_string} | grep Development) ]]; then
+ version_string=trunk
+else
+ version_string=$(echo "${version_string}" | awk '{print $3}')
+fi
+echo Update CP2K manual: ${version_string}
if [[ -z $1 ]]; then
- mandir=
+ mandir=${arch}/${version}
else
mandir=$1
shift
fi
echo "CP2K manual path: ${mandir}"
-rm -rf cp2k_input.xml CP2K_INPUT.html index.html references.html units.html generate_manual_howto.html html_tables.html cp2k.vim CP2K_INPUT/
if [[ -s ${cp2kexe} ]]; then
+ [[ -d ${mandir} ]] && rm -rf ${mandir}
+ mkdir -p ${mandir}
+ cp collapsibleList.js cp2k_input.xsl cp2k_manual_logo.png cp2k_manual_logo.svg favicon.png favicon.svg toggle_folding.js xml2htm ../input_editing/vim/vim.xsl ${mandir}
+ cd ${mandir}
${cp2kexe} --xml
- ./xml2htm
- if [[ -n ${mandir} ]]; then
- scp -r cp2k.vim toggle_folding.js cp2k_input.xsl cp2k_input.xml CP2K_INPUT.html html_tables.html index.html references.html units.html generate_manual_howto.html favicon.png CP2K_INPUT/ ${mandir}
- fi
+ ./xml2htm ${version_string}
echo "CP2K manual update done."
+ cd ${cwd} >/dev/null
else
echo "ERROR in $(basename $0): CP2K executable file ${cp2kexe} not found"
fi
diff --git a/tools/manual/xml2htm b/tools/manual/xml2htm
index ee4f030221..80a9a8a7eb 100755
--- a/tools/manual/xml2htm
+++ b/tools/manual/xml2htm
@@ -2,7 +2,10 @@
# Provide path to saxon
# Java version from http://sourceforge.net/projects/saxon
export SAXON=~/bin/saxon9he.jar
-version=$(basename ${PWD%/cp2k/tools/manual})
-java -Xmx256m -jar $SAXON -o:index.html cp2k_input.xml cp2k_input.xsl add_edit_links=no version=${version}
+if [[ -z $1 ]]; then
+ java -Xmx256m -jar $SAXON -o:index.html cp2k_input.xml cp2k_input.xsl add_edit_links=no
+else
+ java -Xmx256m -jar $SAXON -o:index.html cp2k_input.xml cp2k_input.xsl add_edit_links=no version=$1
+fi
# Update the CP2K syntax file for the (g)vim editor
-java -Xmx256m -jar $SAXON -o:cp2k.vim cp2k_input.xml ../input_editing/vim/vim.xsl
+java -Xmx256m -jar $SAXON -o:cp2k.vim cp2k_input.xml vim.xsl