[merged docbook-xml and other stuff from medborgon Panu Kalliokoski **20040617215217 Keywords: Patches applied: * atehwa@sange.fi--2004-medborgon/stx2any--prod--2--patch-16 merged progress from main * atehwa@sange.fi--2004-medborgon/stx2any--prod--2--patch-17 preparing for docbook-xml output format * atehwa@sange.fi--2004-medborgon/stx2any--prod--2--patch-18 progress, orthogonality * atehwa@sange.fi--2004-medborgon/stx2any--prod--2--patch-19 increased modularity * atehwa@sange.fi--2004-medborgon/stx2any--prod--2--patch-20 docbook-xml format in Makefile * atehwa@sange.fi--2004-medborgon/stx2any--prod--2--patch-21 DocBook XML support 'officially' * atehwa@sange.fi--2004-medborgon/stx2any--prod--2--patch-22 Alternate footnote syntax * atehwa@sange.fi--2004-medborgon/stx2any--prod--2--patch-23 testing docbook-xml (atehwa@sange.fi--2004/stx2any--prod--2--patch-26) ] { addfile ./docbook-xml/make.m4 addfile ./docbook-xml/settings.sh addfile ./html/settings.sh addfile ./latex/settings.sh addfile ./man/settings.sh addfile ./regression/abbrev.docbook-xml addfile ./regression/crossref.docbook-xml addfile ./regression/defn-nest.docbook-xml addfile ./regression/list.docbook-xml addfile ./regression/metadata.docbook-xml addfile ./regression/table.docbook-xml addfile ./regression/underscore.docbook-xml hunk ./Makefile 14 -FORMATS=html man latex +FORMATS=html man latex docbook-xml hunk ./Makefile 39 - $(INSTALL) -m 644 $$i/*.m4 $(LIBDIR)/$$i; \ + $(INSTALL) -m 644 $$i/*.m4 $$i/*.sh $(LIBDIR)/$$i; \ hunk ./TODO 17 + * yhteensopivuus-osio: laajennettavuus, uudelleentoteutukset hunk ./common/common.m4 84 -`pushdef(`w_mylabel', `$1_'w_counter_arabic(`w_index_label'))'dnl +`pushdef(`w_mylabel', `$1.'w_counter_arabic(`w_index_label'))'dnl hunk ./common/inline.sed 2 -s#\[\[ #`'w_beg(footnote)`'#g -s# \]\]#`'w_end(footnote)`'#g +s#\[\[[- ]#`'w_beg(footnote)`'#g +s#[- ]\]\]#`'w_end(footnote)`'#g hunk ./common/inline.sed 7 -s#^{{{$#w_bline(0)`'w_beg(litblock)# +s#^{{{$#w_beg(litblock)# hunk ./docbook-xml/make.m4 1 + +-- section system + +define(`@w_sectlev', 0) +define(`w_set_sect_level', +`ifelse(eval(`$1>'defn(`@w_sectlev')),1, + `define(`@w_sectlev',incr(defn(`@w_sectlev')))'dnl +`w_closew_set_sect_level(`$1')', + eval(`$1<'defn(`@w_sectlev')),1, + `w_closedefine(`@w_sectlev', + decr(defn(`@w_sectlev')))w_set_sect_level(`$1')')') +define(`w_headline', +`w_set_sect_level(decr(`$1'))'dnl +`w_set_sect_level(`$1')$2') + +-- other stuff + +define(`w_paragraph', `w_closedefine(`@w_para_open',t)') +define(`w_open', +`ifelse(defn(`@w_para_flag'),t,)'dnl +`define(`@w_para_flag',)') +define(`w_close', +`ifelse(defn(`@w_para_open'),t,)'dnl +`define(`@w_para_open',)') + +w_define_env(*,`w_close',`w_close') +w_define_env(-,`w_close',`w_close') +w_define_env(#,`w_close',`w_close') +w_define_env(i,`w_closew_open',`w_close') +w_define_env(q,`w_close
w_open',`w_close
') +w_define_env(litblock,`w_close',`w_close') +w_define_env(footnote,`',`') +w_define_env(:, +`w_closepushdef(`@w_varitem_open',)', +`w_closepopdef(`@w_varitem_open')') +define(`w_defnterm', `w_open_varitem$1') +w_define_env(t, +`define(`w_pending_block_hook', `w_closew_open')', +`ifelse(defn(`w_pending_block_hook'),, + `w_closew_close_varitem', + `define(`w_pending_block_hook',)')') +define(`w_open_varitem', +`ifelse(defn(`@w_varitem_open'),,`w_close')'dnl +`define(`@w_varitem_open',t)') +define(`w_close_varitem', +`ifelse(defn(`@w_varitem_open'),t,`w_close')'dnl +`define(`@w_varitem_open',)') + +define(`w_linebr',
) dnl TODO +define(`w_sbreak',
) dnl TODO + +define(`w_literal', `$1') +define(`w_emph', `$1') +define(`w_strong', `$1') +define(`w_quotation', `$1') +w_define_env(center, +`w_closew_open', +`w_close') + +w_define_env(abstract, +`w_close`'w_begdiv(ingr)', +`w_closew_enddiv(ingr)') +w_define_env(comment, `') +define(`w_link', `$2') + +define(`w_make_tablespec', +`ifelse(`$*',,,`'dnl +`w_make_tablespec(shift($@))')') + +w_define_env(table, + +`pushdef(`w_sbreak', + `
')'dnl XXX TODO +`pushdef(`w_linebr', `w_close')'dnl +`pushdef(`w_horizbr', `w_close')'dnl +`w_closew_make_tablespec($@)'dnl +`', + +`w_close'dnl +`popdef(`w_linebr')popdef(`w_horizbr')popdef(`w_sbreak')') + +define(`w_lt', `<') +define(`w_gt', `>') +define(`w_amp', `&') + +define(`w_label', `$2') +define(`w_refer', `$2') + hunk ./docbook-xml/settings.sh 1 +test -z "$NUMBERING" && NUMBERING=off hunk ./docbook-xml/templ.m4 4 -
- - defn(`@w_title') - defn(`@w_author') - +
+ + defn(`@w_title') + defn(`@w_author') + hunk ./docbook-xml/templ.m4 13 -
+w_close`'w_set_sect_level(0) +
hunk ./examples/Stx-doc.txt 46 -The footnote text must be separated from the brackets with a space ( ). +The footnote text must be separated from the brackets with a space ( ) +or a dash (-). hunk ./examples/Stx-ref.txt 33 -[[` 'text` ']], `w_footnote(text)':: +[[` 'text` ']], [[`-'text`-']], `w_footnote(text)':: hunk ./examples/stx2any.txt 16 -PostScript and LaTeX. +PostScript, LaTeX and DocBook XML. hunk ./examples/stx2any.txt 68 - hunk ./examples/stx2any.txt 74 - hunk ./examples/stx2any.txt 78 + docbook-xml:: + produces rudimentary DocBook XML output. Note that + DocBook XML is a good source format but a troubling + destination format. The only good reason I can think of + for transforming _into_ DocBook XML is to have access to + rich semantic markup while being able to use the + abbreviations. See BUGS below for more discussion about + this. hunk ./examples/stx2any.txt 186 -''PREFIX/share/stx2any/{html,man,latex}'':: +''PREFIX/share/stx2any/{html,man,latex,docbook-xml}'':: hunk ./examples/stx2any.txt 208 + +The support for DocBook XML sucks. It is only included because someone +will show up anyway and ask, "hey, does it support *DocBook XML*?" +Partly this sucking is due to my laziness, but partly it is because of +the nature of DocBook. For instance, ''stx2any'' will transform literal +formatting into DocBook Literal elements, but the _point_ of using +DocBook is to convey more information than that - whether it is some +ComputerOutput, UserInput, EnVar, or Application, or... and the result +is still very abstract, not actually meant for humans to read but rather +for computers to process into something readable. Now the truth is that +I doubt you will ever come up with a DSSSL stylesheet whose output +outperforms LaTeX (for publishing on paper) or direct conversion to HTML +(for publishing on the web). The only sensible reason I can think of +for using Stx as a DocBook frontend is the ability to use both DocBook +constructs and Stx abbreviations. hunk ./html/make.m4 2 -define(`w_outputfmt', `html') - hunk ./html/make.m4 18 -`w_setblocktype(n)'dnl hunk ./html/make.m4 21 -w_define_env(litblock, `
', `
') +w_define_env(litblock, `undefine(`@w_para_flag')
', `
') hunk ./html/settings.sh 1 +test -z "$NUMBERING" && NUMBERING=off hunk ./latex/make.m4 2 -define(`w_outputfmt', `latex') - hunk ./latex/settings.sh 1 +test -z "$NUMBERING" && NUMBERING=on +test -z "$PAPERCONF" && PAPERCONF=/etc/papersize +test -z "$PAPERSIZE" && test -f "$PAPERCONF" && \ + PAPERSIZE=`sed '/^#/d' "$PAPERCONF"` +test -z "$PAPERSIZE" && PAPERSIZE=a4 +test -z "$LATEX_PARAMS" && LATEX_PARAMS="${PAPERSIZE}paper,notitlepage" +M4OPTIONS="$M4OPTIONS -D@w_doctype_parms=$LATEX_PARAMS" hunk ./man/make.m4 2 -define(`w_outputfmt', `man') - hunk ./man/make.m4 39 -w_define_env(`litblock', `\fC', `\fP') +w_define_env(`litblock', `w_beg_para\fC', `\fP') hunk ./man/settings.sh 1 +test -z "$NUMBERING" && NUMBERING=off hunk ./regression/abbrev.docbook-xml 1 + + +
+ + + + + +1 headline 1 +1.1 headline 2 +1.1.1 headline 3 +1.1.1.1 headline 4 + +1.2 miscellaneous inline + +end of line, quoted stuff +end of line, emphasised stuff +end of line, strongly emphasised stuff +end of line, literal-formatted stuff. + +quoted stuff, at the beginning of linethis is a footnote +/emphasised / not, another try; nested emphasis for kiddies-- +literal-formatted stuff
+spanning multiple lines
, emphasis +improperly nested emphasis markers +spanning multiple lines for fun + +
very long quoted string +with /inner/ emphasis and other +way *around* for them if you please and +goodies to try (thank you) + +unmatched end-of-emphasis/ marker +"Different * emphasis / characters "" out '' of ''' context '''' j + +proper /path/to/file and its literal cousin, +/path/to/file + +Some */random mixed** emphasis mark*ers and a footnote +that has +multiple lines + +*strongemph*broken by* char +/emphasis/broken by/ char +literal'not broken by char +''literal''broken by'' char +''literal'with quotes'' broken +literal'spanning multiple +lines not broken by char + +*strongemph * broken by* space-sep char +/emphasis / broken by/ space-sep char +One char c emph +One char c strongemph + +(underscores) + +emphasis type 1 +an underscore _ by itself; between_words +double _nested emphasis for_ convenience +This _should_not_ work + +(line breaking) + +// begin +in the // middle +end-line
+end-paragraph
+ +
1.3 footnotes + +footnotesfootnote 1 for your pleasure should be +properly // numbered.footnote 2 Does it not seem to bea word +with very many meanings so? + +Thisfootnote 4 is bad practice +1.3.1 <Footnote><Para>footnote</Para></Footnote> in heading + +text + +1.4 section breaking + +Paragraph followed by adjacent +1.4.1 headline +Paragraph in between +1.4.2 another headline + +Some text + +1.4.3 headline followed by +normal text + +1.4.4 two adjacent +1.4.5 headlines + +Paragraph followed by +
+section marker + +
+
both section markers here are adjacent +
+ +
Some text + +
+
Once more + +
+
+ +
1.5 preformatted + +{{{Block}}} + +Another block: + +content + content + content + + +And then: + + + content + content + +content [empty line above] + +followed by an explanation. + + + + emphasis + strong emphasis + line breaking // + quoted text AFAIK + + multi-line + span stuff + +
+
hunk ./regression/abbrev.html 133 -

+
hunk ./regression/abbrev.html 141
-

+
hunk ./regression/crossref.docbook-xml 1
+
+
+
+ + + + +This goes into the ingress
+ +Making smooth transitions is hard work. It's not worth +hardening the hard; you should look into means of making +things go more smoothly. + +This goes into the ingress + +Thank you for listening... the percussions. + +smooth
+hard
+hard
+percussions
+ +
+
hunk ./regression/crossref.html 9 -This goes into the ingress
+This goes into the ingress
hunk ./regression/crossref.html 11 -

Making smooth transitions is hard work. It's not worth -hardening the hard; you should look into means of making +

Making smooth transitions is hard work. It's not worth +hardening the hard; you should look into means of making hunk ./regression/crossref.html 15 -

This goes into the ingress +

This goes into the ingress hunk ./regression/crossref.html 17 -

Thank you for listening... the percussions. +

Thank you for listening... the percussions. hunk ./regression/crossref.html 19 -

smooth
-hard
-hard
-percussions
+

smooth
+hard
+hard
+percussions
hunk ./regression/crossref.latex 12 -This goes into the ingress (\pageref{ingr_4})\\ +This goes into the ingress (\pageref{ingr.4})\\ hunk ./regression/crossref.latex 15 -Making \label{index_1}smooth transitions is \label{index_2}hard work. It's not worth -hardening the \label{index_3}hard; you should look into means of making +Making \label{index.1}smooth transitions is \label{index.2}hard work. It's not worth +hardening the \label{index.3}hard; you should look into means of making hunk ./regression/crossref.latex 19 -\label{ingr_4}This goes into the ingress +\label{ingr.4}This goes into the ingress hunk ./regression/crossref.latex 21 -Thank you for listening... the \label{index_5}percussions. +Thank you for listening... the \label{index.5}percussions. hunk ./regression/crossref.latex 23 -smooth (\pageref{index_1})\\ -hard (\pageref{index_2})\\ -hard (\pageref{index_3})\\ -percussions (\pageref{index_5})\\ +smooth (\pageref{index.1})\\ +hard (\pageref{index.2})\\ +hard (\pageref{index.3})\\ +percussions (\pageref{index.5})\\ hunk ./regression/defn-nest.docbook-xml 1 + + +

+ + + + + +foo +bar +baz +quux + +hyvin toimii + +foo2 +bar2 +baz2 +quux2 + +huonosti toimii + +foo3 + +flooz +sooz +mooz +booz +dooz +klooz + +foo4 +Kiitos + +foo5 +ekkooo +tokkoo + +Ja vielä: + +foo6 +ekkkooo +tokkoooo + +defnlist + +foo + +nested defn +bar + +nested defn 2 +baz + +continuation +defnlist2 +immediate nested defn +stuff + + +
hunk ./regression/list.docbook-xml 1 + + +
+ + + + + +a +b +c +d +e +f +g # foo +inner +zoo +boo +new list +item2 + +
quote? +
quote? + +
quote? + +
-- interlude -- + +one +two + +three +in a row +for a cow +four +this is so +as definitions go +too low + +final blow +five + +it's alive +
consider quote +
back we go + +
list intercept +this is the term +show some respect +it is so firm +the problem's not here anymore + +term one + +lists are fun +the fun's begun + +term two +definitions, too! +another for you. + +They can have paragraphs + +term three a +term three b +a tree is a tree
+be or not to be? +what's happening to me? +be or not to be? +what can you say? +
what's for the delay? +let's play + +-- interlude 2 -- + +foo +foo2 +bar +bar2 +baz +baz2 +quux +quux2 +fooox +fooox2 +fooox3 +koe + + +
hunk ./regression/metadata.docbook-xml 1 + + +
+ + The Title + Author Name + + +The Title - introduction + +This is the date version. + +
hunk ./regression/run-tests 16 - run_test $base html - run_test $base man - run_test $base latex + for fmt in html man latex docbook-xml; do + run_test $base $fmt + done hunk ./regression/table.docbook-xml 1 + + +
+ + + + + + +Emigration is nice! foo +Immigration is even nicer! bar + + + +account name miscellaneous notes +
+pkalliok
Panu not trustworthy, but a nice fellow overall. Good to +get acquainted with.
+atehwa Panu the same person +root superuser found in every Unix under the sky +
+ + +j", +L J +`_' + + +
hunk ./regression/underscore.docbook-xml 1 + + +
+ + underscore quoting tests + + + +This should receive emphasis +This might not receive emphasis +This _ probably should receive emphasis +Underscores _f nested b_ and between_words + +Continuing multiple +lines should work + +Now it _should +not_ work indeed + +
hunk ./stx2any 12 +M4OPTIONS="-I$BASE/site-packages" hunk ./stx2any 70 -case "$DEVICE" in -html|man) test -z "$NUMBERING" && NUMBERING=off ;; -latex) - test -z "$NUMBERING" && NUMBERING=on - - test -z "$PAPERCONF" && PAPERCONF=/etc/papersize - test -z "$PAPERSIZE" && test -f "$PAPERCONF" && \ - PAPERSIZE=`sed '/^#/d' "$PAPERCONF"` - test -z "$PAPERSIZE" && PAPERSIZE=a4 - test -z "$LATEX_PARAMS" && LATEX_PARAMS="${PAPERSIZE}paper,notitlepage" - M4OPTIONS="$M4OPTIONS -D@w_doctype_parms=$LATEX_PARAMS" - ;; -*) +if test ! -d $BASE/$DEVICE; then hunk ./stx2any 73 -esac +fi + +. $BASE/$DEVICE/settings.sh hunk ./stx2any 93 -m4 $M4OPTIONS \ +m4 -Dw_outputfmt=$DEVICE $M4OPTIONS \ }