Search
j0ke.net Open Build Service
>
Projects
>
ha
>
yodl
> yodl-contrib.diff
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File yodl-contrib.diff of Package yodl
diff -x 'build.pl*' -uNr yodl-2.11/contrib/Makefile yodl/contrib/Makefile --- yodl-2.11/contrib/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ yodl/contrib/Makefile 2006-06-02 08:36:12.000000000 +0200 @@ -0,0 +1,47 @@ +# Set some paths. We pick either EBASE or /usr/local/bin. +# Or you have specified PREFIX before running this make. +PREFIX = $(EBASE) +PREFIX ?= /usr/local/bin +EBINDIR = $(PREFIX)/bin + +foo: + @echo 'There is no default action in contrib/' + @echo 'You can only "make install" or "make clean" here.' + @exit 1 + +install: $(EBINDIR)/yo2whatever $(EBINDIR)/yo2html $(EBINDIR)/yo2man \ + $(EBINDIR)/yo2pdf $(EBINDIR)/yo2manless \ + $(EBASE)/share/yodl/SiteLocal.yo \ + $(EBASE)/doc/yodl.pdf $(EBASE)/doc/yodl.html + +$(EBINDIR)/yo2whatever: yo2whatever + cp yo2whatever $(EBINDIR)/yo2whatever + chmod +x $(EBINDIR)/yo2whatever + +$(EBINDIR)/yo2html: $(EBINDIR)/yo2whatever + cd $(EBINDIR) && ln -sf yo2whatever yo2html + +$(EBINDIR)/yo2man: $(EBINDIR)/yo2whatever + cd $(EBINDIR) && ln -sf yo2whatever yo2man + +$(EBINDIR)/yo2manless: $(EBINDIR)/yo2whatever + cd $(EBINDIR) && ln -sf yo2whatever yo2manless + +$(EBINDIR)/yo2pdf: $(EBINDIR)/yo2whatever + cd $(EBINDIR) && ln -sf yo2whatever yo2pdf + +$(EBASE)/share/yodl/SiteLocal.yo: SiteLocal.yo + cp $< $@ + +$(EBASE)/doc/yodl.pdf: yodl.pdf + cp yodl.pdf $(EBASE)/doc +yodl.pdf: yodl.yo + yo2pdf yodl.yo + +$(EBASE)/doc/yodl.html: yodl.html + cp yodl.html $(EBASE)/doc +yodl.html: yodl.yo + yo2html yodl.yo + +clean: + rm -f yodl.{latex,toc,pdf,log,html,aux} diff -x 'build.pl*' -uNr yodl-2.11/contrib/SiteLocal.yo yodl/contrib/SiteLocal.yo --- yodl-2.11/contrib/SiteLocal.yo 1970-01-01 01:00:00.000000000 +0100 +++ yodl/contrib/SiteLocal.yo 2006-06-02 08:36:12.000000000 +0200 @@ -0,0 +1,88 @@ +COMMENT( + + Local Yodl Macros + ================= + +Here's a sample "local config" file that gets installed into +/usr/e/share/yodl. You can use this as an example to cook your +own. E.g., you'll want to a use different affiliation, mailto, and so +on. + +Also, the shown latexlayoutcmds() probably won't be what you like to +see... Good luck! +-- [KK 2004-11-17] + +) + +COMMENT(General document modifiers) +htmlstylesheet(http://www.e-tunity.com/css/yodl.css) +affiliation(e-tunity) +mailto(info@e-tunity.com) +latexlayoutcmds( + \usepackage{a4wide} + \usepackage{fancyhdr} + \usepackage{graphicx} + \usepackage{moreverb} + \usepackage{palatino} + \setlength{\textheight}{21cm} + \setlength{\parindent}{0pt} + \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex} + \renewcommand{\headrulewidth}{.6pt} + \renewcommand{\footrulewidth}{.6pt} + \fancypagestyle{plain}{ + \fancyhf{} + \fancyhead[LE,RO]{} + \fancyhead[LO]{\small\slshape \leftmark} + \fancyhead[RE]{\small\slshape \rightmark} + \fancyfoot[LE,RO]{\small\thepage} + \fancyfoot[RE,LO]{\small\textbf{e-tunity}} + } + \AtBeginDocument{\pagestyle{plain}}) +setfigureext(.png) +sethtmlfigureext(.png) + +COMMENT(pngfig (basename-without-extension) (caption) (label) + A-la figure() but includes the true png. We can do that + because we use pdflatex.) + +redef(pngfig)(3)(\ + whenhtml(figure(ARG1)(ARG2)(ARG3))\ + whenlatex(\ + latexcommand(\begin{figure}[htbp])\ + latexcommand(\centerline{)\ + latexcommand(\includegraphics[scale=.5]{)\ + ARG1.png+\ + latexcommand(}})\ + latexcommand(\caption{\small )ARG2+latexcommand(})\ + latexcommand(\label{)ARG3+latexcommand(})\ + latexcommand(\end{figure})) + whenman(verb( + ===================================================== + Insert figure ARG1 about here + ARG2 + =====================================================)\ + label(ARG3))) + +COMMENT(listing(text) + A-la verb() but nicely formatted in LaTeX.) + +redef(listing)(1)(\ + whenhtml(verb(ARG1))\ + whenlatex(\ + PUSHCHARTABLE() + latexcommand(\begin{listing}{1})\ + XXnl()\ + NOEXPAND(ARG1)\ + XXnl()\ + latexcommand(\end{listing}) + POPCHARTABLE())\ + whenman(\ + XXroffcmd(.nf)()()()\ + INTERNALINDEX(verb on)\ + NOEXPAND(ARG1)\ + INTERNALINDEX(verb off)\ + XXroffcmd(.fi)()()())) + + +def(kkstyle)(0)(\ + TYPEOUT(kkstyle deprecated -- please remove from your source!)) diff -x 'build.pl*' -uNr yodl-2.11/contrib/yo2whatever yodl/contrib/yo2whatever --- yodl-2.11/contrib/yo2whatever 1970-01-01 01:00:00.000000000 +0100 +++ yodl/contrib/yo2whatever 2006-06-02 08:36:12.000000000 +0200 @@ -0,0 +1,144 @@ +#!/usr/bin/perl + +use strict; + +# Config +my $verbose = 1; # Verbosity level +my @yodlincs = ('/usr/e/share/yodl', # Yodl macro dirs + '/Users/e/share/yodl', + '/usr/local/share/yodl', + '/usr/share/yodl'); +my $yodlinc; # Actually found +my $progname; # This script +my $format; # Output format +my $input; # Input file + +# Verbose messaging +sub chat { + print STDERR ("$progname: ", @_) if ($verbose); +} + +# Usage info +sub usage () { + die <<"ENDUSAGE"; + +This is yo2{html,pdf,man,manless}: Yodl Afterburner processing. +Usage: yo2{format} [FLAGS] inputfile[.yo] +Where: FLAGS + are Yodl processing flags. Run 'yodl' without arguments + to see an overview. + inputfile[.yo] + is the file to process. Default extension is .yo. +This processor will also include 'SiteLocal.yo' in the processing run, +if this site-specific file is found one of the directories +'@yodlincs'. + +ENDUSAGE +} + +# Force an extension onto a file. +sub setext ($$) { + my $file = shift; + my $ext = shift; + my $ret = $file; + + $ret =~ s/\.[^.\/]*$//; + $ret .= ".$ext"; + chat ("Extension $ext for $file: $ret\n"); + return ($ret); +} + +# Run a system command. +sub run { + chat ("Running: @_\n"); + my $ret = system (@_); + my $exitval = $ret >> 8; + my $sigval = $ret & 127; + + die ("$progname: $_[0] caught signal $sigval\n") if ($sigval); + die ("$progname: $_[0] stopped with $exitval\n") if ($exitval); +} + +# Main starts here +# ---------------- + +# Determine output format and program name. +$progname = $0; +$progname =~ s{.*/}{}; +$format = $progname; +$format =~ s{yo2}{}; +chat ("Output format: $format\n"); + +# Try and locate a yodl inc dir. +for my $d (@yodlincs) { + if (-d $d) { + $yodlinc = $d; + chat ("Using include directory: '$yodlinc'\n"); + last; + } +} +chat "yodlinc: $yodlinc\n"; + +# Need args. +usage() if ($#ARGV == -1); + +# Determine input, add site-stuff to processing +$input = pop(@ARGV); +chat ("Input file: $input\n"); +if (-f "$yodlinc/SiteLocal.yo") { + push (@ARGV, 'SiteLocal'); + chat ("Site-specific SiteLocal.yo will be included in processing\n"); +} + +# If we're in simple output (onestep) mode, then run it now. +if ($format eq 'html' or $format eq 'man' or $format eq 'manless') { + chat ("Converting to $format.\n"); + + # In 'man | less' mode, run yodl2man. Otherwise, run the real converter. + if ($format eq 'manless') { + run ("yodl2man", '-v', @ARGV, $input); + } else { + run ("yodl2$format", '-v', @ARGV, $input); + } + + # For 'manless', pipe to less now. + if ($format eq 'manless') { + my $manf = setext ($input, 'man'); + die ("$progname: no output '$manf' found\n") unless (-f $manf); + run ("groff -Tascii -man $manf | less"); + unlink ($manf); + } + exit (0); +} + +# We're not in onestep output mode, it must be the LaTeX route. +# Go to the startdir of the input file. +my $dir = $input; +$dir =~ s/[^\/]*$//; +if ($dir) { + chat ("Working directory: $dir\n"); + chdir ($dir) or die ("$progname: cannot cd to $dir: $!\n"); +} + +# Always run the LaTeX conversion. +chat ("Converting to LaTeX.\n"); +run ('yodl2latex', '-v', @ARGV, $input); + +# Now it can be only PDF processing. +chat ("Converting to PDF.\n"); +my $ltx = setext ($input, 'latex'); +my $pdf = setext ($input, 'pdf'); +run ('pdflatex', $ltx, $pdf); +run ('pdflatex', $ltx, $pdf); +run ('pdflatex', $ltx, $pdf); + +# Any unresolved references? +my $log = setext ($input, 'log'); +if (open (my $if, $log)) { + while (<$if>) { + die ("$progname: ", $_) if (/There were undefined references/); + } + close ($if); +} + +# unlink ($ltx); diff -x 'build.pl*' -uNr yodl-2.11/contrib/yodl.yo yodl/contrib/yodl.yo --- yodl-2.11/contrib/yodl.yo 1970-01-01 01:00:00.000000000 +0100 +++ yodl/contrib/yodl.yo 2006-06-02 08:36:12.000000000 +0200 @@ -0,0 +1,105 @@ +abstract(This document describes e-tunity's repackaging of Yodl, + a document language used in most of e-tunity's documents.) +article(Yodl) + (Karel Kubat) + (2004 ff.) + +sect(Introduction) + + Yodl is a document-oriented macro language, used by e-tunity for + techical and other documentation. This package is e-tunity's + 'repackaging' of Yodl. + + Yodl in its original form is maintained by Frank Brokken of the + Univ. of Groningen, Netherlands. The original Yodl sources are at + the ftp site + lurl(ftp://ftp.rug.nl/contrib/frank). We (e-tunity) repackaged + Yodl for internal usage. If you want to run tt(make + documentation) on one of our public source packages, then chances + are that you'll require Yodl. + +sect(Obtaining Yodl) + + If you only need Yodl to (re)make e-tunity documentation, then you + can just as well pull the docs off our public site + lurl(http://public.e-tunity.com). But if you want to update this + documentation, or create your own using a similar approach, then + you're welcome to use this package. + + You can of course get Yodl from the original sources. However, the + easier approach is to pull tt(yodl-X.YY.tar.gz) or + tt(yodl-X.YY*rpm) off lurl(http://public.e-tunity.com). The former + is a source archive, which spills into its own subdirectory + tt(yodl/) where you can run tt(make). The latter is an RPM which + installs using the Redhat Package Manager tt(rpm). + + subsect(Prerequisites) + + Prerequisites for a successful installation are: + + itemization( + it() The e-tunity "base package", that sets up the user + tt(e) (with the appropriate directories tt(/usr/e), + tt(/usr/e/bin) and so on); + + it() tt(pdflatex), a LaTeX() variant to produce PDF's.; + + it() The directory tt(/usr/e/share/man) in the setting of + the environment variable tt(MANPATH). This makes sure that + tt(man yodl) etc. will work.) + +sect(Using Yodl) + + Having installed Yodl, a tt(*.yo) document can be converted to + several formats: + + itemization( + it() tt(yo2html) produces an HTLM document; + it() tt(yo2pdf) produces PDF; + it() tt(yo2man) produces a tt(troff) document; + it() tt(yo2manless) does the same, but shows the output via + the pager tt(less).) + + The e-tunity repackaging provides the following extra Yodl + capabilities: + + itemization( + it() The file tt(/usr/e/share/yodl/SiteLocal.yo) is included + in each processing run. This file is set up to hold + site-specific macros. E.g., at our site, the tt(affiliation()) + is defined. + + it() This local file also requires the LaTeX() package + tt(graphicx) to be present. The package then defines a macro + tt(pngfig) (also defined in tt(SiteLocal.yo)), requiring + three arguments: + + itemization( + it() The base name (without extension) of a tt(.png) + figure to include in the document; + it() The caption of the figure; + it() A label for future referencing.) + + E.g., after inclusion of tt(SiteLocal.yo) (which is automatic + if you use the converters tt(yo2*)), a figure can be created + using: + + verb(\ +figure(hist)(Histograms of sales in 2003)(fighist) + +In figure ref(fighist) the bla bla bla....) + + This will include tt(hist.png) in both output document formats + PDF and HTML. + + it() Furthermore, the LaTeX() package tt(moreverb) is + used. Using that, a Yodl macro tt(listing()) is defined, which + functions just like tt(verb()), except that in LaTeX() output + the listing is prefixed with line numbers, and tabs are + expanded to multiples of 8.) + + subsect(Other information sources) + + For the full spectrum of Yodl macros, the language itself and + so on, try tt(man yodl), tt(man yodlmacros) and so on. These + manpages are also included in this package.