Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
GOSI9esm
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Consortium Members
UKMO
GOSI
GOSI9esm
Commits
ae2feae6
Commit
ae2feae6
authored
3 years ago
by
Tomas Lovato
Browse files
Options
Downloads
Patches
Plain Diff
revise manual_build.sh toward a friendly usability (avoid manual settings)
parent
30f533b7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/manual_build.sh
+77
-6
77 additions, 6 deletions
doc/manual_build.sh
with
77 additions
and
6 deletions
doc/manual_build.sh
+
77
−
6
View file @
ae2feae6
#!/bin/sh
#set -x
# Available manuals
manuals
=
'NEMO SI3 TOP'
# Initialization of the options
x_p
=
''
;
x_r
=
''
# Choice of the options ---
while
getopts
hpr: option
;
do
case
$option
in
(
'h'
)
cat
<<
EOF
Usage:
------
./manual_build.sh [-p] [-r version ] manual
Mandatory
Chose one model manual among
${
manuals
}
or all
Optional
-p Produce manual with figures and disable draft watermark
-r Specify the release version number of the manual(s)
EOF
exit
0
;;
(
'p'
)
x_p
=
0
;
shift
;;
(
'r'
)
x_r
=
${
OPTARG
}
;
shift
2
;;
esac
done
shift
$((
$OPTIND
))
;
VER_NUM
=
${
x_r
}
DRAFT
=
${
x_p
}
CMP_NAM
=
$1
## Initialisation
##---------------
#
#
Default selection for m
odel
s
if
[
"
$
1
"
=
'all'
]
;
then
models
=
'NEMO SI3 TOP'
elif
[
"
$
1
"
=
''
]
;
then
#
M
odel
if
[
"
$
{
CMP_NAM
}
"
=
=
'all'
]
;
then
models
=
"
$manuals
"
elif
[
"
$
{
CMP_NAM
}
"
=
=
''
]
;
then
models
=
'NEMO'
elif
[[
"
${
manuals
}
"
==
*
"
${
CMP_NAM
}
"
*
]]
;
then
models
=
"
${
CMP_NAM
}
"
else
models
=
$*
echo
"No entry for manual
${
CMP_NAM
}
"
exit
fi
# Version
version
=
`
git symbolic-ref
-q
--short
HEAD
||
git describe
--tags
--exact-match
||
"trunk"
`
if
[
"x
${
VER_NUM
}
"
!=
'x'
]
;
then
version
=
${
VER_NUM
}
fi
# Draft mode
ifdraft
=
1
;
draft_opt
=
"using draft mode"
if
[
"x
${
DRAFT
}
"
!=
'x'
]
;
then
ifdraft
=
0
;
draft_opt
=
""
fi
echo
"Compiling
${
models
}
manual(s) at version
${
version
}
${
draft_opt
}
\n
"
# Set version
version
=
`
echo
$version
|
sed
-e
's;_;\\\\\\\_;g'
`
prefile
=
"latex/global/preamble.tex"
sed
-i
''
-e
"s;
\\\d
ef
\\\v
er.*;
\\\d
ef
\\\v
er{
$version
};"
${
prefile
}
# Set draft mode
docfile
=
"latex/global/document.tex"
pkgfile
=
"latex/global/packages.tex"
draft_opt
=
`
grep
draft
$docfile
`
pkg_dft
=
`
grep
draftwatermark
$pkgfile
|
sed
-e
"s;%;;g"
`
if
[
$ifdraft
==
1
]
&&
[
"x
$draft_opt
"
==
"x"
]
;
then
sed
-i
''
-e
"s;,abstract;,abstract,draft;"
$docfile
sed
-i
''
-e
"s;.*draftwatermark.*;
\\
$pkg_dft
;"
$pkgfile
elif
[
$ifdraft
==
0
]
&&
[
"x
$draft_opt
"
!=
"x"
]
;
then
sed
-i
''
-e
"s;abstract,draft;abstract;"
$docfile
sed
-i
''
-e
"s;.*draftwatermark.*;%
\\
$pkg_dft
;"
$pkgfile
fi
# Echo current font path
fontawesome
=
`
grep
defaultfontfeatures latex/global/packages.tex |
sed
-e
's/.*=\(.*\)}/\1/'
`
echo
"Fontawesome path is
$fontawesome
\n
"
# Source shared functions
.
tools/shr_func.sh
...
...
@@ -29,7 +100,7 @@ fi
##-------------------
for
model
in
$models
;
do
echo
$model
echo
"Start compiling manual for
$model
"
# clean $model
build
$model
printf
"
\t
¤ End of building run
\n
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment