diff --git a/docs/_static/cp2k_manual_logo.png b/docs/_static/cp2k_manual_logo.png deleted file mode 120000 index 3d06c1f62f..0000000000 --- a/docs/_static/cp2k_manual_logo.png +++ /dev/null @@ -1 +0,0 @@ -../../tools/manual/cp2k_manual_logo.png \ No newline at end of file diff --git a/docs/_static/cp2k_manual_logo.png b/docs/_static/cp2k_manual_logo.png new file mode 100644 index 0000000000..ce4e6a04d0 Binary files /dev/null and b/docs/_static/cp2k_manual_logo.png differ diff --git a/tools/manual/cp2k_manual_logo.svg b/docs/_static/cp2k_manual_logo.svg similarity index 100% rename from tools/manual/cp2k_manual_logo.svg rename to docs/_static/cp2k_manual_logo.svg diff --git a/docs/_static/favicon.png b/docs/_static/favicon.png deleted file mode 120000 index a373300268..0000000000 --- a/docs/_static/favicon.png +++ /dev/null @@ -1 +0,0 @@ -../../tools/manual/favicon.png \ No newline at end of file diff --git a/docs/_static/favicon.png b/docs/_static/favicon.png new file mode 100644 index 0000000000..44de66a636 Binary files /dev/null and b/docs/_static/favicon.png differ diff --git a/tools/manual/favicon.svg b/docs/_static/favicon.svg similarity index 100% rename from tools/manual/favicon.svg rename to docs/_static/favicon.svg diff --git a/tools/docker/Dockerfile.test_manual b/tools/docker/Dockerfile.test_manual index fb5fb29057..c6ca807f94 100644 --- a/tools/docker/Dockerfile.test_manual +++ b/tools/docker/Dockerfile.test_manual @@ -80,9 +80,8 @@ COPY ./tests ./tests COPY ./tools/regtesting ./tools/regtesting # Generate manual. -COPY ./tools/manual ./tools/manual -COPY ./tools/input_editing ./tools/input_editing COPY ./docs ./docs +COPY ./tools/input_editing ./tools/input_editing COPY ./tools/docker/scripts/test_manual.sh . ARG ADD_EDIT_LINKS=yes RUN ./test_manual.sh "${ADD_EDIT_LINKS}" 2>&1 | tee report.log diff --git a/tools/docker/generate_dockerfiles.py b/tools/docker/generate_dockerfiles.py index dd9605a126..ed226c7cd9 100755 --- a/tools/docker/generate_dockerfiles.py +++ b/tools/docker/generate_dockerfiles.py @@ -230,9 +230,8 @@ def manual() -> str: install_cp2k(version="psmp", arch="local", revision=True) + rf""" # Generate manual. -COPY ./tools/manual ./tools/manual -COPY ./tools/input_editing ./tools/input_editing COPY ./docs ./docs +COPY ./tools/input_editing ./tools/input_editing COPY ./tools/docker/scripts/test_manual.sh . ARG ADD_EDIT_LINKS=yes RUN ./test_manual.sh "${{ADD_EDIT_LINKS}}" 2>&1 | tee report.log diff --git a/tools/manual/README b/tools/manual/README deleted file mode 100644 index 2be4ce4159..0000000000 --- a/tools/manual/README +++ /dev/null @@ -1,14 +0,0 @@ -A CP2K input description can be generated automatically by - -(1) running any up-to-date CP2K executable with the --xml flag - to generate the XML database file cp2k_input.xml with the - CP2K input description: - - /cp2k. --xml - -(2) creating a HTML document from the XML dump based on an - XSL description, e.g. using Xalan: - - ./xml2htm - -Please, check xml2htm for further details. diff --git a/tools/manual/collapsibleList.js b/tools/manual/collapsibleList.js deleted file mode 100644 index 77cb75ba51..0000000000 --- a/tools/manual/collapsibleList.js +++ /dev/null @@ -1,245 +0,0 @@ -/***************************************************************************************************************** - Automatic collapsible list generation script written by Mark Wilton-Jones - 2002 -Version 3.0 - updated May 2004 to allow cookies to remember the collapse state - fully compatible with original script -****************************************************************************************************************** - -Please see http://www.howtocreate.co.uk/jslibs/ for details and a demo of this script -Please see http://www.howtocreate.co.uk/jslibs/termsOfUse.html for terms of use -_________________________________________________________________________ - -You can put as lists on the page as you like, each list may have a different format - -To use: -_________________________________________________________________________ - -Inbetween the tags, put: - - - -If you want to be able to remember the expand/collapse state of all the branches so that it remains -open if you open a new page or return to the page, you will also need to include my cookie script -(available from http://www.howtocreate.co.uk/jslibs/) - - -_________________________________________________________________________ - -For best results, all images should be the same height, slightly taller than -the text around them. I would recommend about 21px. - -Now, wherever you want the list (not in a layer or positioned element due -to Netscape 4 style bug), put: - - - -_________________________________________________________________________ - -To trigger saving of expand/collapse state of all branches in all lists where you have specified a cookie name, use: - - saveCollapseState(lifeTime) - -lifeTime is optional (defaults to browser session) and specifies the amount of time (in seconds) -to remember the expand/collapse state of all branches - -Usually, this would be used onunload, eg. - -******************************************************************************************************* - And here's the actual code -******************************************************************************************************/ - -window.collapsibleListRef = []; window.imageCache = []; window.autoCloseRef = []; -//iCab can change display, but does not say so, and does notunderstand '' so I use a browser detect -var is_Icab = window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1; - -function collapsibleList() { - //hold tree information about the list and the images used - this.treeImg = arguments[0]; - this.expdImg = arguments[1]; - this.isAutoClose = arguments[2]; - this.subClass = arguments[3]; - this.sub = []; -} - -function sub() { - //hold information about the list item - this.text = arguments[0]; - this.expanded = arguments[1]; - this.sub = []; -} - -//done because WebTV does not understand inline object syntax -function ColLexPdOb(plI,miI,oSv,oAc) { this.plI = plI; this.miI = miI; this.subs = []; this.saveName = oSv; this.autoCol = oAc; } -function ColLexPdIT(name,expanded) { this.name = name; this.expanded = expanded; } - -function createList(listObject,currentExt,imgExt,oLev,oBase) { - if( !currentExt || !currentExt.match(/^treeList_\d+(_\d+)+$/) ) { - //create the list, start by defining aditional stuff that is required, counting the lists etc. - window.collapsibleListRef[window.collapsibleListRef.length] = new ColLexPdOb( listObject.expdImg[4], listObject.expdImg[5], currentExt, listObject.isAutoClose ); - currentExt = 'treeList_'+( window.collapsibleListRef.length - 1 ); imgExt = ''; oLev = 0; oBase = listObject; - document.write( '

