diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-02-13 20:06:27 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-02-13 20:06:27 +0300 |
commit | ae36dc4b52bf4aa4036b7e74ecd45b56885a58bb (patch) | |
tree | 84e751b0295bfd7a281ac418604b4fc186872922 | |
parent | 215dc2a3e79ed3798630e6207062b441cfffdd65 (diff) |
Add doc/doc.sh
-rw-r--r-- | doc/cli-epilogue.1 | 2 | ||||
-rw-r--r-- | doc/cli-epilogue.xhtml | 2 | ||||
-rw-r--r-- | doc/cli-prologue.xhtml | 2 | ||||
-rw-r--r-- | doc/cli.1 | 2 | ||||
-rw-r--r-- | doc/cli.xhtml | 4 | ||||
-rwxr-xr-x | doc/doc.sh | 78 | ||||
-rw-r--r-- | doc/guide/.gitignore | 2 |
7 files changed, 86 insertions, 6 deletions
diff --git a/doc/cli-epilogue.1 b/doc/cli-epilogue.1 index 875c6da..5e2ffae 100644 --- a/doc/cli-epilogue.1 +++ b/doc/cli-epilogue.1 @@ -14,7 +14,7 @@ Send bug reports to the cli-users@codesynthesis.com mailing list. .\" COPYRIGHT .\" .SH COPYRIGHT -Copyright (c) 2009-2019 Code Synthesis Tools CC. +Copyright (c) $copyright$. Permission is granted to copy, distribute and/or modify this document under the terms of the MIT License. Copy of this license can be obtained from diff --git a/doc/cli-epilogue.xhtml b/doc/cli-epilogue.xhtml index 5a30071..8a70d81 100644 --- a/doc/cli-epilogue.xhtml +++ b/doc/cli-epilogue.xhtml @@ -11,7 +11,7 @@ </div> <div id="footer"> - © 2009-2019 <a href="http://www.codesynthesis.com">Code Synthesis Tools CC</a> + Copyright © $copyright$. <div id="terms"> Permission is granted to copy, distribute and/or modify this diff --git a/doc/cli-prologue.xhtml b/doc/cli-prologue.xhtml index 923fe63..9a57f0e 100644 --- a/doc/cli-prologue.xhtml +++ b/doc/cli-prologue.xhtml @@ -4,7 +4,7 @@ <head> <title>CLI 1.2.0 Compiler Command Line Manual</title> - <meta name="copyright" content="© 2009-2019 Code Synthesis Tools CC"/> + <meta name="copyright" content="© $copyright$"/> <meta name="keywords" content="cli,command,line,interface,compiler,c++"/> <meta name="description" content="CLI Compiler Command Line Manual"/> @@ -405,7 +405,7 @@ Send bug reports to the cli-users@codesynthesis.com mailing list. .\" COPYRIGHT .\" .SH COPYRIGHT -Copyright (c) 2009-2019 Code Synthesis Tools CC. +Copyright (c) 2009-2020 Code Synthesis Tools CC. Permission is granted to copy, distribute and/or modify this document under the terms of the MIT License. Copy of this license can be obtained from diff --git a/doc/cli.xhtml b/doc/cli.xhtml index bc3aa5e..efd8337 100644 --- a/doc/cli.xhtml +++ b/doc/cli.xhtml @@ -4,7 +4,7 @@ <head> <title>CLI 1.2.0 Compiler Command Line Manual</title> - <meta name="copyright" content="© 2009-2019 Code Synthesis Tools CC"/> + <meta name="copyright" content="© 2009-2020 Code Synthesis Tools CC"/> <meta name="keywords" content="cli,command,line,interface,compiler,c++"/> <meta name="description" content="CLI Compiler Command Line Manual"/> @@ -555,7 +555,7 @@ arg+{ --foo } # 'arg+{' ...</pre> </div> <div id="footer"> - © 2009-2019 <a href="http://www.codesynthesis.com">Code Synthesis Tools CC</a> + Copyright © 2009-2020 Code Synthesis Tools CC. <div id="terms"> Permission is granted to copy, distribute and/or modify this diff --git a/doc/doc.sh b/doc/doc.sh new file mode 100755 index 0000000..df577cc --- /dev/null +++ b/doc/doc.sh @@ -0,0 +1,78 @@ +#! /usr/bin/env bash + +version=1.2.0-b.6 + +trap 'exit 1' ERR +set -o errtrace # Trap in functions. + +function info () { echo "$*" 1>&2; } +function error () { info "$*"; exit 1; } + +date="$(date +"%B %Y")" +copyright="$(sed -n -re 's%^Copyright \(c\) (.+)\.$%\1%p' ../LICENSE)" + +while [ $# -gt 0 ]; do + case $1 in + --clean) + rm -f cli.xhtml cli.1 + rm -f guide/cli-guide.ps guide/cli-guide.pdf + exit 0 + ;; + *) + error "unexpected $1" + ;; + esac +done + +function compile () # <input-name> <output-name> +{ + local i=$1; shift + local o=$1; shift + + # Use a bash array to handle empty arguments. + # + local ops=() + while [ $# -gt 0 ]; do + ops=("${ops[@]}" "$1") + shift + done + + # --html-suffix .xhtml + cli -I .. \ +-v project="cli" \ +-v version="$version" \ +-v date="$date" \ +-v copyright="$copyright" \ +"${ops[@]}" --generate-html --stdout \ +--html-prologue-file cli-prologue.xhtml \ +--html-epilogue-file cli-epilogue.xhtml \ +"../cli/$i.cli" >"$o.xhtml" + + # --man-suffix .1 + cli -I .. \ +-v project="cli" \ +-v version="$version" \ +-v date="$date" \ +-v copyright="$copyright" \ +"${ops[@]}" --generate-man --stdout \ +--man-prologue-file cli-prologue.1 \ +--man-epilogue-file cli-epilogue.1 \ +"../cli/$i.cli" >"$o.1" +} + +compile options cli --suppress-undocumented + +# Manual. +# + +#function compile_doc () +#{ +# html2ps -f doc.html2ps:a4.html2ps -o "$n-a4.ps" "$n.xhtml" +# ps2pdf14 -sPAPERSIZE=a4 -dOptimize=true -dEmbedAllFonts=true "$n-a4.ps" "$n-a4.pdf" +# +# html2ps -f doc.html2ps:letter.html2ps -o "$n-letter.ps" "$n.xhtml" +# ps2pdf14 -sPAPERSIZE=letter -dOptimize=true -dEmbedAllFonts=true "$n-letter.ps" "$n-letter.pdf" +#} + +html2ps -f guide/guide.html2ps -o guide/cli-guide.ps guide/index.xhtml +ps2pdf14 -dOptimize=true -dEmbedAllFonts=true guide/cli-guide.ps guide/cli-guide.pdf diff --git a/doc/guide/.gitignore b/doc/guide/.gitignore new file mode 100644 index 0000000..239cc7f --- /dev/null +++ b/doc/guide/.gitignore @@ -0,0 +1,2 @@ +*.ps +*.pdf |