]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
updated doc generation
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 10 Feb 2012 14:04:24 +0000 (15:04 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 10 Feb 2012 14:04:24 +0000 (15:04 +0100)
doc/Makefile.am
doc/latex/Makefile.am
doc/scripts/gdoc
doc/scripts/mytexi2latex

index f62cb1e381646cf970dd1185d8b25418b5097ef7..ab00d0a7fc7a2cc915f33c7e8565a0797416736c 100644 (file)
@@ -30,41 +30,41 @@ endif
 
 invoke-gnutls-cli.texi: ../src/cli-args.def
        -cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
-       mv ../src/$@ .
+       mv -f ../src/$@ ../doc
 
 invoke-gnutls-cli-debug.texi: ../src/cli-debug-args.def
        -cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
-       mv ../src/$@ .
+       mv -f ../src/$@ ../doc
 
 invoke-gnutls-serv.texi: ../src/serv-args.def
        -cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
-       mv ../src/$@ .
+       mv -f ../src/$@ ../doc
 
 invoke-certtool.texi: ../src/certtool-args.def
        -cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
-       mv ../src/$@ .
+       mv -f ../src/$@ ../doc
 
 invoke-srptool.texi: ../src/srptool-args.def
        -cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
-       mv ../src/$@ . && \
        sed -i 's/@subsection/@subsubsection/g' $@ && \
-       sed -i 's/@section/@subsection/g' $@
+       sed -i 's/@section/@subsection/g' $@ && \
+       mv -f ../src/$@ ../doc
 
 invoke-ocsptool.texi: ../src/ocsptool-args.def
        -cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
-       mv ../src/$@ .
+       mv -f ../src/$@ ../doc
 
 invoke-psktool.texi: ../src/psk-args.def
        -cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
-       mv ../src/$@ . && \
        sed -i 's/@subsection/@subsubsection/g' $@ && \
-       sed -i 's/@section/@subsection/g' $@
+       sed -i 's/@section/@subsection/g' $@ && \
+       mv -f ../src/$@ ../doc
 
 invoke-p11tool.texi: ../src/p11tool-args.def
        -cd ../src/ && autogen -Tagtexi-cmd.tpl $< && \
-       mv ../src/$@ . && \
        sed -i 's/@subsection/@subsubsection/g' $@ && \
-       sed -i 's/@section/@subsection/g' $@
+       sed -i 's/@section/@subsection/g' $@ && \
+       mv -f ../src/$@ ../doc
 
 info_TEXINFOS = gnutls.texi gnutls-guile.texi
 gnutls_TEXINFOS = gnutls.texi fdl-1.3.texi                             \
index 55482ba08522c67ead24f48df7feceffc19fad1d..f1d6efe80094a41688c1b66c6c5770c3adb00a79 100644 (file)
@@ -4,7 +4,34 @@ TEX_OBJECTS = gnutls.tex macros.tex macros-epub.tex fdl.tex cover.tex gnutls.bib
 GEN_TEX_OBJECTS = cha-preface.tex cha-library.tex cha-intro-tls.tex cha-cert-auth2.tex \
   cha-cert-auth.tex cha-gtls-app.tex sec-tls-app.tex cha-programs.tex cha-support.tex \
   cha-functions.tex error_codes.tex cha-ciphersuites.tex algorithms.tex cha-shared-key.tex \
-  cha-errors.tex alerts.tex cha-internals.tex cha-gtls-examples.tex
+  cha-errors.tex alerts.tex cha-internals.tex cha-gtls-examples.tex \
+  invoke-certtool.tex invoke-gnutls-cli.tex invoke-gnutls-serv.tex \
+  invoke-srptool.tex invoke-psktool.tex invoke-gnutls-cli-debug.tex \
+  invoke-p11tool.tex invoke-ocsptool.tex
+
+invoke-certtool.tex: ../invoke-certtool.texi
+       ../scripts/mytexi2latex $< > $@
+
+invoke-gnutls-cli.tex: ../invoke-gnutls-cli.texi
+       ../scripts/mytexi2latex $< > $@
+
+invoke-gnutls-serv.tex: ../invoke-gnutls-serv.texi
+       ../scripts/mytexi2latex $< > $@
+
+invoke-srptool.tex: ../invoke-srptool.texi
+       ../scripts/mytexi2latex $< > $@
+
+invoke-psktool.tex: ../invoke-psktool.texi
+       ../scripts/mytexi2latex $< > $@
+
+invoke-gnutls-cli-debug.tex: ../invoke-gnutls-cli-debug.texi
+       ../scripts/mytexi2latex $< > $@
+
+invoke-p11tool.tex: ../invoke-p11tool.texi
+       ../scripts/mytexi2latex $< > $@
+
+invoke-ocsptool.tex: ../invoke-ocsptool.texi
+       ../scripts/mytexi2latex $< > $@
 
 cha-preface.tex: ../cha-preface.texi
        ../scripts/mytexi2latex $< > $@
index 0380bbabe131d813bc99412feed0554a59bf3332..a1ab4ab29938efa9a2b66e7e72034f3a33b9ea46 100755 (executable)
@@ -510,6 +510,7 @@ sub output_tex {
        $out =~ s/\%([a-zA-Z\_]+)/{\\bf $1}/g;
        $out =~ s/\@([a-zA-Z\_]+)/{\\bf $1}/g;
        $out =~ s/_/\\_/g;
+        $out =~ s/\$/\\\$/g;
        $out =~ s/#/\\#/g;
        $out =~ s/\n\n/\n/g;
        $out =~ s/\\:/:/g;
index 3638043186263258f299c3f1472206ec45684042..688c04173aa0cad06eb167238f681e324e19b031 100755 (executable)
@@ -118,6 +118,7 @@ while ($line = <FILE>) {
                         $mode = pop(@stack);
                 }
                 $line =~ s/\@item (.+)/\\item $1/g;
+                $line =~ s/\@item/\\item/g;
                $prev_mode = $mode;
         } elsif ($mode == ENUMERATE) {
                 if ($line =~ s/\@end itemize/\\end{enumerate}/g) {
@@ -127,6 +128,7 @@ while ($line = <FILE>) {
                         $mode = pop(@stack);
                 }
                 $line =~ s/\@item(.*)/\\item $1/g;
+                $line =~ s/\@item/\\item/g;
                $prev_mode = $mode;
         } elsif ($mode == FLOAT) {
                 if ($line =~ s/\@end float/\\label\{$label\}\n\\end{figure}/g) {
@@ -271,6 +273,11 @@ multitable:
                         push(@stack, NORMAL);
                        next;
                 }
+                if ($line =~ s/\@ignore//g) {
+                        $mode = SKIP;
+                        push(@stack, NORMAL);
+                       next;
+                }
                 if ($line =~ s/\@ifnottex//g) {
                         $mode = SKIP;
                         push(@stack, NORMAL);
@@ -314,7 +321,7 @@ multitable:
                         push(@stack, NORMAL);
                         $mode = MULTITABLE;
                 }
-                if ($line =~ s/\@example/\\begin{example}/g) {
+                if ($line =~ s/\@example$/\\begin{example}/g) {
                         push(@stack, NORMAL);
                         $mode = EXAMPLE;
                 }
@@ -342,6 +349,7 @@ multitable:
                $line =~ s/\@image\{($match+)\,($match+)\}/\\includegraphics\[width\=$2\]\{\.\.\/$1\}/g;
                $line =~ s/\@samp\{($spacematch+)\}/$1/g;
                $line =~ s/\@strong\{/\{\\bf /g;
+               $line =~ s/\@exampleindent.*//g;
                $line =~ s/\@c (.*)/\% $1/g;
                $line =~ s/\@math\{($mathmatch+)\}/\$$1\$/g;
                $line =~ s/\@acronym\{($spacematch+)\}/\\acronym{$1}/g;
@@ -354,12 +362,13 @@ multitable:
                        $line =~ s/(\\input)\{($underscorematch+)\}/$punescape->($1,$2)/ge;
                }
                $line =~ s/\@cindex (.+)/\\index{$1}/g;
+               $line =~ s/\@pindex (.+)/\\index{$1}/g;
                $line =~ s/\@url\{($underscorematch+)\}/\\url{$1}/g;
                #$line =~ s/\@euro/\\euro/g;
                $line =~ s/\s*\@euro\{\}/\~\\textgreek\{\\euro\}/g;
                $line =~ s/\@page/\\newpage/g;
                $line =~ s/\@file\{($spacematch+)\}/\\file{$1}/g;
-               $line =~ s/\@code\{($codematch+)\}/\\code{$1}/g;
+               $line =~ s/\@code\{/\\code{/g;
                $line =~ s/\@option\{($codematch+)\}/\\command{$1}/g;
                $line =~ s/\@command\{($codematch+)\}/\\command{$1}/g;
                $line =~ s/\@ref\{/\\myref\{/g;
@@ -380,6 +389,7 @@ multitable:
                #when a myref{} contains underscores remove them
                $line =~ s/(\\myref)\{($underscorematch+)\}/$punescape->($1,$2)/ge;
        }
+       $line =~ s/\@\@/\@/g;
 
         print $line;
 }