Commit b114f659 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2005-04-28 12:09:45 by mburelle] FO documentation : Modify Makfile in order to build upon files

modifications. Add pdf outline (with fo-extensions from fop !) Add
link in TOC Align page numbers on right in TOC        Marwan Burelle.

Original author: mburelle
Date: 2005-04-28 12:09:46+00:00
parent eed8b675
......@@ -3,25 +3,46 @@ JAVA_HOME=/usr/java/jre1.5.0
VERSION=0.3.2
CDUCE=../cduce
FOP=fop-0.20.5/fop.sh
# FOP=fop
all: manual_pdf tutorial_pdf
all: manual.pdf tutorial.pdf
tutorial:
(cd ../../web && $(CDUCE) ../doc/fomanual/xml2fo.cd \
--arg tutorial.xml tutorial_fo.xml $(VERSION))
# tutorial:
# (cd ../../web && $(CDUCE) ../doc/fomanual/xml2fo.cd \
# --arg tutorial.xml tutorial_fo.xml $(VERSION))
manual:
(cd ../../web && $(CDUCE) ../doc/fomanual/xml2fo.cd \
--arg manual.xml manual_fo.xml $(VERSION))
# manual:
# (cd ../../web && $(CDUCE) ../doc/fomanual/xml2fo.cd \
# --arg manual.xml manual_fo.xml $(VERSION))
tutorial.fo: xml2fo.cd ../../web/tutorial.xml ../../web/tutorial/*.xml
(cd ../../web && ${CDUCE} ../doc/fomanual/xml2fo.cd \
--arg tutorial.xml tutorial.fo ${VERSION})
tutorial_pdf: tutorial
$(FOP) tutorial_fo.xml tutorial.pdf
manual.fo: xml2fo.cd ../../web/manual.xml ../../web/manual/*.xml
(cd ../../web && ${CDUCE} ../doc/fomanual/xml2fo.cd \
--arg manual.xml manual.fo ${VERSION})
manual_pdf: manual
$(FOP) manual_fo.xml manual.pdf
# tutorial_pdf: tutorial
# $(FOP) tutorial_fo.xml tutorial.pdf
# manual_pdf: manual
# $(FOP) manual_fo.xml manual.pdf
install:
scp manual.pdf tutorial.pdf cduce@di.ens.fr:public_html/papers/
.SUFFIXES: .fo .pdf
.fo.pdf:
${FOP} $< $*.pdf
clean::
rm -f *~
rm -f tutorial_fo.xml manual_fo.xml
rm -f tutorial.fo manual.fo
rm -f tutorial.pdf manual.pdf
#
# END
#
\ No newline at end of file
(* This file has been automatically by dtd2cduce *)
namespace rx = "http://www.renderx.com/XSL/Extensions"
namespace fox = "http://xml.apache.org/fop/extensions"
namespace fo = "http://www.w3.org/1999/XSL/Format"
......@@ -234,8 +235,13 @@ type rx:page-device =
];;
type rx:meta-field = <rx:meta-field value=String name=String>[ ];;
type rx:meta-info = <rx:meta-info>[ rx:meta-field+ ];;
(* FOP extensions, very simple*)
type fox:outline = <fox:outline internal-destination=?String>[fox:label fox:outline*]
type fox:label = <fox:label>[PCDATA]
type root =
<fo:root z-index=?String visibility=?("visible" | "hidden" | "collapse" | "inherit") hyphenation-remain-character-count=?String hyphenation-push-character-count=?String hyphenation-character=?String hyphenate=?("false" | "true" | "inherit") xml:lang=?String script=?String language=?String country=?String hyphenation-ladder-count=?String hyphenation-keep=?("auto" | "column" | "page" | "inherit") widows=?String orphans=?String page-break-inside=?("avoid" | "auto" | "inherit") keep-together\.within-page=?String keep-together\.within-column=?String keep-together\.within-line=?String keep-together=?String page-break-before=?("auto" | "always" | "avoid" | "left" | "right" | "inherit") page-break-after=?("auto" | "always" | "avoid" | "left" | "right" | "inherit") keep-with-previous\.within-page=?String keep-with-previous\.within-column=?String keep-with-previous\.within-line=?String keep-with-previous=?String keep-with-next\.within-page=?String keep-with-next\.within-column=?String keep-with-next\.within-line=?String keep-with-next=?String break-before=?("auto" | "column" | "page" | "even-page" | "odd-page" | "inherit") break-after=?("auto" | "column" | "page" | "even-page" | "odd-page" | "inherit") rule-thickness=?String rule-style=?("none" | "dotted" | "dashed" | "solid" | "double" | "groove" | "ridge" | "inherit") leader-length\.maximum=?String leader-length\.optimum=?String leader-length\.minimum=?String leader-length=?String leader-pattern-width=?String leader-pattern=?("space" | "rule" | "dots" | "use-content" | "inherit") leader-alignment=?("none" | "reference-area" | "page" | "inherit") direction=?("ltr" | "rtl" | "inherit") unicode-bidi=?("normal" | "embed" | "bidi-override" | "inherit") wrap-option=?("no-wrap" | "wrap" | "inherit") white-space-collapse=?("false" | "true" | "inherit") white-space-treatment=?("ignore" | "preserve" | "ignore-if-before-linefeed" | "ignore-if-after-linefeed" | "ignore-if-surrounding-linefeed" | "inherit") white-space=?("normal" | "pre" | "nowrap" | "inherit") linefeed-treatment=?("ignore" | "preserve" | "treat-as-space" | "treat-as-zero-width-space" | "inherit") line-stacking-strategy=?("line-height" | "font-height" | "max-height" | "inherit") last-line-end-indent=?String text-indent=?String text-align-last=?("relative" | "start" | "center" | "end" | "justify" | "inside" | "outside" | "left" | "right" | "inherit") text-align=?("start" | "center" | "end" | "justify" | "inside" | "outside" | "left" | "right" | "inherit") intrusion-displace=?("auto" | "none" | "line" | "indent" | "block" | "inherit") clear=?("start" | "end" | "left" | "right" | "both" | "none" | "inherit") float=?("before" | "start" | "end" | "left" | "right" | "none" | "inherit") provisional-label-separation=?String provisional-distance-between-starts=?String table-omit-footer-at-break=?("true" | "false" | "inherit") table-omit-header-at-break=?("true" | "false" | "inherit") table-layout=?("auto" | "fixed" | "inherit") empty-cells=?("show" | "hide" | "inherit") caption-side=?("before" | "after" | "start" | "end" | "top" | "bottom" | "left" | "right" | "inherit") border-separation\.block-progression-direction=?String border-separation\.inline-progression-direction=?String border-separation=?String border-spacing=?String border-collapse=?("collapse" | "collapse-with-precedence" | "separate" | "inherit") line-height-shift-adjustment=?String line-height\.conditionality=?("retain" | "discard") line-height\.precedence=?String line-height\.maximum=?String line-height\.optimum=?String line-height\.minimum=?String line-height=?String font-weight=?("normal" | "bold" | "bolder" | "lighter" | "inherit" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900") font-variant=?("normal" | "small-caps" | "inherit") font-style=?("normal" | "italic" | "oblique" | "backslant" | "inherit") font-stretch=?("normal" | "wider" | "narrower" | "ultra-condensed" | "extra-condensed" | "condensed" | "semi-condensed" | "semi-expanded" | "expanded" | "extra-expanded" | "ultra-expanded" | "inherit") font-size-adjust=?String font-size=?String font-family=?String font-selection-strategy=?("auto" | "character-by-character" | "inherit") font=?String glyph-orientation-vertical=?("0" | "90" | "180" | "270" | "-90" | "-180" | "-270" | "0deg" | "90deg" | "180deg" | "270deg" | "-90deg" | "-180deg" | "-270deg" | "inherit") glyph-orientation-horizontal=?("0" | "90" | "180" | "270" | "-90" | "-180" | "-270" | "0deg" | "90deg" | "180deg" | "270deg" | "-90deg" | "-180deg" | "-270deg" | "inherit") text-depth=?String text-altitude=?String suppress-at-line-break=?("auto" | "suppress" | "retain" | "inherit") text-transform=?("capitalize" | "uppercase" | "lowercase" | "none" | "inherit") text-shadow=?String score-spaces=?("true" | "false" | "inherit") text-decoration=?String treat-as-word-space=?("auto" | "true" | "false" | "inherit") word-spacing\.conditionality=?("retain" | "discard") word-spacing\.precedence=?String word-spacing\.maximum=?String word-spacing\.optimum=?String word-spacing\.minimum=?String word-spacing=?String letter-spacing\.conditionality=?("retain" | "discard") letter-spacing\.precedence=?String letter-spacing\.maximum=?String letter-spacing\.optimum=?String letter-spacing\.minimum=?String letter-spacing=?String vertical-align=?String dominant-baseline=?("auto" | "use-script" | "no-change" | "reset-size" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "central" | "middle" | "text-after-edge" | "text-before-edge" | "inherit") baseline-shift=?String alignment-baseline=?("auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" | "text-after-edge" | "top" | "text-top" | "bottom" | "text-bottom" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit") alignment-adjust=?String writing-mode=?("lr-tb" | "rl-tb" | "tb-rl" | "lr" | "rl" | "tb" | "inherit") reference-orientation=?("0" | "90" | "180" | "270" | "-90" | "-180" | "-270" | "0deg" | "90deg" | "180deg" | "270deg" | "-90deg" | "-180deg" | "-270deg" | "inherit") display-align=?("auto" | "before" | "center" | "after" | "inherit") overflow=?("visible" | "hidden" | "scroll" | "auto" | "error-if-overflow" | "inherit") clip=?String space-end\.conditionality=?("retain" | "discard") space-end\.precedence=?String space-end\.maximum=?String space-end\.optimum=?String space-end\.minimum=?String space-end=?String space-start\.conditionality=?("retain" | "discard") space-start\.precedence=?String space-start\.maximum=?String space-start\.optimum=?String space-start\.minimum=?String space-start=?String end-indent=?String start-indent=?String space-before\.conditionality=?("retain" | "discard") space-before\.precedence=?String space-before\.maximum=?String space-before\.optimum=?String space-before\.minimum=?String space-before=?String space-after\.conditionality=?("retain" | "discard") space-after\.precedence=?String space-after\.maximum=?String space-after\.optimum=?String space-after\.minimum=?String space-after=?String margin-top=?String margin-right=?String margin-left=?String margin-bottom=?String margin=?String block-progression-dimension\.maximum=?String block-progression-dimension\.optimum=?String block-progression-dimension\.minimum=?String block-progression-dimension=?String inline-progression-dimension\.maximum=?String inline-progression-dimension\.optimum=?String inline-progression-dimension\.minimum=?String inline-progression-dimension=?String max-width=?String min-width=?String width=?String max-height=?String min-height=?String height=?String volume=?String voice-family=?String stress=?String speech-rate=?String speak-punctuation=?("code" | "none" | "inherit") speak-numeral=?("digits" | "continuous" | "inherit") speak-header=?("once" | "always" | "inherit") speak=?("normal" | "none" | "spell-out" | "inherit") richness=?String play-during=?String pitch-range=?String pitch=?String pause-before=?String pause-after=?String pause=?String elevation=?String cue-before=?String cue-after=?String cue=?String azimuth=?String border-start-precedence=?String border-end-precedence=?String border-before-precedence=?String border-after-precedence=?String padding-top\.conditionality=?("discard" | "retain") padding-top\.length=?String padding-top=?String padding-start\.conditionality=?("discard" | "retain") padding-start\.length=?String padding-start=?String padding-right\.conditionality=?("discard" | "retain") padding-right\.length=?String padding-right=?String padding-left\.conditionality=?("discard" | "retain") padding-left\.length=?String padding-left=?String padding-end\.conditionality=?("discard" | "retain") padding-end\.length=?String padding-end=?String padding-bottom\.conditionality=?("discard" | "retain") padding-bottom\.length=?String padding-bottom=?String padding-before\.conditionality=?("discard" | "retain") padding-before\.length=?String padding-before=?String padding-after\.conditionality=?("discard" | "retain") padding-after\.length=?String padding-after=?String padding=?String border-width=?String border-top-width\.conditionality=?("discard" | "retain") border-top-width\.length=?String border-top-width=?String border-top-style=?("none" | "hidden" | "dotted" | "dashed" | "solid" | "double" | "groove" | "ridge" | "inset" | "outset" | "inherit") border-top-color=?String border-top=?String border-style=?String border-start-width\.conditionality=?("discard" | "retain") border-start-width\.length=?String border-start-width=?String border-start-style=?("none" | "hidden" | "dotted" | "dashed" | "solid" | "double" | "groove" | "ridge" | "inset" | "outset" | "inherit") border-start-color=?String border-right-width\.conditionality=?("discard" | "retain") border-right-width\.length=?String border-right-width=?String border-right-style=?("none" | "hidden" | "dotted" | "dashed" | "solid" | "double" | "groove" | "ridge" | "inset" | "outset" | "inherit") border-right-color=?String border-right=?String border-left-width\.conditionality=?("discard" | "retain") border-left-width\.length=?String border-left-width=?String border-left-style=?("none" | "hidden" | "dotted" | "dashed" | "solid" | "double" | "groove" | "ridge" | "inset" | "outset" | "inherit") border-left-color=?String border-left=?String border-end-width\.conditionality=?("discard" | "retain") border-end-width\.length=?String border-end-width=?String border-end-style=?("none" | "hidden" | "dotted" | "dashed" | "solid" | "double" | "groove" | "ridge" | "inset" | "outset" | "inherit") border-end-color=?String border-color=?String border-bottom-width\.conditionality=?("discard" | "retain") border-bottom-width\.length=?String border-bottom-width=?String border-bottom-style=?("none" | "hidden" | "dotted" | "dashed" | "solid" | "double" | "groove" | "ridge" | "inset" | "outset" | "inherit") border-bottom-color=?String border-bottom=?String border-before-width\.conditionality=?("discard" | "retain") border-before-width\.length=?String border-before-width=?String border-before-style=?("none" | "hidden" | "dotted" | "dashed" | "solid" | "double" | "groove" | "ridge" | "inset" | "outset" | "inherit") border-before-color=?String border-after-width\.conditionality=?("discard" | "retain") border-after-width\.length=?String border-after-width=?String border-after-style=?("none" | "hidden" | "dotted" | "dashed" | "solid" | "double" | "groove" | "ridge" | "inset" | "outset" | "inherit") border-after-color=?String border=?String rx:background-scaling=?("uniform" | "non-uniform") rx:background-content-width=?String rx:background-content-height=?String background-repeat=?("repeat" | "repeat-x" | "repeat-y" | "no-repeat" | "inherit") background-position-horizontal=?String background-position-vertical=?String background-position=?String background-image=?String background-color=?String background-attachment=?("scroll" | "fixed" | "inherit") background=?String left=?String bottom=?String right=?String top=?String position=?("static" | "relative" | "absolute" | "fixed" | "inherit") relative-position=?("auto" | "static" | "relative" | "inherit") absolute-position=?("auto" | "absolute" | "fixed" | "inherit") role=?String source-document=?String span=?("none" | "all" | "inherit") relative-align=?("before" | "baseline" | "inherit") color=?String media-usage=?("auto" | "paginate" | "bounded-in-one-dimension" | "unbounded")>[
(rx:meta-info? rx:page-device? layout-master-set
(rx:meta-info? rx:page-device? fox:outline* layout-master-set
declarations? rx:outline? (page-sequence | rx:fall-through)+)
];;
......@@ -46,25 +46,94 @@ let toc_entry2fo ([Entry*] -> [block*]) x ->
transform x with
| <entry toc_id=tid toc_title=tt toc_head=thead>le ->
[<fo:block font-size="12pt" space-before="10pt" space-after="7pt" font-weight="bold">[
!(heading2string thead) ' ' !tt ' '
!(heading2string thead) ' ' <fo:basic-link internal-destination=tid>tt ' '
<fo:page-number-citation ref-id=tid>[]
]
!(toc_entry2fo le)
]
| <entry_page toc_id=tid toc_title=tt toc_head=thead>le ->
[<fo:block font-size="18pt" font-weight="bold" space-after="7pt" space-before="10pt">[
!(heading2string thead) ' ' !tt ' '
!(heading2string thead) ' ' <fo:basic-link internal-destination=tid>tt ' '
<fo:page-number-citation ref-id=tid>[]
]
!(toc_entry2fo le)
]
let toc_entry2fo_table ([Entry+] -> [table-row+] ; [] -> []) x ->
transform x with
| <entry toc_id=tid toc_title=tt toc_head=thead>le ->[
<fo:table-row>[
<fo:table-cell>[
<fo:block font-size="12pt" space-before="10pt" space-after="7pt" font-weight="bold" text-align="end">[
!(heading2string thead) ' '
]
]
<fo:table-cell>[
<fo:block font-size="12pt" space-before="10pt" space-after="7pt" font-weight="bold">[
<fo:basic-link color="blue" internal-destination=tid>tt
]
]
<fo:table-cell>[
<fo:block font-size="12pt" space-before="10pt" space-after="7pt" font-weight="bold" text-align="end">[
<fo:page-number-citation ref-id=tid>[]
]
]
]
!(toc_entry2fo_table le)
]
| <entry_page toc_id=tid toc_title=tt toc_head=thead>le ->[
<fo:table-row>[
<fo:table-cell>[
<fo:block font-size="18pt" space-before="10pt" space-after="7pt" font-weight="bold" text-align="end">[
!(heading2string thead) ' '
]
]
<fo:table-cell>[
<fo:block font-size="18pt" font-weight="bold" space-after="7pt" space-before="10pt">[
<fo:basic-link color="blue" internal-destination=tid>tt
]
]
<fo:table-cell>[
<fo:block font-size="18pt" space-before="10pt" space-after="7pt" font-weight="bold" text-align="end">[
<fo:page-number-citation ref-id=tid>[]
]
]
]
!(toc_entry2fo_table le)
]
let toc_entry2pdfoutline ([Entry*] -> [fox:outline*]) x ->
transform x with
| <(`entry|`entry_page) toc_id=tid toc_title=tt toc_head=thead>le ->
[<fox:outline internal-destination=tid>[
<fox:label>[!(heading2string thead) ' ' !tt ' ']
!(toc_entry2pdfoutline le)
]
]
let out_global_toc (toc : [Entry?]) : [block*] = [
<fo:block break-before="page">[]
<fo:block id="toc-main" break-before="page">[]
<fo:block font-size="22pt" font-weight="bold" space-before="18pt">"Table of Contents"
!(toc_entry2fo toc)
]
let out_global_toc_table ([Entry] -> [block] ; [] -> [])
| [] -> []
| toc & [Entry] -> [
<fo:block>[
<fo:block id="toc-main" break-before="page">[]
<fo:block font-size="22pt" font-weight="bold" space-before="18pt">"Table of Contents :"
<fo:table table-layout="fixed">[
<fo:table-column column-width="2cm">[]
<fo:table-column column-width="12cm">[]
<fo:table-column column-width="2cm">[]
<fo:table-body>[!(toc_entry2fo_table toc)]
]
]
]
(** Command line **)
(* Highlighting text between {{...}} *)
......@@ -352,14 +421,15 @@ let gen_pageHead (page : Page, cduce_version : Latin1) : [block+] =
|<page ..>[(<title>title1 (<banner>_)? litem::Item+)] -> (
let head = <heading>[0] in
let rIH = (readItemHead (litem, head)) in
let sortie : [block+]= [
let sortie : [ block+ ]= [
<fo:block text-align="center" space-before="80pt">[
<fo:external-graphic src="url(img/cduce_logo.jpg)">[]
<fo:block font-size="35pt" font-weight="bold" space-before="30pt">"CDuce Programming Language"
<fo:block font-size="35pt" font-weight="bold" space-after="20pt">[!title1]
<fo:block font-size="18pt" font-weight="bold">("Language Version "@cduce_version)
<fo:external-graphic src="url(../../web/img/cduce_logo.jpg)">[]
]
!(out_global_toc !local_toc)
!(out_global_toc_table !local_toc)
(* !(out_global_toc !local_toc) *)
!rIH
]
in sortie)
......@@ -374,41 +444,50 @@ in
match argv [] with
| [ (inp_file & Latin1) (out_file & Latin1) (cduce_version & Latin1) ]
-> (try let ([ main_page ]) = (load_include inp_file :? [ Page ]) in
let DebutFo : root =
<fo:root >[
<fo:layout-master-set>[
<fo:simple-page-master
master-name="essai"
page-height="29.7cm"
page-width="21cm">[
<fo:region-body margin-top="3cm"
let content = (gen_pageHead(main_page,cduce_version)) in
let DebutFo : root =
<fo:root >[
<fox:outline internal-destination="toc-main">[<fox:label>("Table of Contents")]
!(toc_entry2pdfoutline !local_toc)
<fo:layout-master-set>[
<fo:simple-page-master
master-name="essai"
page-height="29.7cm"
page-width="21cm">[
<fo:region-body margin-top="3cm"
margin-bottom="3.5cm"
margin-left="2.5cm"
margin-right="2.5cm">[]
<fo:region-after region-name="footer" extent="15mm">[]
]
]
<fo:page-sequence initial-page-number="auto" master-reference="essai" >[
<fo:static-content flow-name="xsl-footnote-separator">[
<fo:block>[
<fo:leader leader-pattern="rule"
leader-length="100%"
rule-style="solid"
rule-thickness="0.5pt">[]]]
<fo:static-content flow-name="footer">[
<fo:block text-align="center">[<fo:page-number>[]]
]
<fo:flow
flow-name="xsl-region-body"
font-size="12pt"
text-align="justify"> [!(gen_pageHead(main_page,cduce_version))] ]] in
dump_to_file ("../doc/fomanual/"@out_file)
<fo:region-after region-name="footer" extent="15mm">[]
]
]
<fo:page-sequence initial-page-number="auto" master-reference="essai" >[
<fo:static-content flow-name="xsl-footnote-separator">[
<fo:block>[
<fo:leader leader-pattern="rule"
leader-length="100%"
rule-style="solid"
rule-thickness="0.5pt">[]
]
]
<fo:static-content flow-name="footer">[
<fo:block text-align="center">[
<fo:page-number>[]
]
]
<fo:flow flow-name="xsl-region-body"
font-size="12pt"
text-align="justify"> [!content]
]
] in
dump_to_file ("../doc/fomanual/"@out_file)
(* dump_to_file (out_file) *)
['<?xml version="1.0" encoding="ISO-8859-1"?>' !(print_xml DebutFo)]
['<?xml version="1.0" encoding="ISO-8859-1"?>' !(print_xml DebutFo)]
(*print(print_xml(main_page));*)
(* print (gen_page main_page)*)
with err & Latin1 -> print ['Invalid input document\n' !err '\n'];
exit 2
)
with err & Latin1 ->
print ['Invalid input document\n' !err '\n'];
exit 2
)
| _ -> raise "Wrong argument number or type: please correct the --arg option";;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment