diff --git a/user-doc/Doxyfile b/user-doc/Doxyfile index fdcd5c47715b2c7abb02b77fc52a7797d9d77f5a..7a884face6c60aff15d88b8b1b61eb0a5e1a50cc 100644 --- a/user-doc/Doxyfile +++ b/user-doc/Doxyfile @@ -228,11 +228,17 @@ TAB_SIZE = 8 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = "hidden=\htmlonly <details> <summary> <b> To learn more </b> </summary> <div class=\"hidden\"> \endhtmlonly" \ +ALIASES = \ + "hidden=\htmlonly <details> <summary> <b> To learn more </b> </summary> <div class=\"hidden\"> \endhtmlonly" \ "hidden{1}=\htmlonly <details> <summary> <b> To learn more: \1 </b> </summary> <div class=\"hidden\"> \endhtmlonly" \ "endhidden=\htmlonly </div> </details> \endhtmlonly" \ "issue{1}=<a href=\"http://github.com/plumed/plumed2/issues/\1\">#\1</a>" \ - "branch{1}=<a href=\"http://github.com/plumed/plumed2/commits/\1\">\1</a>" + "branch{1}=<a href=\"http://github.com/plumed/plumed2/commits/\1\">\1</a>" \ + "highlight{1}=\htmlonly<span style=\"background-color:yellow\">\endhtmlonly\1\htmlonly</span>\endhtmlonly" \ + "tarball{1}=<a href=\"tutorial-resources/\1.tar.gz\" style=\"font-weight:bold\" style=\"color:green\" download=\"\1.tar.gz\"> TARBALL </a>" \ + "plumedfile=\verbatim BEGIN_PLUMED_FILE" \ + "endplumedfile=\endverbatim" + # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" diff --git a/user-doc/go-doxygen b/user-doc/go-doxygen index aff6debd19910bff68444c93607381c42a462212..a3d87e2011b130f48246935f1617d58980cec54a 100755 --- a/user-doc/go-doxygen +++ b/user-doc/go-doxygen @@ -36,7 +36,8 @@ awk -v version="$version" '{ print " <li><a href=\"tutorials.html\"><span>Tutorials</span></a></li>" print " <li><a href=\"glossary.html\"><span>Index of Actions</span></a></li>" } else print -}' $file > $file.tmp +}' $file | +awk -f plumed-syntax.awk > $file.tmp mv $file.tmp $file done # end of DOXYGEN <=1.8.10 @@ -51,7 +52,6 @@ var menudata={children:[ EOF # end of DOXYGEN >=1.8.12 - cat html/doxygen.css plumed.css > html/doxygen.css.tmp mv html/doxygen.css.tmp html/doxygen.css diff --git a/user-doc/plumed-syntax.awk b/user-doc/plumed-syntax.awk new file mode 100755 index 0000000000000000000000000000000000000000..7d261bca4f246755b1fed2af9d3650a1508f5b93 --- /dev/null +++ b/user-doc/plumed-syntax.awk @@ -0,0 +1,54 @@ +{ + if(match($0,"BEGIN_PLUMED_FILE")){ + inside=1; + sub("BEGIN_PLUMED_FILE",""); + print; + next; + } + if(inside && match($0,"</pre>")){ + inside=0; + print; + next; + } + if(!inside){ + print; + next; + } + +# DRAFT LINK TO DOC: + copy=$0 + sub("#.*","",copy); + nw=split(copy,words); + if(match(words[1],".*:$")){ + action=words[2]; + } else { + action=words[1]; + } + if(action=="__FILL__") action="" + actionx=""; + for(i=1;i<=length(action);i++){ + letter=substr(action,i,1); + if(match(letter,"[A-Z]")) letter = "_" tolower(letter); + actionx=actionx letter; + } + if(incontinuation) action=""; + if(incontinuation && words[1]=="...") incontinuation=0; + else if(!incontinuation && words[nw]=="...") incontinuation=1; + + if(length(action)>0){ + actionfile="html/" actionx ".html"; + if(getline tmp < actionfile < 0) print "WARNING: file " actionfile " does not exist" > "/dev/stderr"; + else { + p=match($0,action); + $0=substr($0,1,p-1) "<a href=\"./" actionx ".html\" style=\"color:green\">" action "</a>" substr($0,p+length(action)); + } + } + + gsub("__FILL__","<span style=\"background-color:yellow\">__FILL__</span>"); + +# comments: +# sub("#","<span style=\"color:blue\">#"); +# if(match($0,"span style=")) $0=$0 "</span>"; + sub("#.*$","<span style=\"color:blue\">&</span>"); + print +}