meso-web

Sources of the |Méso|Star> website
git clone git://git.meso-star.fr/meso-web.git
Log | Files | Refs | README | LICENSE

commit 760707f39d4ee1b8a7b810d3c29fbef0574d8515
parent 9cefb8896c8ce34f668c679a246a7f1654e2fa87
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 16 Feb 2022 18:59:38 +0100

Full rewrite of how solstice web pages are built

Rely on POSIX make a POSIX shells. It was actually a test to validate
this build process for the whole web site.

Diffstat:
M.gitignore | 8+++-----
MMakefile | 3++-
Acheck_html.sh | 27+++++++++++++++++++++++++++
Aconfig.mk | 20++++++++++++++++++++
Mmeso-menu.sh | 689++++++++++++++++++++++++++++++++++++++++---------------------------------------
Asolstice/.gitignore | 6++++++
Msolstice/Makefile | 159+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
Msolstice/downloads/Solstice-ABG.pdf | 4++--
Msolstice/solstice-abg.html.in | 6+++---
Msolstice/solstice-pp.html.in | 12++++++------
Msolstice/solstice.html.in | 11++++++-----
Dsolstice/solstice.sh | 200-------------------------------------------------------------------------------
Asolstice/solstice_build.sh | 92+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
13 files changed, 658 insertions(+), 579 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -20,11 +20,6 @@ starter-pack.html htrdr-atmosphere-spk.html htrdr-combustion-spk.html pgp_signatures.html -solstice.html -solstice-downloads.html -solstice-resources.html -solstice-release-notes.html.in -solstice-pp-release-notes.html.in star-engine.html star-engine-downloads.html star-engine-release-notes.html.in @@ -39,6 +34,9 @@ star-vx.html *.sw[po] *.[ao] *.sig +*.err *~ +.sigs +.chks tags man diff --git a/Makefile b/Makefile @@ -13,7 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -REMOTE=OVH:www/projects +include config.mk + REMOTE_DIR=/$(shell basename ${REMOTE}) SUBDIRS=art schiff solstice star-engine stardis misc htrdr diff --git a/check_html.sh b/check_html.sh @@ -0,0 +1,27 @@ +#!/bin/sh -e + +# Copyright (C) 2019-2021 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +if [ $# -lt 1 ]; then + echo "Usage: $0 <html>" >&2 + exit 1 +fi + +if ! tidy --show-info no -f "$1.err" -e "$1"; then + printf "%s:\e[1;31merror\e[0m: report in %s.err\n" "$1" "$1" >&2 + cat "$1.err" >& 2 +fi diff --git a/config.mk b/config.mk @@ -0,0 +1,20 @@ +# Copyright (C) 2019-2021 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Markdown command to use +MARKDOWN=markdown_py + +# Remote server where to synchronise data +REMOTE=OVH:www/projects diff --git a/meso-menu.sh b/meso-menu.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -e # Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) # @@ -17,283 +17,285 @@ set -e -solstice_man_pages=( - "solstice 1" - "solstice-input 5" - "solstice-output 5" - "solstice-receiver 5" -) - -schiff_man_pages=( - "schiff 1" - "schiff-geometry 5" - "schiff-output 5" -) - -htrdr_man_pages=( - "atrri 5" - "atrtp 5" - "htmie 5" - "htcp 5" - "htgop 5" - "htpp 1" - "htrdr 1" - "htrdr-atmosphere 1" - "htrdr-combustion 1" - "htrdr-image 5" - "htrdr-materials 5" - "htrdr-obj 5" - "les2htcp 1" - "mrumtl 5" - "sth 5" -) - -stardis_man_pages=( - "stardis 1" - "stardis-input 5" - "stardis-output 5" - "sgreen 1" - "sgreen-input 5" - "sgreen-output 5" -) +export solstice_man_pages="\ + solstice 1 + solstice-input 5 + solstice-output 5 + solstice-receiver 5" + +export schiff_man_pages="\ + schiff 1 + schiff-geometry 5 + schiff-output 5" + +export htrdr_man_pages="\ + atrri 5 + atrtp 5 + htmie 5 + htcp 5 + htgop 5 + htpp 1 + htrdr 1 + htrdr-atmosphere 1 + htrdr-combustion 1 + htrdr-image 5 + htrdr-materials 5 + htrdr-obj 5 + les2htcp 1 + mrumtl 5 + sth 5" + +export stardis_man_pages="\ + stardis 1 + stardis-input 5 + stardis-output 5 + sgreen 1 + sgreen-input 5 + sgreen-output 5" print_home_sub_menu() { - local root=$1 - local name=$2 + root=$1 + name=$2 - echo ' <div id=sub-menu>' - echo ' <ul>' - if [ "$name" == "About" ]; then - echo ' <li id=cur>About</li>' + echo " <div id=\"sub-menu\">" + echo " <ul>" + if [ "${name}" = "About" ]; then + echo " <li id=\"cur\">About</li>" else - echo " <li><a href=${root}misc/about-fr.html>About</a></li>" + echo " <li><a href=\"${root}misc/about-fr.html\">About</a></li>" fi - if [ "$name" == "PGP" ]; then - echo ' <li id=cur>PGP signatures</li>' + if [ "${name}" = "PGP" ]; then + echo " <li id=\"cur\">PGP signatures</li>" else - echo " <li><a href=${root}misc/pgp_signatures.html>PGP signatures</a></li>" + echo " <li><a href=\"${root}misc/pgp_signatures.html\">PGP signatures</a></li>" fi - if [ "$name" == "Legal" ]; then - echo ' <li id=cur>Legal notices</li>' + if [ "${name}" = "Legal" ]; then + echo " <li id=\"cur\">Legal notices</li>" else - echo " <li><a href=${root}misc/legal-fr.html>Legal notices</a></li>" + echo " <li><a href=\"${root}\"misc/legal-fr.html>Legal notices</a></li>" fi - echo ' </ul>' - echo ' </div>' + echo " </ul>" + echo " </div>" } print_art_sub_menu() { - local root=$1 - local name=$2 + root=$1 + name=$2 - echo ' <div id=sub-menu>' - echo ' <ul>' - if [ "$name" == "Overview" ]; then + echo " <div id=\"sub-menu\">" + echo " <ul>" + if [ "${name}" = "Overview" ]; then echo ' <li id=cur>Overview</li>' else - echo " <li><a href=${root}art/art.html>Overview</a></li>" + echo " <li><a href=\"${root}art/art.html\">Overview</a></li>" fi - echo ' <li>Codes</li>' - echo ' <li><ul class=lvl2>' - if [ "$name" == "Kspectrum" ]; then - echo ' <li id=cur>Kspectrum</li>' + echo " <li>Codes</li>" + echo " <li><ul class=\"lvl2\">" + if [ "${name}" = "Kspectrum" ]; then + echo " <li id=\"cur\">Kspectrum</li>" else - echo " <li><a href=${root}art/kspectrum.html>Kspectrum</a></li>" + echo " <li><a href=\"${root}art/kspectrum.html\">Kspectrum</a></li>" fi - if [ "$name" == "Kdistribution" ]; then - echo ' <li id=cur>Kdistribution</li>' + if [ "${name}" = "Kdistribution" ]; then + echo " <li id=\"cur\">Kdistribution</li>" else - echo " <li><a href=${root}art/kdistribution.html>Kdistribution</a></li>" + echo " <li><a href=\"${root}art/kdistribution.html\">Kdistribution</a></li>" fi - if [ "$name" == "HR_PPart" ]; then - echo ' <li id=cur>HR_PPart</li>' + if [ "${name}" = "HR_PPart" ]; then + echo " <li id=\"cur\">HR_PPart</li>" else - echo " <li><a href=${root}art/hr_ppart.html>HR_PPart</a></li>" + echo " <li><a href=\"${root}art/hr_ppart.html\">HR_PPart</a></li>" fi - if [ "$name" == "PPart_LW" ]; then - echo ' <li id=cur>PPart_LW</li>' + if [ "${name}" = "PPart_LW" ]; then + echo " <li id=\"cur\">PPart_LW</li>" else - echo " <li><a href=${root}art/ppart_lw.html>PPart_LW</a></li>" + echo " <li><a href=\"${root}art/ppart_lw.html\">PPart_LW</a></li>" fi - if [ "$name" == "PPart_SW" ]; then - echo ' <li id=cur>PPart_SW</li>' + if [ "${name}" = "PPart_SW" ]; then + echo " <li id=\"cur\">PPart_SW</li>" else - echo " <li><a href=${root}art/ppart_sw.html>PPart_SW</a></li>" + echo " <li><a href=\"${root}art/ppart_sw.html\">PPart_SW</a></li>" fi - if [ "$name" == "Karine" ]; then - echo ' <li id=cur>Karine</li>' + if [ "${name}" = "Karine" ]; then + echo " <li id=\"cur\">Karine</li>" else - echo " <li><a href=${root}art/karine.html>Karine</a></li>" + echo " <li><a href=\"${root}art/karine.html\">Karine</a></li>" fi - echo ' </ul></li>' - echo ' </ul>' - echo ' </div>' + echo " </ul></li>" + echo " </ul>" + echo " </div>" } print_htrdr_sub_menu() { - local root=$1 - local name=$2 + root=$1 + name=$2 - echo ' <div id=sub-menu>' - echo ' <ul>' - if [ "$name" == "Overview" ]; then - echo ' <li id=cur>Overview</li>' + echo " <div id=\"sub-menu\">" + echo " <ul>" + if [ "${name}" = "Overview" ]; then + echo " <li id=\"cur\">Overview</li>" else - echo " <li><a href=${root}htrdr/htrdr.html>Overview</a></li>" + echo " <li><a href=\"${root}htrdr/htrdr.html\">Overview</a></li>" fi - if [ "$name" == "Documentations" ]; then - echo ' <li id=cur>Reference documentation</li>' + if [ "${name}" = "Documentations" ]; then + echo " <li id=\"cur\">Reference documentation</li>" else - echo " <li><a href=${root}htrdr/htrdr-docs.html>Reference documentation</a></li>" + echo " <li><a href=\"${root}htrdr/htrdr-docs.html\">Reference documentation</a></li>" fi echo " <li>Starter Pack</li>" - echo " <li><ul class=lvl2>" - if [ "$name" == "Atmosphere-Starter-Pack" ]; then - echo " <li id=cur>Atmosphere</li>" + echo " <li><ul class=\"lvl2\">" + if [ "${name}" = "Atmosphere-Starter-Pack" ]; then + echo " <li id=\"cur\">Atmosphere</li>" else - echo " <li><a href=${root}htrdr/htrdr-atmosphere-spk.html>Atmosphere</a></li>" + echo " <li><a href=\"${root}htrdr/htrdr-atmosphere-spk.html\">Atmosphere</a></li>" fi - if [ "$name" == "Combustion-Starter-Pack" ]; then - echo " <li id=cur>Combustion</li>" + if [ "${name}" = "Combustion-Starter-Pack" ]; then + echo " <li id=\"cur\">Combustion</li>" else - echo " <li><a href=${root}htrdr/htrdr-combustion-spk.html>Combustion</a></li>" + echo " <li><a href=\"${root}htrdr/htrdr-combustion-spk.html\">Combustion</a></li>" fi echo " </ul></li>" - echo " <li><a href=https://gitlab.com/meso-star/htrdr>Git repository</a></li>" - echo ' </ul>' - echo ' <div id="info">' - echo ' <p> htrdr was funded by the <a' - echo ' href=https://anr.fr/Project-ANR-18-CE05-0015>ANR Astoria</a> from 2018 to' - echo ' 2022. |Méso|Star&gt; was sub-contractor of the project.</p>' - echo ' <p>htrdr was funded by the <a href=https://www.ademe.fr/>ADEME</a>' - echo ' (MODEVAL-URBA-2019) from 2019 to 2022. |Méso|Star&gt; was partner of the' - echo ' project with <a href="https://www.umr-cnrm.fr/">CNRM</a>.</p>' - echo ' <p>htrdr was funded by the <a' - echo ' href=https://anr.fr/Project-ANR-16-CE01-0010>ANR High-Tune</a> from' - echo ' 2016 to 2019. |Méso|Star&gt; was sub-contractor of the project. Visit' - echo ' the <a href="http://www.umr-cnrm.fr/high-tune/?lang=en"> High-Tune' - echo ' project web site</a>.</p>' - echo ' </div>' - echo ' </div>' + echo " <li><a href=\"https://gitlab.com/meso-star/htrdr\">Git repository</a></li>" + echo " </ul>" + echo " <div id=\"info\">" + echo " <p> htrdr was funded by the <a" + echo " href=\"https://anr.fr/Project-ANR-18-CE05-0015\">ANR Astoria</a> from 2018 to" + echo " 2022. |Méso|Star&gt; was sub-contractor of the project.</p>" + echo " <p>htrdr was funded by the <a href=\"https://www.ademe.fr\"/>ADEME</a>" + echo " (MODEVAL-URBA-2019) from 2019 to 2022. |Méso|Star&gt; was partner of the" + echo " project with <a href=\"https://www.umr-cnrm.fr/\">CNRM</a>.</p>" + echo " <p>htrdr was funded by the <a" + echo " href=\"https://anr.fr/Project-ANR-16-CE01-0010\">ANR High-Tune</a> from" + echo " 2016 to 2019. |Méso|Star&gt; was sub-contractor of the project. Visit" + echo " the <a href=\"http://www.umr-cnrm.fr/high-tune/?lang=en\"> High-Tune" + echo " project web site</a>.</p>" + echo " </div>" + echo " </div>" } print_schiff_sub_menu() { - local root=$1 - local name=$2 - - echo ' <div id=sub-menu>' - echo ' <ul>' - if [ "$name" == "Overview" ]; then - echo ' <li id=cur>Overview</li>' - else - echo " <li><a href=${root}schiff/schiff.html>Overview</a></li>" - fi - echo ' <li>Reference documentation</li>' - echo ' <li><ul class=lvl2>' - local i - for((i=0; i < ${#schiff_man_pages[@]}; ++i)); do - local entry=(${schiff_man_pages[$i]}) - if [ "$name" == "${entry[0]}" ]; then - echo " <li id=cur>$name</li>" + root=$1 + name=$2 + + echo " <div id=\"sub-menu\">" + echo " <ul>" + if [ "${name}" = "Overview" ]; then + echo " <li id=\"cur\">Overview</li>" + else + echo " <li><a href=\"${root}schiff/schiff.html\">Overview</a></li>" + fi + echo " <li>Reference documentation</li>" + echo " <li><ul class=\"lvl2\">" + printf "%s\n" "${schiff_man_pages}" | \ + while read -r i; do + man=$(printf "%s" "${i}" | awk '{print $1}') + section=$(printf "%s" "${i}" | awk '{print $2}') + if [ "${name}" = "${man}" ]; then + echo " <li id=\"cur\">${name}</li>" else - local link_path="${root}schiff/man/man${entry[1]}/${entry[0]}.${entry[1]}.html" - echo " <li><a href=\"$link_path\">${entry[0]}</a></li>" + link_path="${root}schiff/man/man${section}/${man}.${section}.html" + echo " <li><a href=\"${link_path}\">${man}</a></li>" fi done - echo ' </ul></li>' - if [ "$name" == "Downloads" ]; then - echo ' <li id=cur>Downloads</li>' + echo " </ul></li>" + if [ "${name}" = "Downloads" ]; then + echo " <li id=\"cur\">Downloads</li>" else - echo " <li><a href=${root}schiff/schiff-downloads.html>Downloads</a></li>" + echo " <li><a href=\"${root}schiff/schiff-downloads.html\">Downloads</a></li>" fi - echo " <li><a href=https://gitlab.com/meso-star/schiff>Git repository</a></li>" - echo ' </ul>' - echo ' </div>' + echo " <li><a href=\"https://gitlab.com/meso-star/schiff\">Git repository</a></li>" + echo " </ul>" + echo " </div>" } print_solstice_sub_menu() { - local root=$1 - local name=$2 + root=$1 + name=$2 - echo ' <div id=sub-menu>' - echo ' <ul>' - if [ "$name" == "Overview" ]; then - echo ' <li id=cur>Overview</li>' + echo " <div id=\"sub-menu\">" + echo " <ul>" + if [ "${name}" = "Overview" ]; then + echo " <li id=\"cur\">Overview</li>" else - echo " <li><a href=${root}solstice/solstice.html>Overview</a></li>" + echo " <li><a href=\"${root}solstice/solstice.html\">Overview</a></li>" fi - echo ' <li>Reference documentation</li>' - echo ' <li><ul class=lvl2>' - local i - for((i=0; i < ${#solstice_man_pages[@]}; ++i)); do - local entry=(${solstice_man_pages[$i]}) - if [ "$name" == "${entry[0]}" ]; then - echo " <li id=cur>$name</li>" + echo " <li>Reference documentation</li>" + echo " <li><ul class=\"lvl2\">" + + printf "%s\n" "${solstice_man_pages}" | \ + while read -r i; do + man=$(printf "%s" "${i}" | awk '{print $1}') + section=$(printf "%s" "${i}" | awk '{print $2}') + if [ "${name}" = "${man}" ]; then + echo " <li id=\"cur\">${name}</li>" else - local link_path="${root}solstice/man/man${entry[1]}/${entry[0]}.${entry[1]}.html" - echo " <li><a href=\"$link_path\">${entry[0]}</a></li>" + link_path="${root}solstice/man/man${section}/${man}.${section}.html" + echo " <li><a href=\"${link_path}\">${man}</a></li>" fi done - echo ' </ul></li>' - if [ "$name" == "Downloads" ]; then - echo ' <li id=cur>Downloads</li>' + + echo " </ul></li>" + if [ "${name}" = "Downloads" ]; then + echo " <li id=\"cur\">Downloads</li>" else - echo " <li><a href=${root}solstice/solstice-downloads.html>Downloads</a></li>" + echo " <li><a href=\"${root}solstice/solstice-downloads.html\">Downloads</a></li>" fi - if [ "$name" == "Resources" ]; then - echo ' <li id=cur>Additional resources</li>' + if [ "${name}" = "Resources" ]; then + echo " <li id=\"cur\">Additional resources</li>" else - echo " <li><a href=${root}solstice/solstice-resources.html>Additional resources</a></li>" + echo " <li><a href=\"${root}solstice/solstice-resources.html\">Additional resources</a></li>" fi - echo " <li><a href=https://gitlab.com/meso-star/solstice>Git repository</a></li>" - echo ' </ul>' - echo ' <div id="info">' - echo ' <p>Solstice was funded by the LABEX Solstice from 2016 to 2017.' - echo ' Visit the <a href="https://www.labex-solstice.fr/solstice-software">' - echo ' LABEX Solstice web page</a> for complementary informations and examples.</p>' - echo ' </div>' - echo ' </div>' + echo " <li><a href=\"https://gitlab.com/meso-star/solstice\">Git repository</a></li>" + echo " </ul>" + echo " <div id=\"info\">" + echo " <p>Solstice was funded by the LABEX Solstice from 2016 to 2017." + echo " Visit the <a href=\"https://www.labex-solstice.fr/solstice-software\">" + echo " LABEX Solstice web page</a> for complementary informations and examples.</p>" + echo " </div>" + echo " </div>" } print_stardis_sub_menu() { - local root=$1 - local name=$2 + root=$1 + name=$2 - echo ' <div id=sub-menu>' - echo ' <ul>' - if [ "$name" == "Overview" ]; then - echo ' <li id=cur>Overview</li>' + echo " <div id=\"sub-menu\">" + echo " <ul>" + if [ "${name}" = "Overview" ]; then + echo " <li id=\"cur\">Overview</li>" else - echo " <li><a href=${root}stardis/stardis.html>Overview</a></li>" + echo " <li><a href=\"${root}stardis/stardis.html\">Overview</a></li>" fi - if [ "$name" == "Consortium" ]; then - echo " <li id=cur>Consortium</li>" + if [ "${name}" = "Consortium" ]; then + echo " <li id=\"cur\">Consortium</li>" else - echo " <li><a href=${root}stardis/consortium-fr.html>Consortium</a></li>" + echo " <li><a href=\"${root}stardis/consortium-fr.html\">Consortium</a></li>" fi - echo ' <li>Reference documentation</li>' - echo ' <li><ul class=lvl2>' - local i - for((i=0; i < ${#stardis_man_pages[@]}; ++i)); do - local entry=(${stardis_man_pages[$i]}) - if [ "$name" == "${entry[0]}" ]; then - echo " <li id=cur>$name</li>" + echo " <li>Reference documentation</li>" + echo " <li><ul class=lvl2>" + + printf "%s\n" "${stardis_man_pages}" | \ + while read -r i; do + man=$(printf "%s" "${i}" | awk '{print $1}') + section=$(printf "%s" "${i}" | awk '{print $2}') + if [ "${name}" = "${man}" ]; then + echo " <li id=cur>${name}</li>" else - local link_path="${root}stardis/man/man${entry[1]}/${entry[0]}.${entry[1]}.html" - echo " <li><a href=\"$link_path\">${entry[0]}</a></li>" + link_path="${root}stardis/man/man${section}/man.${section}.html" + echo " <li><a href=\"${link_path}\">${man}</a></li>" fi done echo ' </ul></li>' - if [ "$name" == "Starter-Pack" ]; then + if [ "${name}" = "Starter-Pack" ]; then echo " <li id=cur>Starter Pack</li>" else echo " <li><a href=${root}stardis/starter-pack.html>Starter Pack</a></li>" fi - if [ "$name" == "Downloads" ]; then + if [ "${name}" = "Downloads" ]; then echo " <li id=cur>Downloads</li>" else echo " <li><a href=${root}stardis/stardis-downloads.html>Downloads</a></li>" @@ -310,37 +312,43 @@ print_stardis_sub_menu() { } print_star_engine_sub_menu() { - local root=$1 - local name=$2 - local components=( - "Star-Geom Geometric&nbsp;data" - "Star-2D Star-2D" - "Star-3D Star-3D" - "Star-SP Star-SamPling" - "Star-SF Star-ScatteringFunctions" - "Star-UVM Star-UVM" - "Star-VX Star-VoXel") + root=$1 + name=$2 + components="\ + Star-Geom Geometric&nbsp;data + Star-2D Star-2D + Star-3D Star-3D + Star-SP Star-SamPling + Star-SF Star-ScatteringFunctions + Star-UVM Star-UVM + Star-VX Star-VoXel" echo ' <div id=sub-menu>' echo ' <ul>' - if [ "$name" == "Overview" ]; then + if [ "${name}" = "Overview" ]; then echo ' <li id=cur>Overview</li>' else echo " <li><a href=${root}star-engine/star-engine.html>Overview</a></li>" fi echo ' <li>Components</li>' echo ' <li><ul class=lvl2>' - local i - for((i=0; i < ${#components[@]}; ++i)); do - local entry=(${components[$i]}) - if [ "$name" == "${entry[0]}" ]; then - echo " <li id=cur>${entry[1]}</li>" + + printf "%s\n" "${components}" | \ + while read -r i; do + page=$(printf "%s" "${i}" | awk '{print $1}') + section=$(printf "%s" "${i}" | awk '{print $2}') + if [ "${name}" = "${page}" ]; then + echo " <li id=cur>${section}</li>" else - echo " <li><a href=${root}star-engine/$(echo ${entry[0]} | tr '[:upper:]' '[:lower:]').html>${entry[1]}</a></li>" + printf " <li><a href=%sstar-engine/%s.html>%s</a></li>" \ + "${root}" \ + "$(echo "${page}" | tr '[:upper:]' '[:lower:]')" \ + "${section}" fi done + echo ' </ul></li>' - if [ "$name" == "Downloads" ]; then + if [ "${name}" = "Downloads" ]; then echo ' <li id=cur>Downloads</li>' else echo " <li><a href=${root}star-engine/star-engine-downloads.html>Downloads</a></li>" @@ -358,85 +366,85 @@ print_star_engine_sub_menu() { } print_header() { - local section=$1 - local full_name=$2 - local lang=$([[ $# -ge 3 ]] && echo $3 || echo "en") - local name=${full_name#man-} - local is_man=$([[ $full_name =~ ^man- ]] && echo 1 || echo 0) - local root=$([[ $is_man == 1 ]] && echo "../../../" || echo "../") - - echo '<!DOCTYPE html>' - echo '' - echo "<html lang=$lang>" - echo '<head>' - echo ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8">' - echo ' <meta name="viewport" content="width=device-width, initial-scale=1">' - echo " <title>|M|S&gt; $section</title>" + section=$1 + full_name=$2 + lang=$([ $# -ge 3 ] && echo "$3" || echo "en") + name=${full_name#man-} + is_man=$([ "${full_name}" != "${name}" ] && echo 1 || echo 0) + root=$([ "${is_man}" = 1 ] && echo "../../../" || echo "../") + + echo "<!DOCTYPE html>" + echo "" + echo "<html lang=\"${lang}\">" + echo "<head>" + echo " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">" + echo " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" + echo " <title>|M|S&gt; ${section}</title>" echo " <link rel=\"stylesheet\" title=\"default\" href=\"${root}meso.css\">" echo '</head>' - echo '' - echo '<body>' - echo '<div id="menu">' - if [ "$section" == "Home" ]; then - echo ' <h2>Home</h2>' - print_home_sub_menu ${root} ${name} + echo "" + echo "<body>" + echo "<div id=\"menu\">" + if [ "${section}" = "Home" ]; then + echo " <h2>Home</h2>" + print_home_sub_menu "${root}" "${name}" else - echo " <h2><a href=${root}misc/about-fr.html>Home</a></h2>" + echo " <h2><a href=\"${root}misc/about-fr.html\">Home</a></h2>" fi - if [ "$section" == "ART" ]; then + if [ "${section}" = "ART" ]; then echo " <h2>A.R.T.</h2>" - print_art_sub_menu ${root} ${name} + print_art_sub_menu "${root}" "${name}" else - echo " <h2><a href=${root}art/art.html>A.R.T.</a></h2>" + echo " <h2><a href=\"${root}art/art.html\">A.R.T.</a></h2>" fi - if [ "$section" == "htrdr" ]; then - echo " <h2 style='font-variant: none'><code style='color: black'>htrdr</code></h2>" - print_htrdr_sub_menu ${root} ${name} + if [ "${section}" = "htrdr" ]; then + echo " <h2 style=\"font-variant: none\"><code style=\"color: black\">htrdr</code></h2>" + print_htrdr_sub_menu "${root}" "${name}" else - echo " <h2 style='font-variant: none'><code><a href=${root}htrdr/htrdr.html>htrdr</a></code></h2>" + echo " <h2 style=\"font-variant: none\"><code><a href=\"${root}htrdr/htrdr.html\">htrdr</a></code></h2>" fi - if [ "$section" == "Schiff" ]; then + if [ "${section}" = "Schiff" ]; then echo ' <h2>Schiff</h2>' - print_schiff_sub_menu ${root} ${name} + print_schiff_sub_menu "${root}" "${name}" else - echo " <h2><a href=${root}schiff/schiff.html>Schiff</a></h2>" + echo " <h2><a href=\"${root}schiff/schiff.html\">Schiff</a></h2>" fi - if [ "$section" == "Solstice" ]; then - echo ' <h2>Solstice</h2>' - print_solstice_sub_menu ${root} ${name} + if [ "${section}" = "Solstice" ]; then + echo " <h2>Solstice</h2>" + print_solstice_sub_menu "${root}" "${name}" else - echo " <h2><a href=${root}solstice/solstice.html>Solstice</a></h2>" + echo " <h2><a href=\"${root}solstice/solstice.html\">Solstice</a></h2>" fi - if [ "$section" == "Stardis" ]; then - echo ' <h2>Stardis</h2>' - print_stardis_sub_menu ${root} ${name} + if [ "${section}" = "Stardis" ]; then + echo " <h2>Stardis</h2>" + print_stardis_sub_menu "${root}" "${name}" else - echo " <h2><a href=${root}stardis/stardis.html>Stardis</a></h2>" + echo " <h2><a href=\"${root}stardis/stardis.html\">Stardis</a></h2>" fi - if [ "$section" == "Star-Engine" ]; then - echo ' <h2>Star-Engine</h2>' - print_star_engine_sub_menu ${root} ${name} + if [ "${section}" = "Star-Engine" ]; then + echo " <h2>Star-Engine</h2>" + print_star_engine_sub_menu "${root}" "${name}" else - echo " <h2><a href=${root}star-engine/star-engine.html>Star-Engine</a></h2>" + echo " <h2><a href=\"${root}star-engine/star-engine.html\">Star-Engine</a></h2>" fi - echo '<br>' # Enable CSS overflow here - echo '</div>' - echo '<div id=content>' + echo "<br>" # Enable CSS overflow here + echo "</div>" + echo "<div id=\"content\">" } print_footer() { - echo '</div>' # content - echo '<div id=footer>' - echo ' - <a rel="license" href="http://creativecommons.org/licenses/by-nd/4.0/"> - <img alt="Creative Commons License" style="border-width:0; float: left; margin-right: 1em" - src="https://i.creativecommons.org/l/by-nd/4.0/88x31.png" /> - </a>' - echo 'Copyright &#169; 2015-2022 <a href="mailto:contact@meso-star.com">|Méso|Star&gt;</a>' - echo '<br />' - echo 'This page is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nd/4.0/">Creative Commons Attribution-NoDerivatives 4.0 International License</a>.' + echo "</div>" # content + echo "<div id=\"footer\">" + echo " + <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nd/4.0/\"> + <img alt=\"Creative Commons License\" style=\"border-width:0; float: left; margin-right: 1em\" + src=\"https://i.creativecommons.org/l/by-nd/4.0/88x31.png\" /> + </a>" + echo "Copyright &#169; 2015-2022 <a href=\"mailto:contact@meso-star.com\">|Méso|Star&gt;</a>" + echo "<br>" + echo "This page is licensed under a <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nd/4.0/\">Creative Commons Attribution-NoDerivatives 4.0 International License</a>." echo "</div>" - echo '</body>' + echo "</body>" } print_downloads() { @@ -445,64 +453,69 @@ print_downloads() { windows=1 linux=1 else - windows=$([[ $2 == *Windows* ]] && echo 1 || echo 0) - linux=$([[ $2 == *Linux* ]] && echo 1 || echo 0) - fi - - echo '<table>' - echo ' <tr>' - echo ' <th>Version</th>' - [[ ! "$linux" -eq 0 ]] && echo ' <th>GNU/Linux 64-bits</th>' - [[ ! "$windows" -eq 0 ]] && echo ' <th>Windows 64-bits</th>' - echo ' <th>Sources</th>' - echo ' </tr>' - - local archs=$(find downloads/ -regex ".*/$prefix-[0-9]+.[0-9]+.[0-9]+\(-r[0-9]+\)?-[^\(Sources\)].*tar.gz" | sort -Vr ) - local arch; - for arch in $archs; do - local version=$(echo $arch | sed "s/.*${prefix}-\([0-9]\+\.[0-9]\+\.[0-9]\+\(-r[0-9]\+\)\{0,1\}\)-.*/\1/g") - local dl_files=() - - if [ "$dl_files" == *Sources* ]; then - continue + windows=0 + linux=0 + case "$2" in + "*Windows*") windows=1;; + "*Linux*") linux=1;; + *) ;; + esac + fi + + echo "<table>" + echo " <tr>" + echo " <th>Version</th>" + [ ! "${linux}" -eq 0 ] && echo " <th>GNU/Linux 64-bits</th>" + [ ! "${windows}" -eq 0 ] && echo " <th>Windows 64-bits</th>" + echo " <th>Sources</th>" + echo " </tr>" + + find downloads/ -regex ".*/${prefix}-[0-9]+.[0-9]+.[0-9]+\(-r[0-9]+\)?-[^\(Sources\)].*tar.gz" | sort -Vr | \ + while read -r arch; do + version=$(echo "${arch}" | sed "s/.*${prefix}-\([0-9]\+\.[0-9]\+\.[0-9]\+\(-r[0-9]\+\)\{0,1\}\)-.*/\1/g") + dl_files="" + + case "${dl_files}" in + "*Sources*") continue;; + *) ;; + esac + + if [ ! "${linux}" -eq 0 ]; then + dl_files="${dl_files} downloads/${prefix}-${version}-GNU-Linux64.tar.gz" fi - - if [ ! "$linux" -eq 0 ]; then - dl_files[${#dl_files[@]}]="downloads/${prefix}-${version}-GNU-Linux64.tar.gz" - fi - if [ ! "$windows" -eq 0 ]; then - dl_files[${#dl_files[@]}]="downloads/${prefix}-${version}-Win64.zip" + if [ ! "${windows}" -eq 0 ]; then + dl_files="${dl_files} downloads/${prefix}-${version}-Win64.zip" fi if [ -f "downloads/${prefix}-${version}-Sources.zip" ]; then - dl_files[${#dl_files[@]}]="downloads/${prefix}-${version}-Sources.zip" + dl_files="${dl_files} downloads/${prefix}-${version}-Sources.zip" elif [ -f "downloads/${prefix}-${version}-Source.zip" ]; then - dl_files[${#dl_files[@]}]="downloads/${prefix}-${version}-Source.zip" + dl_files="${dl_files} downloads/${prefix}-${version}-Source.zip" elif [ -f "downloads/${prefix}-${version}-Sources.tar.gz" ]; then - dl_files[${#dl_files[@]}]="downloads/${prefix}-${version}-Sources.tar.gz" - else - dl_files[${#dl_files[@]}]="downloads/${prefix}-${version}-Source.tar.gz" + dl_files="${dl_files} downloads/${prefix}-${version}-Sources.tar.gz" + else + dl_files="${dl_files} downloads/${prefix}-${version}-Source.tar.gz" fi echo " <tr>" echo " <td>${version}</td>" - for((i=0; i < ${#dl_files[@]}; ++i)); do - local dl_file=${dl_files[$i]} + for i in $(printf "%s" "${dl_files}"); do + dl_file="${i}" echo " <td>" - if [ -f ${dl_file} ]; then - echo -n " [<a href='${dl_file}'>" - [[ "${dl_file#*tar.gz}" != "${dl_file}" ]] && echo -n "tarball" || echo -n "zip" + if [ -f "${dl_file}" ]; then + printf " [<a href=\"%s\">" "${dl_file}" + [ "${dl_file#*tar.gz}" != "${dl_file}" ] && printf "tarball" || printf "zip" echo "</a>]" fi - if [ -f ${dl_files[$i]}.sig ]; then - echo " [<a href='${dl_files[$i]}.sig'>pgp</a>]" + if [ -f "${dl_file}.sig" ]; then + echo " [<a href=\"${dl_file}.sig\">pgp</a>]" fi echo " </td>" done echo " </tr>" done - echo '</table>' + echo "</table>" } convert_man_page() { @@ -510,65 +523,65 @@ convert_man_page() { input=$2 output=$3 version=$4 - output_dir=$(dirname $output) - man_file=$(basename $input) - man_name=$(echo $man_file | sed 's/\(.*\)\.[0-7]/\1/') - man_num=$(echo $man_file | sed 's/.*\.\([0-7]\)/\1/') + output_dir=$(dirname "${output}") + man_file=$(basename "${input}") + man_name=$(echo "${man_file}" | sed 's/\(.*\)\.[0-7]/\1/') + man_num=$(echo "${man_file}" | sed 's/.*\.\([0-7]\)/\1/') - if [ ! -f "$input" ]; then - echo "Cannot find the '$input' man page." - continue + if [ ! -f "${input}" ]; then + echo "Cannot find the '${input}' man page." + return fi mkdir -p "${output_dir}" # Generate the man page - echo "Write $output" + echo "Write ${output}" { - print_header ${section} man-${man_name} - echo -n "<div style=\"font-variant: small-caps; float: right; color: #777777\">" - [ $section == "htrdr" ] \ - && echo "<code style='font-variant:none'>$section</code> $version</div>" \ - || echo "$section $version</div>"; + print_header "${section}" "man-${man_name}" + printf "<div style=\"font-variant: small-caps; float: right; color: #777777\">" + [ "${section}" = "htrdr" ] \ + && echo "<code style=\"font-variant:none\">${section}</code> ${version}</div>" \ + || echo "${section} ${version}</div>"; echo "<header>" echo " <h1>${man_name}(${man_num})</h1>"; echo "</header>" - } > $output + } > "${output}" - man2html -r $input \ + man2html -r "${input}" \ | tail -n +10 \ | sed '/^<HR>$/,$d' \ | sed '/\&nbsp;/d' \ | sed 's/<DL COMPACT>/<DL>/g' \ - >> $output + >> "${output}" - print_footer >> $output + print_footer >> "${output}" # Remove hyperlink on csplit, feh, gnuplot, sed, mmap and mpirun commands - sed -i 's/<B><A HREF="\.\.\/man1\/csplit\.1\.html">csplit<\/A><\/B>/csplit/g' $output - sed -i 's/<B><A HREF="\.\.\/man1\/feh\.1\.html">feh<\/A><\/B>/feh/g' $output - sed -i 's/<B><A HREF="\.\.\/man1\/gnuplot\.1\.html">gnuplot<\/A><\/B>/gnuplot/g' $output - sed -i 's/<B><A HREF="\.\.\/man1\/sed\.1\.html">sed<\/A><\/B>/sed/g' $output - sed -i 's/<B><A HREF="\.\.\/man1\/mpirun\.1\.html">mpirun<\/A><\/B>/mpirun/g' $output - sed -i 's/<B><A HREF="\.\.\/man2\/mmap\.2\.html">mmap<\/A><\/B>/mmap/g' $output + sed -i 's/<B><A HREF="\.\.\/man1\/csplit\.1\.html">csplit<\/A><\/B>/csplit/g' "${output}" + sed -i 's/<B><A HREF="\.\.\/man1\/feh\.1\.html">feh<\/A><\/B>/feh/g' "${output}" + sed -i 's/<B><A HREF="\.\.\/man1\/gnuplot\.1\.html">gnuplot<\/A><\/B>/gnuplot/g' "${output}" + sed -i 's/<B><A HREF="\.\.\/man1\/sed\.1\.html">sed<\/A><\/B>/sed/g' "${output}" + sed -i 's/<B><A HREF="\.\.\/man1\/mpirun\.1\.html">mpirun<\/A><\/B>/mpirun/g' "${output}" + sed -i 's/<B><A HREF="\.\.\/man2\/mmap\.2\.html">mmap<\/A><\/B>/mmap/g' "${output}" # Fix the hyperlink toward the GPLv3+ license - sed -i 's/gpl\.html\.">\(.*\).<\/A>/gpl.html">\1<\/A>./g' $output + sed -i 's/gpl\.html\.">\(.*\).<\/A>/gpl.html">\1<\/A>./g' "${output}" # Remove unexpected link on sqrt(2) - sed -i 's/<A HREF="\.\.\/man2\/sqrt\.2\.html">sqrt<\/A>/sqrt/g' $output + sed -i 's/<A HREF="\.\.\/man2\/sqrt\.2\.html">sqrt<\/A>/sqrt/g' "${output}" # Fix the man2html issues that translates the ' char in cq - sed -i "s/cq\([a-z]\)\>/'\1/g" $output + sed -i "s/cq\([a-z]\)\>/'\1/g" "${output}" } set +e if hash markdown 2> /dev/null; then - markdown=markdown + export markdown=markdown elif hash markdown2 2> /dev/null; then - markdown=markdown2 + export markdown=markdown2 elif hash markdown_py 2> /dev/null; then - markdown=markdown_py + export markdown=markdown_py else echo "Cannot find the markdown[2|_py] command" exit 1 diff --git a/solstice/.gitignore b/solstice/.gitignore @@ -0,0 +1,6 @@ +solstice.html +solstice-downloads.html +solstice-resources.html +solstice-release-notes.html.in +solstice-pp-release-notes.html.in +Solstice-* diff --git a/solstice/Makefile b/solstice/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2021 |Meso|Star> (contact@meso-star.com) +# Copyright (C) 2019-2022 |Meso|Star> (contact@meso-star.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,39 +12,160 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +.POSIX: -SOLSTICE-VERSION=0.9.1 -SOLSTICE-ABG=~/Solstice-ABG/ +include ../config.mk -IMG = themis.png -SRC = \ - solstice.html.in \ - solstice-abg.html.in \ - solstice-pp.html.in \ - solstice.sh +# Main versions to publish +SOLSTICE_VERSION=0.9.1 +SOLPP_VERSION=0.3.1 -.PHONY: all clean default publish -default: all +SOLSTICE=downloads/Solstice-$(SOLSTICE_VERSION)-GNU-Linux64.tar.gz +SOLSTICE_README=Solstice-$(SOLSTICE_VERSION)-GNU-Linux64/share/doc/solstice/README.md +SOLPP=downloads/Solstice-PP-Sources-$(SOLPP_VERSION).tar.gz +SOLPP_README=Solstice-PP-Sources-$(SOLPP_VERSION)/README.md -all: ${SRC} - @bash solstice.sh ${SOLSTICE-VERSION} ${SOLSTICE-ABG} +SOLPP_PKG=\ + ./downloads/Solstice-PP-Sources-0.3.1.tar.gz\ + ./downloads/Solstice-PP-Sources-0.3.0.tar.gz\ + ./downloads/Solstice-PP-Sources-0.2.0.tar.gz\ + ./downloads/Solstice-PP-Sources-0.1.0.tar.gz +SOLPP_SIG=$(SOLPP_PKG:=.sig) -publish: +SOLSTICE_PKG=\ + ./downloads/Solstice-0.9.1-Sources.zip\ + ./downloads/Solstice-0.9.1-GNU-Linux64.tar.gz\ + ./downloads/Solstice-0.9.0-Win64.zip\ + ./downloads/Solstice-0.9.0-Sources.zip\ + ./downloads/Solstice-0.9.0-GNU-Linux64.tar.gz\ + ./downloads/Solstice-0.8.2-Win64.zip\ + ./downloads/Solstice-0.8.2-Sources.zip\ + ./downloads/Solstice-0.8.2-GNU-Linux64.tar.gz\ + ./downloads/Solstice-0.8.1-Win64.zip\ + ./downloads/Solstice-0.8.1-Sources.zip\ + ./downloads/Solstice-0.8.1-GNU-Linux64.tar.gz\ + ./downloads/Solstice-0.7.1-Win64.zip\ + ./downloads/Solstice-0.7.1-Sources.zip\ + ./downloads/Solstice-0.7.1-GNU-Linux64.tar.gz\ + ./downloads/Solstice-0.6.1-Win64.zip\ + ./downloads/Solstice-0.6.1-Sources.zip\ + ./downloads/Solstice-0.6.1-GNU-Linux64.tar.gz\ + ./downloads/Solstice-0.5.0-Sources.zip\ + ./downloads/Solstice-0.5.0-GNU-Linux64.tar.gz\ + ./downloads/Solstice-0.4.1-Win64.zip\ + ./downloads/Solstice-0.4.1-Sources.zip\ + ./downloads/Solstice-0.4.1-GNU-Linux64.tar.gz\ + ./downloads/Solstice-0.4.0-Win64.zip\ + ./downloads/Solstice-0.4.0-Sources.zip\ + ./downloads/Solstice-0.4.0-GNU-Linux64.tar.gz +SOLSTICE_SIG=$(SOLSTICE_PKG:=.sig) + +IMG=themis.png +HTML=\ + solstice.html\ + solstice-downloads.html\ + solstice-resources.html + +build: .sigs + @$(MAKE) -fMakefile -f .sigs build_all + +build_all: solstice.html solstice-downloads.html solstice-resources.html + +publish: build rsync -avzr \ solstice.html \ solstice-downloads.html \ solstice-resources.html \ - ${IMG} \ + $(HTML) \ + $(IMG) \ downloads \ man \ ${REMOTE}/solstice/ clean: - rm -rf solstice.html \ - solstice-downloads.html \ - solstice-resources.html \ + rm -rf man + rm -f .sigs .chks \ solstice-release-notes.html.in \ solstice-pp-release-notes.html.in \ + $(HTML) \ + $(HTML:=.err) + +distclean: clean + rm -f \ downloads/*.sig \ - man + $(SOLSTICE_README) \ + $(SOLPP_README) + +################################################################################ +# Overview web page +################################################################################ +solstice.html: solstice.html.in themis.png solstice_build.sh ../meso-menu.sh + @echo "Building $@" + @sh solstice_build.sh overview $(SOLSTICE_VERSION) + +################################################################################ +# Downloads web page +################################################################################ +solstice-downloads.html: $(SOLSTICE_SIG) \ + solstice-release-notes.html.in \ + solstice_build.sh \ + ../meso-menu.sh + @echo "Building $@" + @sh solstice_build.sh downloads + +solstice-release-notes.html.in: $(SOLSTICE_README) + @$(MARKDOWN) $(SOLSTICE_README) \ + | sed -n '/^<h2>Release notes<\/h2>/,/^<h2>License<\/h2>/p' | sed '$$d' > $@ + +$(SOLSTICE_README): + @tar -xz -f $(SOLSTICE) -i $(README) + +################################################################################ +# Additional resources +################################################################################ +solstice-resources.html: $(SOLPP_SIG) \ + solstice-abg.html.in \ + solstice-pp.html.in \ + solstice-pp-release-notes.html.in \ + solstice_build.sh \ + ../meso-menu.sh + @echo "Building $@" + @sh solstice_build.sh resources $(SOLPP_VERSION) + +solstice-pp-release-notes.html.in: $(SOLPP_README) + @$(MARKDOWN) $(SOLPP_README) \ + | sed -n '/^<h2>Release notes<\/h2>/,/^<h2>License<\/h2>/p' \ + | sed -e '$$d' -e 's/\<h3\>/h4/g' > $@ + +$(SOLPP_README): + @tar -xz -f $(SOLPP) -i $(SOLPP_README) + +################################################################################ +# Check files +################################################################################ +check: .chks .sigs + @$(MAKE) -fMakefile -f .chks -f .sigs check_all + +check_all: check_shells $(HTML:=.chk) + +check_shells: + @echo "Checking solstice_build.sh" && shellcheck -o all -x solstice_build.sh + +################################################################################ +# Miscellaneous targets +################################################################################ +.sigs: Makefile + @echo "Setup .sigs" + @{ for i in $(SOLSTICE_PKG) $(SOLPP_PKG); do \ + printf "%s.sig: %s\n" $${i} $${i}; \ + printf "\t@echo \"Signing $${i}\"\n"; \ + printf "\t@gpg --yes -a -o %s.sig --detach-sign %s\n" $${i} $${i}; \ + done } > .sigs +.chks: Makefile + @echo "Setup .chks" + @{ for i in $(HTML); do \ + printf "%s.chk: %s\n" $${i} $${i}; \ + printf "\t@echo Checking %s\n" $${i}; \ + printf "\t@sh ../check_html.sh %s\n" $${i}; \ + done } > .chks diff --git a/solstice/downloads/Solstice-ABG.pdf b/solstice/downloads/Solstice-ABG.pdf @@ -1 +1 @@ -#$# git-wad 96eac608c5168b9f27fbd2c04880f4bdda94ffaff926b76a83ffc0cb48f5b7cd 1008073 -\ No newline at end of file +#$# git-wad f81005149c82fd9295a58b70bdf050c770a881711a57d497603e957e8dfc9a38 1026702 +\ No newline at end of file diff --git a/solstice/solstice-abg.html.in b/solstice/solstice-abg.html.in @@ -1,4 +1,4 @@ -<h2 id=ABG>Beginner's guide</h2> +<h2 id="ABG">Beginner's guide</h2> <p> The <b>Solstice Absolute Beginner's Guide</b> is designed to introduce enough @@ -14,8 +14,8 @@ separate archive. <th>Resources</th> </tr> <tr> - <td>[<a href='downloads/Solstice-ABG.pdf'>pdf</a>]</td> - <td>[<a href='downloads/Solstice-ABG-rsrc.zip'>zip</a>]</td> + <td>[<a href="downloads/Solstice-ABG.pdf">pdf</a>]</td> + <td>[<a href="downloads/Solstice-ABG-rsrc.zip">zip</a>]</td> </tr> </table> diff --git a/solstice/solstice-pp.html.in b/solstice/solstice-pp.html.in @@ -22,16 +22,16 @@ certain conditions; refer to the <a href="https://www.gnu.org/licenses/gpl.html">license</a> for details.</p> <p>To use these tools, download the provided archive and verify its integrity -against its <a href=pgp_signatures.html>PGP signature</a>. This archive -contains the sources of the program and a GNU/Makefile to simplify the build -process on GNU/Linux and on Windows through <a +against its <a href="../misc/pgp_signatures.html">PGP signature</a>. This +archive contains the sources of the program and a GNU/Makefile to simplify the +build process on GNU/Linux and on Windows through <a href="http://www.mingw.org/">MinGW</a>. Extract it and run <code>make</code> to build the programs. Note that even though this archive targets GNU-compliant systems, the provided sources can be compiled by any C compiler that supports the C99 standard.</p> <pre class="code"> -$ tar xzvf Solstice-PP-Sources-$VERSION.tar.gz +$ tar xzvf Solstice-PP-Sources-${VERSION}.tar.gz $ cd Solstice-PP-Sources $ make </pre> @@ -74,7 +74,7 @@ regular Solstice simulation. These data are read from a file or from standard input whether a filename is provided as an argument or not, respectively. <code>solmaps</code> extracts the maps of incoming flux computed by Solstice for the receivers whose <code>per_primitive</code> flag is enabled (see <a -href=man/man5/solstice-receiver.5.html>solstice-receiver</a>(5) for more +href="man/man5/solstice-receiver.5.html">solstice-receiver</a>(5) for more informations). Each map is then saved in a specific <a href="http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf">VTK</a> file.</p> @@ -127,7 +127,7 @@ simulation results; for instance their respective cosine factor or the amount of flux that reaches a receiver and comes from them. The second output file, is another VTK file that stores the geometry of the receivers and their simulation results as their incoming flux or their efficiency. Finally, the third -file is an <a HREF="http://www.martinreddy.net/gfx/3d/OBJ.spec">OBJ</a> file +file is an <a href="http://www.martinreddy.net/gfx/3d/OBJ.spec">OBJ</a> file that stores the meshes of the miscellaneous geometries, i.e. the geometries that are neither receivers nor primary geometries. These files can then be visualised and analysed in <a href="https://www.paraview.org">Paraview</a>.</p> diff --git a/solstice/solstice.html.in b/solstice/solstice.html.in @@ -1,6 +1,6 @@ <header> <h1>Solstice - <span class=subtitle> + <span class="subtitle"> The solar plant simulation tool </span> </h1> @@ -49,9 +49,10 @@ property, including the input solar spectrum and the absorption of the atmosphere, at any spectral resolution.</p> <p>Solstice makes intensive use of ray-tracing. While this feature is part of -the StarEngine <a href=https://gitlab.com/meso-star/star-3d>Star3D</a> library, -it is internally powered by <a href=https://software.intel.com/sdvis>Intel® -Rendering Framework</a>: <a href=http://embree.github.io/>Embree</a>.</p> +the StarEngine <a href="https://gitlab.com/meso-star/star-3d">Star3D</a> +library, it is internally powered by <a +href="https://software.intel.com/sdvis">Intel® Rendering Framework</a>: <a +href="http://embree.github.io/">Embree</a>.</p> <h2>A straight interface</h2> @@ -99,7 +100,7 @@ materials of the simulated solar plant.</p> <h2>Quick start</h2> <p>Get the desired archive of Solstice and verify its integrity against its <a -href=../misc/pgp_signatures.html>PGP signature</a>. Then extract it. On +href="../misc/pgp_signatures.html">PGP signature</a>. Then extract it. On Windows, open a command prompt into the Solstice bin directory and invoke the <code>solstice.exe</code> executable. You can alternatively register its directory into the <code>path</code> environment variable to expose the diff --git a/solstice/solstice.sh b/solstice/solstice.sh @@ -1,200 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -set -e - -source ../meso-menu.sh - -if [ $# -lt 2 ]; then - echo "Usage: $0 VERSION ABG-PATH" - exit 1 -fi - -if [ ! -f "./downloads/Solstice-$1-GNU-Linux64.tar.gz" ]; then - echo "Cannot find Solstice-$1-GNU-Linux64.tar.gz" - exit 1 -fi - -dir_curr=$(pwd) # Current directory -dir_temp=$(mktemp -d) # Working directory - -################################################################################ -# Generate the Solstice-ABG -################################################################################ -tput bold; echo ">>> Solstice Absolute Beginner's Guide"; tput sgr0 -do_something=0 -if [ ! -f downloads/Solstice-ABG.pdf ]; then - do_something=1 - ABG=guide - echo "Generate the Solstice Absolute Beginner's Guide" - if [ ! -f "$2/guide.tex" ]; then - echo "Cannot found the Latex sources of the Solstice ABG." - exit 1 - fi - cd $2 - { - pdflatex $ABG.tex; - bibtex $ABG; - pdflatex $ABG.tex; - pdflatex $ABG.tex; - } 1> /dev/null - cp $ABG.pdf $dir_curr/downloads/Solstice-ABG.pdf - cd $dir_curr -fi - -if [ ! -f downloads/Solstice-ABG-rsrc.zip ]; then - do_something=1 - echo "Archive the resources of the Solstice Absolute Beginner's Guide" - cd $2 - zip -r $dir_curr/downloads/Solstice-ABG-rsrc.zip source_files/* - cd $dir_curr -fi - -if [ $do_something == 0 ]; then - echo "Nothing to do" -fi - -echo "" - -################################################################################ -# Sign the package -################################################################################ -tput bold; echo ">>> Solstice packages"; tput sgr0 -archs=$(find downloads -regex "^.*/Solstice-[0-9]+\.[0-9]+\.[0-9]+-.*zip" \ - -o -regex "^.*/Solstice-[0-9]+\.[0-9]+\.[0-9]+-.*tar.gz" \ - -o -regex "^.*/Solstice-PP-Sources-.*\.tar.gz") -sign_something=0 -for arch in $archs; do - if [ ! -f $arch.sig ]; then - echo "Sign $arch" - gpg -a -o $arch.sig --detach-sign $arch - sign_something=1 - fi -done - -if [ $sign_something == 0 ]; then - echo "Nothing to do" -fi - -echo "" - -################################################################################ -# Generate the HTML code of the solstice release notes -################################################################################ -tput bold; echo ">>> Solstice web pages"; tput sgr0 -echo "Generate the release notes" -cd $dir_temp -arch=Solstice-$1-GNU-Linux64 -cp $dir_curr/downloads/$arch.tar.gz . -gunzip $arch.tar.gz -tar xf $arch.tar -$markdown $arch/share/doc/solstice/README.md \ - | sed '/^<h2>Release notes<\/h2>/,$!d' \ - | sed '/^<h2>License<\/h2>/,$d' \ - > $dir_curr/solstice-release-notes.html.in -cd $dir_curr - -################################################################################ -# Generate the overview page -################################################################################ -echo "Write solstice.html" -{ - print_header Solstice Overview; - VERSION=$1 envsubst < solstice.html.in; - print_footer; -} > solstice.html - -################################################################################ -# Generate the Downloads page -################################################################################ -echo "Write solstice-downloads.html" -{ - print_header Solstice Downloads; - echo '<header><h1>Download Solstice</h1></header>'; - print_downloads Solstice; - cat solstice-release-notes.html.in; - print_footer; -} > solstice-downloads.html; - -################################################################################ -# Generate he additionnal resources page -################################################################################ -print_pp_downloads() { - echo '<table>' - echo ' <tr>' - echo ' <th>Version</th>' - echo ' <th>Sources</th>' - echo ' </tr>' - - local archs=$(find downloads -regex ".*/Solstice-PP-Sources-.*\.tar.gz" | sort -r ) - local arch; - - for arch in $archs; do - local version=$(echo $arch | sed "s/.*Solstice-PP-Sources-\(.*\)\.tar.gz/\1/g") - - echo " <tr>" - echo " <td>${version}</td>" - echo " <td>" - echo " [<a href='${arch}'>tarball</a>]" - if [ -f $arch.sig ]; then - echo " [<a href='$arch.sig'>pgp</a>]" - fi - echo " </td>" - echo " </tr>" - done - echo '</table>' -} - -solpp_arch=$(cd downloads; find -regex ".*/Solstice-PP-Sources-.*\.tar.gz$" | sort -r | head -n 1) -solpp_prefix=$(echo $solpp_arch | sed 's/\.tar\.gz$//g') -solpp_version=$(echo $solpp_prefix | sed 's/.*\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/g') - -echo "Generate the release notes of the Solstice PP" -cd $dir_temp -cp $dir_curr/downloads/$solpp_arch ./ -tar xzf $solpp_arch -$markdown $solpp_prefix/README.md \ - | sed '/^<h2>Release notes<\/h2>/,$!d' \ - | sed '/^<h2>License<\/h2>/,$d' \ - | sed '/^<h2>Release notes<\/h2>/d' \ - | sed 's/\<h3\>/h4/g' \ - > $dir_curr/solstice-pp-release-notes.html.in -cd $dir_curr - -echo "Write solstice-resources.html" -{ - print_header Solstice Resources; - echo "<header><h1>Additional resources</h1></header>" - cat solstice-abg.html.in - VERSION=$solpp_version envsubst < solstice-pp.html.in - echo "<h3>Download Post-Processes</h3>" - print_pp_downloads - cat solstice-pp-release-notes.html.in - print_footer; -} > solstice-resources.html - -################################################################################ -# Generate the reference documentation -################################################################################ -for((i=0; i<${#solstice_man_pages[@]}; ++i)); do - entry=(${solstice_man_pages[$i]}) - man_name=${entry[0]} - man_num=${entry[1]} - man_path=$dir_temp/$arch/share/man/man${entry[1]}/$man_name.$man_num - output=man/man${entry[1]}/$man_name.$man_num.html - convert_man_page Solstice "$man_path" "$output" $1 -done diff --git a/solstice/solstice_build.sh b/solstice/solstice_build.sh @@ -0,0 +1,92 @@ +#!/bin/sh -e + +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. ../meso-menu.sh + +# Build the overview page +overview() +{ + if [ -z "$1" ]; then + printf "Usage: %s overview <version>\n" "$0" + exit 1 + fi + + { + print_header Solstice Overview + VERSION=$1 envsubst < solstice.html.in + print_footer + } > solstice.html +} + +# Build the downloads page +downloads() +{ + { + print_header Solstice Downloads + echo "<header><h1>Download Solstice</h1></header>" + print_downloads Solstice + cat solstice-release-notes.html.in + print_footer + } > solstice-downloads.html +} + +print_pp_downloads() { + echo "<table>" + echo " <tr>" + echo " <th>Version</th>" + echo " <th>Sources</th>" + echo " </tr>" + + + find downloads -regex ".*/Solstice-PP-Sources-.*\.tar.gz" | sort -r | \ + while read -r i; do + version=$(echo "${i}" | sed "s/.*Solstice-PP-Sources-\(.*\)\.tar.gz/\1/g") + + echo " <tr>" + echo " <td>${version}</td>" + echo " <td>" + echo " [<a href=\"${i}\">tarball</a>]" + if [ -f "${i}.sig" ]; then + echo " [<a href=\"${i}.sig\">pgp</a>]" + fi + echo " </td>" + echo " </tr>" + done + echo '</table>' +} + +# Build the resources page +resources() +{ + if [ -z "$1" ]; then + printf "Usage: %s resources <version>\n" "$0" + exit 1 + fi + + { + print_header Solstice Resources + echo "<header><h1>Additional resources</h1></header>" + cat solstice-abg.html.in + VERSION=$1 envsubst < solstice-pp.html.in + echo "<h3>Download Post-Processes</h3>" + print_pp_downloads + cat solstice-pp-release-notes.html.in + print_footer + } > solstice-resources.html +} + +"$@"