' ); - oBase.menuUniqueNum = window.collapsibleListRef.length - 1; window.autoCloseRef[oBase.menuUniqueNum] = []; - } - document.write( '' ); - for( var x = 0; x < listObject.sub.length; x++ ) { - //for every child object, create their line - document.write( - //the line break on all except the very first line - ( ( oLev || x ) ? '\n
' : '' ) + - //what may or may not remain of the trunk - ( ( oBase.subClass && oBase.subClass[oLev] && oBase.subClass[oLev][listObject.sub[x].sub.length?1:0] && !( document.layers && navigator.mimeTypes['*'] ) ) ? ( '' ) : '' ) + imgExt + - //this branch - ( oLev ? '' + ( ( x < listObject.sub.length - 1 ) ? '|-' : '`-' ) + '' : '' ) + - //the expand / collapse link or not as the case may be - ( listObject.sub[x].sub.length ? '[+/-] ' : '----- ' ) + - //the text of the branch - listObject.sub[x].text + ( ( oBase.subClass && oBase.subClass[oLev] && oBase.subClass[oLev][listObject.sub[x].sub.length?1:0] && !( document.layers && navigator.mimeTypes['*'] ) ) ? '' : '' ) - ); - if( listObject.sub[x].sub.length ) { - //add the span id to a list so we can easily find it and collapse it later - window.collapsibleListRef[window.collapsibleListRef.length - 1].subs[window.collapsibleListRef[window.collapsibleListRef.length - 1].subs.length] = new ColLexPdIT( currentExt + '_' + x, listObject.sub[x].expanded && !oBase.isAutoClose ); - //create children - createList( listObject.sub[x], currentExt + '_' + x, oLev ? ( imgExt + ( ( x < listObject.sub.length - 1 ) ? '| ' : '  ' ) ) : '', oLev + 1, oBase ); - } - } - document.write( '
' ); - if( !oLev ) { - //end the list and prepare to collapse as soon as the browser lays it out - document.write( '

\n' ); - if( document.all || document.getElementById ) { window.setTimeout('prepareForUse('+(window.collapsibleListRef.length-1)+')',100); } - } -} - -function expandList(spanName,imgName,plsImg,minImg,oMenu,oLevel,oAutoClose) { - var theSpan = document.getElementById ? document.getElementById(spanName) : document.all ? document.all[spanName] : (new Object()); - if( !theSpan ) { return; } if( theSpan.style ) { theSpan = theSpan.style; } - if( typeof( theSpan.display ) == 'undefined' && !is_Icab ) { - //if we could not access the span element or if its display style cannot be changed, say so - window.alert( 'Sorry, your browser cannot collapse or expand these lists\nso the lists will remain constantly expanded.' ); - } else { - //if required, collapse back down again - for( var y = window.autoCloseRef[oMenu].length - 1; y >= oLevel; y-- ) { - if( window.autoCloseRef[oMenu][y] && oAutoClose && window.autoCloseRef[oMenu][y][0] != spanName ) { - var theSpan2 = document.getElementById ? document.getElementById(window.autoCloseRef[oMenu][y][0]) : document.all ? document.all[window.autoCloseRef[oMenu][y][0]] : (new Object()); - if( theSpan2.style ) { theSpan2 = theSpan2.style; } theSpan2.display = 'none'; - document.images[window.autoCloseRef[oMenu][y][1]].src = window.autoCloseRef[oMenu][y][2]; - window.autoCloseRef[oMenu][y] = null; - } - } - if( theSpan.display == 'none' ) { window.autoCloseRef[oMenu][oLevel] = [spanName,imgName,plsImg]; } - //expand / collapse the list and change the image - theSpan.display = ( theSpan.display == 'none' ) ? ( is_Icab ? 'inline' : '' ) : 'none'; - document.images[imgName].src = theSpan.display ? plsImg : minImg; - } -} - -function prepareForUse(listNum) { - if( !window.collapsibleListRef[listNum].subs.length ) { return; } //no branches to collapse - var lastPart = window.collapsibleListRef[listNum].subs[window.collapsibleListRef[listNum].subs.length - 1].name; - lastPart = document.getElementById ? document.getElementById(lastPart) : document.all[lastPart]; - //if the page has not loaded enough, try again later - if( !lastPart ) { window.setTimeout('prepareForUse('+listNum+')',100); } else { - //if their browser cannot change the display style, don't try - if( lastPart.style ) { lastPart = lastPart.style; } - if( typeof( lastPart.display ) == 'undefined' && !is_Icab ) { return; } - //cache images for faster changes - window.imageCache[listNum] = [(new Image()),(new Image())]; - window.imageCache[listNum][0].src = window.collapsibleListRef[listNum].plI; - window.imageCache[listNum][1].src = window.collapsibleListRef[listNum].miI; - var svNm; if( svNm = window.collapsibleListRef[listNum].saveName ) { svNm = retrieveCookie(svNm); } - if( typeof( svNm ) == 'string' ) { svNm = svNm.split(','); } - for( var x = 0; x < window.collapsibleListRef[listNum].subs.length; x++ ) { - var lastPart = window.collapsibleListRef[listNum].subs[x]; - if( svNm ) { var thisArray = mwjInArray(lastPart.name,svNm); } - if( ( svNm && thisArray ) || ( !svNm && lastPart.expanded ) ) { - //if they want it expanded by default, just change the image - document.images[lastPart.name + '_img'].src = window.imageCache[listNum][1].src; - } else { - //collapse the branch and change the image - document.images[lastPart.name + '_img'].src = window.imageCache[listNum][0].src; - lastPart = document.getElementById ? document.getElementById(lastPart.name) : document.all[lastPart.name]; - if( lastPart.style ) { lastPart = lastPart.style; } - lastPart.display = 'none'; - } - } - } -} - -function mwjInArray(oNeed,oHay) { for( var i = 0; i < oHay.length; i++ ) { if( oNeed == oHay[i] ) { return true; } } return false; } - -function saveCollapseState(oLife) { - var allSpans = document.getElementsByTagName ? document.getElementsByTagName('span') : ( document.all ? document.all.tags('SPAN') : [] ); - if( !allSpans.length ) { return; } //nothing to save - //try to minimise the number of comparisons, to save processor time - for( var x = 0, saveNums = ''; window.collapsibleListRef[x]; x++ ) { - if( !window.collapsibleListRef[x].autoCol && window.collapsibleListRef[x].saveName ) { saveNums += ( saveNums ? '|' : '' ) + x; } } - if( !saveNums ) { return; } //nothing to save - for( var x = 0, brnch = [], frNm, rgxp = new RegExp('^treeList_('+saveNums+')_.*$',''); x < allSpans.length; x++ ) { - if( allSpans[x].id && allSpans[x].id.match(rgxp) && allSpans[x].style.display != 'none' ) { - frNm = allSpans[x].id.replace(rgxp,'$1'); - brnch[frNm] = ( brnch[frNm] ? ( brnch[frNm] + ',' ) : '' ) + allSpans[x].id; - } - } - for( var x = 0, saveNums = ''; window.collapsibleListRef[x]; x++ ) { - if( window.collapsibleListRef[x].saveName ) { setCookie(window.collapsibleListRef[x].saveName,brnch[x],oLife,'/'); } } -} diff --git a/tools/manual/cp2k_input.xsl b/tools/manual/cp2k_input.xsl deleted file mode 100644 index 935cfa44af..0000000000 --- a/tools/manual/cp2k_input.xsl +++ /dev/null @@ -1,849 +0,0 @@ - - - - - - - - - - - - - - CP2K input reference - - - - - - - -

CP2K input reference

-

Version information

-

- This HTML manual refers to - - () - - and was generated automatically from a CP2K executable compiled on using the - --xml command line option (see how to generate this manual). - Thus the manual describes exactly this version of the code. -

-

- -

-

Journal papers

-

- List of references cited in the CP2K input manual. -

-

CP2K units

-

- Available units of measurement which can be used in the CP2K input for keyword values. - The units can be used to specify an alternative unit of measurement for keyword values, for which a - default unit has been explicitly defined. - They are specified in the form of a string [unit] as a separate token before any value. - A unit specification is applied to all values on the same line following that specification, unless explicitly - overwritten by a another unit specification. -

-

Internal input preprocessor

-

- Before the input is parsed, the input is run through a simple internal preprocessor. - The preprocessor recognizes the following directives independent of capitalization: -

-
-
@INCLUDE 'filename.inc'
-
- The file referenced by filename.inc is included into the input file and parsed. - Recursive inclusions are not allowed and the files have to exist in the current working - directory. There can be only one @INCLUDE statement per line. Single or double quotes - have to be used if the filename contains blanks. -
-
@SET VAR value
-
- Assigns the text value to the preprocessing variable VAR. value - is the text following VAR with the outer whitespace removed. The variable can be - recalled with a ${VAR} (or $VAR) statement. There can be only one @SET statement per line. - A variable name can only contain alphanumerical characters plus the underscore and must not start with a number. -
-
${VAR} or $VAR
-
- Expand the variable VAR. The text ${VAR} (or $VAR) is replaced - with the value assigned to VAR in the last @SET directive. - There can be multiple variable statements per line. The expansion process is repeated - until no more variables are found. -
-
${VAR-DEFAULT}
-
- Expand the variable VAR if defined. The text ${VAR-DEFAULT} is replaced - with the value assigned to VAR in the last @SET directive if defined, - otherwise with the value specified after the dash - (here: DEFAULT). -
-
@IF / @ENDIF
-
- Conditional block. The text from the @IF line up to the next line with a valid - @ENDIF is skipped, if the expression following @IF resolves to false. - Available expressions are lexical comparisons for equality '==' or inequality '/='. - If none of the two operators are found, a '0' or whitespace resolves to false - while any text resolves to true. @IF/@ENDIF blocks cannot be nested and - cannot span across files. There can be only one test (== or /=) per @IF statement. -
-
-

Input structure

- All sections that can be part of a CP2K input file are shown here with their allowed nestings. - A detailed description of each section and its keywords can be obtained by clicking on the - section links. The links in the detailed descriptions switch back to the corresponding index - entries. In this way a toggling between the index and the detailed description is feasible. -

Index of all input sections

-
    -
  • - Double click on [−] / [+] to shrink or expand all subtrees contained in a section -
  • -
  • - Single click on [−] / [+] to shrink or expand the top level subtree contained in a section -
  • -
-

Last update:

- - - - - - - - - CP2K input file - - - - - - - - -

CP2K input file

-
    -
  • - Input file of CP2K -
  • -
- -
    -
  • - This section cannot be repeated. -
  • -
-
    -

    Subsections

    - - -
      -
    • - -
    • -
    -
    -
-
    -

    Keywords

    -
      -
    • - none -
    • -
    -
- - - - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Back to the main page of this manual - - Input reference of - - -
-
-
- - - -
- - - - - -
- Back to the main page of this manual or the CP2K home page - - (Last update: - ..) -
-
- - -
- - - - -
-
- - - - -
    - - - - - -
  • - -
  • - - - - <xsl:value-of select="replace($local_path,'/',' / ')" /> - - - - - - - - -

    Section

    -
      -
    • - - - - - - Without description, yet. - - - - - -
    • -
    -
      -
    • - Section path: - - - - - - - -
    • -
    -
      -
    • - This section cannot be repeated. -
    • -
    - -
      -
    • - This section cites the following references: - - - [] - -
    • -
    -
    -
      -
    • -

      Subsections

      - - -
        - - - -
      • - -
      • -
        -
      -
      - -
        -
      • - none -
      • -
      -
      -
      -
    • -
    -
      -
    • -

      Keywords

      - - - - - - - - - - - - - - - - - - - -
        -
      • - none -
      • -
      -
      -
      -
    • -
    - -
      -
    • -

      Keyword descriptions

      - - - - - - - - - - - - - - - - - - - - - - - - -
    • -
    -
    - - - - - -
    - - - - -
    -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - & - - - - - - - - - - - - - -  {} ... - -  or a range {}..{} - - - - -
- - - -

- This keyword was removed. - -

-
- -

- This keyword is deprecated. - -

-
- - - - - Without description, yet. - -
- - - -
- - This keyword cannot be repeated - and it expects - - a list of s. - - - precisely one . - - - precisely  s. - -
- - - The lone keyword behaves as a switch to - - .TRUE. - .FALSE. - - - - The lone keyword defaults to - - - - -
- - Default values: - - - - .TRUE. - .FALSE. - - - - - - -
- - Default unit: - - [] - -
- - List of valid keywords: -
    - - -
  • -
    -
    - - - -
    -
    - - - - - - Without description, yet. - - -
    -
    -
  • -
    -
-
- - Alias names for this keyword: - - - - - - - - , - - - -
- - This keyword cites the following references: - - - [] - -
-
-
-
- - - - - - - - / - - - - - - - - - - - - - - - - - - - How to generate the CP2K input reference manual - - - - - - - - -

How to generate the CP2K input reference manual

-
    -
  • - 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: -
      -
    • cp2k.psmp --xml
    • -
    - 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.
    -
  • -
  • - Alternatively, you can also run the script -
      -
    • update_manual local psmp
    • -
    - in the folder cp2k/tools/manual/ which will perform all steps using the CP2K executable cp2k/exe/local/cp2k.psmp. -
  • -
  • - 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! -
  • -
- - - - - -
-
- - - - - - - -  [Edit on GitHub] - - - - - - - - - Supported HTML entities and tags - - - - - - - - -

List of HTML tags supported by CP2K

-

The following HTML tags are supported by CP2K within the input descriptions:

-
    - -
  • - -
  • -
    -
-

Table of HTML entities supported by CP2K

-

The following HTML entities are supported by CP2K within the input descriptions:

- - - - - - - - - - - - - -
NameCodeCharacter
- - - - - -
-
- - - - - -  {} - - - - - - - - - -
diff --git a/tools/manual/cp2k_manual_logo.png b/tools/manual/cp2k_manual_logo.png deleted file mode 100644 index ce4e6a04d0..0000000000 Binary files a/tools/manual/cp2k_manual_logo.png and /dev/null differ diff --git a/tools/manual/favicon.png b/tools/manual/favicon.png deleted file mode 100644 index 44de66a636..0000000000 Binary files a/tools/manual/favicon.png and /dev/null differ diff --git a/tools/manual/generate_sitemap.py b/tools/manual/generate_sitemap.py deleted file mode 100755 index 26c466dc70..0000000000 --- a/tools/manual/generate_sitemap.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import gzip -from os import path -from datetime import datetime - -# Generates a sitemap to guide for search engine crawlers -# See http://www.sitemaps.org for more information. -# -# author: Ole Schuett - - -def main(): - rootdir = "/var/www/cp2k.org/manual/" - - entries = list() - for dirname, subdirs, files in os.walk(rootdir, followlinks=True): - reldir = dirname[len(rootdir) :] - # print('Found directory: %s' % reldir) - for fn in files: - if not fn.lower().endswith(".html"): - continue # skip non-html files - absfn = path.join(dirname, fn) - t = path.getmtime(absfn) - d = datetime.utcfromtimestamp(t) - lastmod = d.strftime("%Y-%m-%dT%H:%M:%SZ") - relfn = path.join(reldir, fn) - entry = "" - entry += "https://manual.cp2k.org/%s" % relfn - entry += "%s" % lastmod - entry += "" - entries.append(entry) - - print("Found %d html-files." % len(entries)) - - fn_out = "sitemap.xml.gz" - f = gzip.open("sitemap.xml.gz", "wt", encoding="utf8") - f.write('\n') - f.write('\n') - f.write("\n".join(entries)) - f.write("\n\n") - f.close() - print("Wrote " + fn_out) - - -# =============================================================================== -main() diff --git a/tools/manual/index.html b/tools/manual/index.html deleted file mode 100644 index 96f34eb8b4..0000000000 --- a/tools/manual/index.html +++ /dev/null @@ -1,200 +0,0 @@ - - - - -CP2K Input Reference Manual - - - - - - -
-

Logo

-
- - -
-
- -
- - - - -
- - -
-
-
- - - - - - - - - - - diff --git a/tools/manual/toggle_folding.js b/tools/manual/toggle_folding.js deleted file mode 100644 index 7be78d05c4..0000000000 --- a/tools/manual/toggle_folding.js +++ /dev/null @@ -1,410 +0,0 @@ -/****** toggle_folding/main - * PURPOSE - * Allow collapsible section tree in CP2K manual - * USAGE - * load this script in the header of the CP2K manual font page or - * the template file. - * - * If javascript is enabled, then the user should see [-] buttons in - * front of all section titles. And: - * - * - Single clicking on a [-]/[+] button folds/unfolds the - * subsection tree - * - Double clicking on a [-]/[+] button folds/unfolds the entire - * subsection tree recursively. - * - * The buttons are defined as HTML elements, and have class name - * "button", and one can change its font and appearance by setting - * the corresponding style for .button in the CSS. - * AUTHOR - * L.Tong - * CREATION DATE - * 2013/11/06 - * MODIFICATION HISTORY - * SOURCE - */ -// add the folding buttons to the manual tree -document.addEventListener('DOMContentLoaded', parse_manual, false); -/*****/ - -/****** toggle_folding/parse_manual - * PURPOSE - * Parses the CP2K manual front page and addes the tree folding - * buttons to section titles - * USAGE - * parse_manual(); - * AUTHOR - * L.Tong - * CREATION DATE - * 2013/11/06 - * MODIFICATION HISTORY - * SOURCE - */ -function parse_manual() { - // find the first element with id "CP2K_INPUT.html" - var root = document.getElementById("CP2K_INPUT.html"); - // the parent element of root is the section title element - var root_section = root.parentNode; - // parse the root_section recursively - add_button_recursively(root_section); - return; -} -/*****/ - -/****f* toggle_folding/add_button_recursively - * PURPOSE - * Recursively adds the tree-folding buttons to a section tree - * Inserts a blank button if a section does not subsections - * USAGE - * add_button_recursively(section) - * INPUTS - * section: the HTML
  • element in the CP2K input list containing - * the section title - * AUTHOR - * L.Tong - * CREATION DATE - * 2013/11/06 - * MODIFICATION HISTORY - * SOURCE - */ -function add_button_recursively(section) { - var button; - var title_element = first_element_child(section); - var subsections = next_element_sibling(section); - var subsection = subsections ? first_element_child(subsections) : null; - // only add button if the subsections are not empty - if (title_element) { - // add button if the subsections are not empty - if (subsection) { - button = make_button("[\u2212]", "toggle"); - section.insertBefore(button, title_element); - } - // otherwise add a blank - else { - button = make_button("\u00a0\u00a0\u00a0", "blank"); - section.insertBefore(button, title_element); - } - } - // do this recursively for all subsections - while (subsection) { - // the element is a section title and only needs parsing if it - // contains an link element with a non-null id - if (first_element_child(subsection).id) { - add_button_recursively(subsection); - // skip the subsections of the subsection - subsection = next_element_sibling(subsection); - } - subsection = next_element_sibling(subsection); - } - return; -} -/*****/ - -/****f* toggle_folding/make_button - * PURPOSE - * Makes a button element, in the form of - * text - * - * If the button is of the type "blank", then it will not be - * clickable, and will have the data-folding set to blank. The blank - * buttons are used as place-holders to keep of section titles - * properly aligned. - * USAGE - * make_button("[-]") - * INPUTS - * text: the text "image" of the button - * type: "toggle" | "blank" - * RETURN VALUE - * a new element representing a button - * AUTHOR - * L.Tong - * CREATION DATE - * 2013/11/06 - * MODIFICATION HISTORY - * SOURCE - */ -function make_button(text, type) { - var button; - var button_text; - button = document.createElement("a"); - button_text = document.createTextNode(text.concat(" ")); - button.appendChild(button_text); - button.className = "button"; - switch (type) { - case "toggle": - // add onclick attribute - button.setAttribute("onclick", "toggle(event)"); - // for recording double click - button.setAttribute("data-dblclick", "nil"); - // for recording the open and closed status - button.setAttribute("data-folding", "open"); - break; - case "blank": - default : - button.setAttribute("data-folding", "blank"); - } - return button; -} -/*****/ - -/****f* toggle_folding/toggle_button - * PURPOSE - * Toggle the button element to open or close status - * Do nothing if the button is blank - * USAGE - * toggle_button(button, "open") - * INPUTS - * button: the element representing button to toggle - * openOrClose: "open" | "close" - * AUTHOR - * L.Tong - * CREATION DATE - * 2013/11/06 - * MODIFICATION HISTORY - * SOURCE - */ -function toggle_button(button, openOrClose) { - if (button.getAttribute("data-folding") === "blank") - return; - if (openOrClose === "open") { - button.setAttribute("data-folding", "open"); - button.innerHTML = button.innerHTML.replace('[+]', '[\u2212]'); - } - else if (openOrClose === "close") { - button.setAttribute("data-folding", "close"); - button.innerHTML = button.innerHTML.replace('[\u2212]', '[+]'); - } - return; -} -/*****/ - -/****f* toggle_folding/toggle - * PURPOSE - * Event interface function for putting functionality for folding and - * unfolding the section trees in CP2K manual. - * - * - single click on the [-] or [+] in front of section headings - * should fold/unfold the subtree corresponding to the section. - * - * - double click on the [-] or [+] in front of section headings - * should fold/unfold the section subtree recursively. - * - * Note that one cannot use ondbclick attribute in HTML togeter with - * onclick, as onclick will always fire first upon the first mouse - * click. This function provides a work-around solution to this - * problem. - * - * The local variable delay controls the interval between the - * double-clicks. - * USAGE - * Set onclick attribute to toggle(event) - * INPUTS - * Mouse clicking event - * AUTHOR - * L.Tong - * CREATION DATE - * 2013/11/06 - * MODIFICATION HISTORY - * SOURCE - */ -function toggle(event) { - var delay = 300; // in milliseconds - var el = event.target; - var section = el.parentNode; - if (el.getAttribute("data-dblclick") === "nil") { - el.setAttribute("data-dblclick", "t"); - setTimeout( - function() { - if (el.getAttribute("data-dblclick") === "t") { - // single click registered - toggle_folding(section, false); - } - el.setAttribute("data-dblclick", "nil"); - }, - delay); - } - else { - el.setAttribute("data-dblclick", "nil"); - // double click registered - toggle_folding(section, true); - } - return; -} -/*****/ - -/****f* toggle_folding/toggle_folding - * PURPOSE - * Toggling folding and unfolding of subsections, recursively if - * asked to. - * USAGE - * toggle_folding(section, recursive) - * INPUTS - * section: the HTML
  • element containing the section title, - * corresponds to the section to be folded/unfolded - * recursive: true | false, whether to do it recursively or not - * AUTHOR - * L.Tong - * CREATION DATE - * 2013/11/06 - * MODIFICATION HISTORY - * SOURCE - */ -function toggle_folding(section, recursive) { - if (! section) - return; - // get the next non-text sibling - var subsections = next_element_sibling(section); - if (! subsections) - return; - var button = first_element_child(section) - if (button.className !== "button") - return; - if (button.getAttribute("data-folding") === "close") - toggle_subtree(section, "open", recursive) - else if (button.getAttribute("data-folding") === "open") - toggle_subtree(section, "close", recursive) - return; -} -/*****/ - -/****f* toggle_folding/toggle_subtree - * PURPOSE - * The main driver function for doing the folding and unfolding of - * subsections - * - * If openOrClose == "open", then open the section tree, and - * recursively open the section trees of the subsections if - * recursive == true. Similarly, openOrClose == "close" closes the - * section tree and recursively so if recursive == true. - * - * This function assumes that: the non-text element where the - * folding function is triggered is always the title of the section. - * The next non-text element should be the list of subsections. All - * one needs to do, therefore, is to hide the subsections, i.e. the - * next non-text element. - * USAGE - * toggle_folding(section, "open", false) - * INPUTS - * section: the HTML
  • element containing the section title, - * corresponds to the section to be folded/unfolded - * openOrClose: "open" | "close" - * recursive: true | false, whether to do it recursively or not - * AUTHOR - * L.Tong - * CREATION DATE - * 2013/11/06 - * MODIFICATION HISTORY - * SOURCE - */ -function toggle_subtree(section, openOrClose, recursive) { - if (! section) - return; - var subsections = next_element_sibling(section); - if (! subsections) - return; - var button = first_element_child(section) - if (button.className !== "button") - return; - if (openOrClose === "open") { - subsections.style.display = ''; - toggle_button(button, "open"); - } - else if (openOrClose === "close") { - subsections.style.display = "none"; - toggle_button(button, "close"); - } - else { - return; - } - // (un)fold recursively - if (recursive) { - var subsection = first_element_child(subsections); - while (subsection) { - // dump(subsection) - if (first_element_child(subsection) && - (first_element_child(subsection).className === "button")) { - toggle_subtree(subsection, openOrClose, true); - subsection = next_element_sibling(subsection); - } - subsection = next_element_sibling(subsection); - } - } - return; -} -/*****/ - -/****f* toggle_folding/first_element_child - * PURPOSE - * find the first non-text (element) child of a HTML element - * USAGE - * child = first_element_child(element) - * INPUTS - * node: the HTML element in question - * RETURN VALUE - * the first non-text child of node - * returns null if node has no children - * AUTHOR - * L.Tong - * CREATION DATE - * 2013/11/06 - * MODIFICATION HISTORY - * SOURCE - */ -function first_element_child(node) { - var el = node.firstChild; - while (el && el.nodeType !== 1) - el = el.nextSibling; - return el; -} -/*****/ - -/****f* toggle_folding/next_element_sibling - * PURPOSE - * find the next non-text (element) sibling of a HTML element - * USAGE - * sibling = next_element_sibling(element) - * INPUTS - * node: the HTML element in question - * RETURN VALUE - * the next non-text (element) sibling of node - * returns null if node is the last element of its parent - * AUTHOR - * L.Tong - * CREATION DATE - * 2013/11/06 - * MODIFICATION HISTORY - * SOURCE - */ -function next_element_sibling(node) { - var el = node.nextSibling; - while (el && el.nodeType !== 1) - el = el.nextSibling; - return el; -} -/*****/ - -/****f* toggle_folding/dump - * PURPOSE - * For debugging. Dumps the contents of a HTML element via alert - * USAGE - * dump(element) - * INPUTS - * element: the HTML element in question - * AUTHOR - * L.Tong - * CREATION DATE - * 2013/11/06 - * MODIFICATION HISTORY - * SOURCE - */ -function dump(element) { - var a = ["Element dump:"]; - for (var k in element) { - if (element.hasOwnProperty(k)) { - a.push(k + ": " + element[k]); - } - } - a.push("HTML: " + element.innerHTML); - alert(a.join('\n')); -} -/*****/ diff --git a/tools/manual/update_manual b/tools/manual/update_manual deleted file mode 100755 index a34df1db78..0000000000 --- a/tools/manual/update_manual +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -cwd=${PWD} -if [[ -z $1 ]]; then - arch=local -else - arch=$1 - shift -fi -if [[ -z $1 ]]; then - version=psmp -else - version=$1 - shift -fi -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=${arch}/${version} -else - mandir=$1 - shift -fi -echo "CP2K manual path: ${mandir}" -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 ${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 deleted file mode 100755 index c7c3b6e7bb..0000000000 --- a/tools/manual/xml2htm +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Provide path to saxon -# Java version from http://sourceforge.net/projects/saxon -export SAXON=${SAXON:-~/bin/saxon9he.jar} - -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 vim.xsl