summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2013-12-01 21:45:29 +0000
committermstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2013-12-01 21:45:29 +0000
commit823702fb40ab6283fdb9375bb2e3dc6ea680c3ec (patch)
tree1a4a6d73c74326ed4ea9361540285617048e5c96
parent9ede441dd7c2a681d1adeacf4e879972c86db310 (diff)
tex: tweak generated output file names
Tweak output to match oasis requirements. Make it possible to specify output name through environment, and set draft stage and version automatically. Add script to export all files in a zip archive. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@142 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
-rwxr-xr-xmakeall.sh17
-rwxr-xr-xmakehtml.sh4
-rwxr-xr-xmakepdf.sh4
-rw-r--r--specvars.tex32
-rw-r--r--title.tex6
-rw-r--r--virtio-html.tex1
-rw-r--r--virtio.tex1
7 files changed, 55 insertions, 10 deletions
diff --git a/makeall.sh b/makeall.sh
new file mode 100755
index 0000000..dbdfd73
--- /dev/null
+++ b/makeall.sh
@@ -0,0 +1,17 @@
+export SPECDOC=${SPECDOC:-virtio-v1.0-wd01}
+rm -f $SPECDOC
+git archive --format=zip --prefix=tex/ -o $SPECDOC.zip HEAD
+zip -d $SPECDOC.zip tex/.gitattributes
+./makehtml.sh
+./makepdf.sh
+zip $SPECDOC.zip $SPECDOC.pdf
+mkdir -p listings
+cp virtio-ring.h listings/virtio_ring.h
+zip $SPECDOC.zip listings/virtio_ring.h
+echo Generated file $SPECDOC.zip
+echo To change output file name, set SPECDOC environment variable
+echo Examples:
+echo SPECDOC=virtio-v1.0-wd01 $0
+echo SPECDOC=virtio-v1.0-csd01 $0
+echo SPECDOC=virtio-v1.0-csprd01 $0
+echo SPECDOC=virtio-v1.0-os $0
diff --git a/makehtml.sh b/makehtml.sh
index f322780..bb82703 100755
--- a/makehtml.sh
+++ b/makehtml.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-SPECDOC=virtio-v1.0-csd01
+SPECDOC=${SPECDOC:-virtio-v1.0-csd01}
cp virtio-html.tex $SPECDOC.tex
@@ -8,6 +8,8 @@ cp virtio-html.tex $SPECDOC.tex
#PATH=./t4ht-workaround:${PATH} htlatex $SPECDOC.tex "virtiohtml,info,charset=utf-8" " -cunihtf -utf8"
htlatex $SPECDOC.tex "virtio-html,info,charset=utf-8" " -cunihtf -utf8"
+rm $SPECDOC.tex
+
rm $SPECDOC.aux
mv $SPECDOC.html $SPECDOC.tmp1
diff --git a/makepdf.sh b/makepdf.sh
index d0bae33..0e2a8f2 100755
--- a/makepdf.sh
+++ b/makepdf.sh
@@ -1,8 +1,8 @@
#!/bin/sh
-SPECDOC=virtio-v1.0-csd01
+SPECDOC=${SPECDOC:-virtio-v1.0-csd01}
-rm $SPECDOC.aux
+rm $SPECDOC.aux $SPECDOC.pdf
xelatex --jobname $SPECDOC virtio.tex
xelatex --jobname $SPECDOC virtio.tex
xelatex --jobname $SPECDOC virtio.tex
diff --git a/specvars.tex b/specvars.tex
index 44e9383..accfc66 100644
--- a/specvars.tex
+++ b/specvars.tex
@@ -1,10 +1,34 @@
% define VIRTIO Working Draft number and date
\newcommand{\virtiorev}{1.0}
-\newcommand{\virtiodraftstage}{csd}
-\newcommand{\virtiodraftstagename}{Committee Specification Draft}
-\newcommand{\virtioversion}{Virtual I/O Device (VIRTIO) Version \virtiorev}
-\newcommand{\virtioworkingdraft}{01}
\newcommand{\virtioworkingdraftdate}{05 Nov 2013}
+\newcommand{\virtioworkingdraft}{01}
+\newcommand{\virtiodraftstage}{wd}
+\newcommand{\virtiodraftstagename}{Working Draft}
+% Detect current stage and version based on document name
+\IfSubStr{\jobname}{-wd}{
+\renewcommand{\virtioworkingdraft}{\StrBehind{\jobname}{-wd}}
+}
+\IfSubStr{\jobname}{-os}{
+\renewcommand{\virtiodraftstage}{os}
+\renewcommand{\virtiodraftstagename}{OASIS Standard}
+\newcommand{\virtioworkingdraft}{}
+}
+\IfSubStr{\jobname}{-cs}{
+\renewcommand{\virtiodraftstage}{cs}
+\renewcommand{\virtiodraftstagename}{Committee Specification}
+\renewcommand{\virtioworkingdraft}{}
+}
+\IfSubStr{\jobname}{-csd}{
+\renewcommand{\virtiodraftstage}{csd}
+\renewcommand{\virtiodraftstagename}{Committee Specification Draft}
+\renewcommand{\virtioworkingdraft}{\StrBehind{\jobname}{-csd}}
+}
+\IfSubStr{\jobname}{-csprd}{
+\renewcommand{\virtiodraftstage}{csprd}
+\renewcommand{\virtiodraftstagename}{Committee Specification Public Review Draft}
+\renewcommand{\virtioworkingdraft}{\StrBehind{\jobname}{-csprd}}
+}
+\newcommand{\virtioversion}{Virtual I/O Device (VIRTIO) Version \virtiorev}
\newcommand{\virtiospecfile}{virtio-v\virtiorev-\virtiodraftstage\virtioworkingdraft}
\newcommand{\virtiourlbase}{http://docs.oasis-open.org/virtio/virtio/\virtiorev/\virtiodraftstage\virtioworkingdraft}
\newcommand{\virtioworkproduct}{Standards Track Work Product}
diff --git a/title.tex b/title.tex
index 56bd334..e0cabbc 100644
--- a/title.tex
+++ b/title.tex
@@ -15,7 +15,7 @@
\begin{oasistitlesection}{This version}
\url{\virtiourlbase/\virtiospecfile.pdf} (Authoritative)\newline
-\url{virtiourlbase/\virtiospecfile-html.html}
+\url{virtiourlbase/\virtiospecfile.html}
\end{oasistitlesection}
\begin{oasistitlesection}{Previous version}
@@ -24,7 +24,7 @@ N/A
\begin{oasistitlesection}{Latest version}
\url{http://docs.oasis-open.org/virtio/virtio/\virtiorev/virtio-v\virtiorev.pdf} (Authoritative)\newline
-\url{http://docs.oasis-open.org/virtio/virtio/\virtiorev/virtio-v\virtiorev-html.html}
+\url{http://docs.oasis-open.org/virtio/virtio/\virtiorev/virtio-v\virtiorev.html}
\end{oasistitlesection}
\begin{oasistitlesection}{Technical Committee}
@@ -93,7 +93,7 @@ When referencing this specification the following citation format should be used
\textbf{[VIRTIO-v\virtiorev]}\newline
\textit{\virtioversion}. \virtioworkingdraftdate.\newline OASIS
Standard.
-\url{\virtiourlbase/\virtiospecfile-html.html}.
+\url{\virtiourlbase/\virtiospecfile.html}.
\end{oasistitlesection}
\vfill\newpage
diff --git a/virtio-html.tex b/virtio-html.tex
index fd9d252..f0e6581 100644
--- a/virtio-html.tex
+++ b/virtio-html.tex
@@ -30,6 +30,7 @@
\usepackage{xifthen}
\usepackage{tabularx}
\usepackage{underscore}
+\usepackage{xstring}
\usepackage[utf8x]{inputenc}
diff --git a/virtio.tex b/virtio.tex
index 39a2c06..c830dbc 100644
--- a/virtio.tex
+++ b/virtio.tex
@@ -36,6 +36,7 @@
\usepackage{etoolbox}
\usepackage{tabularx}
\usepackage{underscore}
+\usepackage{xstring}
% This is an alternative to package underscore above
% It makes it possible to disable hyphenation of upper-case
% identifiers with underscore (of which we have many) by