New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 11120 for NEMO/trunk/doc – NEMO

Changeset 11120 for NEMO/trunk/doc


Ignore:
Timestamp:
2019-06-17T12:14:19+02:00 (5 years ago)
Author:
nicolasmartin
Message:

Modification of the building process with dedicated build sub-folder

Location:
NEMO/trunk/doc
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/doc/manual_build.sh

    r11043 r11120  
    55 
    66## latekmk options 
    7 opts='-shell-escape -quiet -pdf' 
     7opts='-shell-escape -pdf -quiet' 
     8export openout_any='a' 
    89 
    910## Default selection for models 
    1011if   [ "$1" = 'all' ]; then 
    11    models='NEMO SI3 TOP' 
     12    models='NEMO SI3 TOP' 
    1213elif [ "$1" =    '' ]; then 
    13    models='NEMO' 
     14    models='NEMO' 
    1415else 
    15    models=$* 
     16    models=$* 
    1617fi 
    1718 
     
    2425 
    2526## LaTeX installation, find latexmk should be enough 
    26 [ -z $( which latexmk ) ] && { echo 'latexmk binary is not present => QUIT'; exit 2; } 
     27[ -z $( which latexmk ) ] && { echo 'latexmk not installed => QUIT'; exit 2; } 
     28 
     29## Pygments package for syntax highlighting of source code (namelists & snippets) 
     30[ -n "$( ./tools/check_pkg.py pygments )" ] && { echo 'Python pygments is missing => QUIT'; exit 2; } 
    2731 
    2832## Retrieve figures if not already there 
    2933if [ ! -d latex/figures ]; then 
    30    printf "Downloading of shared figures and logos\n\n" 
    31    svn co https://forge.ipsl.jussieu.fr/nemo/svn/utils/figures latex/figures > /dev/null 
     34    printf "Downloading of shared figures and logos\n\n" 
     35    svn co https://forge.ipsl.jussieu.fr/nemo/svn/utils/figures latex/figures > /dev/null 
    3236fi 
    33  
    34 ## Pygments package for syntax highlighting of source code (namelists & snippets) 
    35 [ -n "$( ./tools/check_pkg.py pygments )" ] && { exit 2; } 
    3637 
    3738 
     
    4041 
    4142for model in $models; do 
    42    echo $model 
    43    clean $model; build $model 
    44    printf "\t¤ End of building run\n" 
    45    printf "\t  The export should be available at root\n" 
    46    printf "\t  If not check LaTeX log in ./latex/$model/main/${model}_manual.log\n" 
    47    echo 
     43    echo $model 
     44    clean $model 
     45    build $model 
     46    printf "\t¤ End of building run\n" 
     47    printf "\t  The export should be available at root\n" 
     48    printf "\t  If not check LaTeX log in ./latex/$model/build/${model}_manual.log\n" 
     49    echo 
    4850done 
    4951 
  • NEMO/trunk/doc/tools/shr_func.sh

    r11033 r11120  
    11#!/bin/sh 
    2  
    3  
    4 ## Default options for GNU find (Linux OS) 
    5 find_pre=''; find_suf='-regextype posix-extended' 
    6  
    7 ## Test OS to tweak the options in find command for working in extended mode everywhere 
    8 [ '$( uname )' = 'Darwin' ] && { find_pre='-E'; find_suf=''; } 
    92 
    103clean() { 
    114    ## Not sure if this step is needed, guess latexmk should be able to detect a change 
    12     printf "\t¤ Clean previous build\n" 
    13  
    14     ## Delete temp files from previous build 
    15     printf "\t  - delete all temporary files (.aux, .bbl, ...)\n" 
    16     find ${find_pre} latex/$1 ${find_suf}                                                                \ 
    17                          -regex ".*\.(aux|bbl|blg|dvi|fdb|fls|idx|ilg|ind|log|maf|mtc|out|pdf|toc)" \ 
    18                               -exec rm {} \; 
    19  
    20     ## Remove minted folders 
    21     printf "\t  - remove pygments input hash files (\"_minted\" folders)\n" 
    22     find latex/$1 -type d -name '_minted*' -exec rm -r {} \; 2> /dev/null 
     5    printf "\t¤ Clean previous build" 
     6    find latex/$1/build -mindepth 1 -prune -exec rm -rf {} \; 
    237 
    248    ## HTML exports 
     
    3115build() { 
    3216    printf "\t¤ Generation of the PDF format\n" 
    33     cd latex/$1/main 
    34     latexmk $opts $1'_manual' 1> /dev/null 
    35     [ -f $1'_manual'.pdf ] && mv $1'_manual'.pdf ../../.. 
    36     cd - > /dev/null 
     17    latexmk $opts -outdir=../build -cd ./latex/$1/main/$1_manual 1> /dev/null 
     18    [ -f ./latex/$1/build/$1_manual.pdf ] && mv ./latex/$1/build/$1_manual.pdf . 
     19#    cd - > /dev/null 
    3720    echo 
    3821} 
Note: See TracChangeset for help on using the changeset viewer.