forked from plumed/plumed2
/
extract
executable file
·106 lines (101 loc) · 3.15 KB
/
extract
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#! /usr/bin/env bash
cat ../src/*/*cpp |
awk '
/PLUMED_REGISTER_ACTION/{print}
/namespace/{print}
' |
sed '
s/PLUMED_REGISTER_ACTION(/ /
s/,"/ /
s/")//
' |
awk '
/namespace/{
if($1=="namespace"){
namespace=$2;
gsub("{","",namespace);
namespace=namespace"::";
}
if(namespace=="PLMD::") namespace="";
next;
}
{
printf("%s","\\class PLMD::"namespace""$1"\n");
printf("%s","\\ingroup INPUTDIRECTIVES\n");
action=tolower($2);
firstchar=substr($2,1,1);
n=split(action,actionarray,"");
lowercase=0;
if(firstchar==actionarray[1]) lowercase=1;
printf("%s","\\brief Provides the keyword <a href=\"../../user-doc/html/");
for(i=1;i<=n;i++){
if(actionarray[i]!="_") printf("_");
printf("%s",actionarray[i]);
};
printf("%s",".html\"> "$2" </a>\n");
}' > links-to-user-manual.md
cat ../src/maketools/plumedcheck | grep "# DOC:" |
awk '
{
sub("# DOC:","");
if($0~"^ *:..*: *"){
print ""
gsub(":","_");
print
print ""
} else print $0
}' > plumedcheck.md
# Create a directory to put all the files in
#rm -rf automatic
#mkdir automatic
#
#cp ../src/*{.h,.cpp} automatic
#for file in ../src/*.cpp ; do
# stripf=`echo $file | sed -e 's/..\/src\///g'`
# ofile=`echo automatic/$stripf`
# echo $ofile
# cat $file |
# awk -v output=$ofile -v inside=0 '{
# if(inside==2 && NF==0){
# inside=1
# if(lowercase==0){
# printf("%s","///To view the user manual <a href=\"../../user-doc/html/") >> output
# for(i=1;i<=n;i++){ printf("_%s", actionarray[i]) >> output }
# print ".html\"> click here </a>." >> output
# } else {
# printf("%s","///To view the user manual <a href=\"../../user-doc/html/") >> output
# printf("%s",action) >> output
# print ".html\"> click here </a>." >> output
# }
# }
# if(inside==2 && $1!="/**" && $1!="*/" && $1!="//+ENDPLUMEDOC"){
# print "///" $0 >> output
# }
# if($1=="//+PLUMEDOC"){
# inside=2
# action=tolower($3)
# firstchar=substr($3, 1, 1 )
# n=split(action,actionarray,"");
# lowercase=0
# if( firstchar==actionarray[1] ) lowercase=1
# }
# if(inside==0){
# print $0 >> output
# }
# if($1=="//+ENDPLUMEDOC" && inside==1){
# inside=0
# }
# if($1=="//+ENDPLUMEDOC" && inside==2){
# inside=0
# if(lowercase==0){
# printf("%s","///To view the more detailed manual <a href=\"../../user-doc/html/") >> output
# for(i=1;i<=n;i++){ printf("_%s", actionarray[i]) >> output }
# print ".html\"> click here </a>." >> output
# } else {
# printf("%s","///To view the more detailed manual <a href=\"../../user-doc/html/") >> output
# printf("%s",action) >> output
# print ".html\"> click here </a>." >> output
# }
# }
# }'
# done