Commit 11f09dbf authored by Pietro Abate's avatar Pietro Abate

[r2005-03-27 13:45:32 by beppe] Empty log message

Original author: beppe
Date: 2005-03-27 13:45:33+00:00
parent 3e5bc675
......@@ -3,7 +3,7 @@ CDUCE=/tmp/cduce-0.2.2/cduce
FOP=/tmp/fop-0.20.5/fop.sh
all:
(cd ../../web && ${CDUCE} ../doc/fomanual/xml2fo.cd --arg manual.xml)
(cd ../../web && $(CDUCE) ../doc/fomanual/xml2fo.cd --arg manual.xml)
pdf: all
${FOP} manual_fo.xml manual.pdf
$(FOP) manual_fo.xml manual.pdf
......@@ -5,6 +5,7 @@ type declarations = <fo:declarations {|fo:color-profile=?String|}>[ Any* ];;
type block =
<fo:block {|space-after=?String;
space-before=?String;
id=?String;
font-weight=?String;
text-align=?String;
text-align-last=?String;
......@@ -23,9 +24,25 @@ type block =
white-space-collapse=?("false"|"true"|"inherit");
white-space-treatment=?("preserve"|"ignore")|}>[
Any* ];;
type line = <fo:inline {|text-decoration=?String; color=?String; font-family=?String; font-weight=?String; font-style=?String|}>[Any*];;
type inline = <fo:inline {|
text-decoration=?String;
baseline-shift=?String;
color=?String;
font-family=?String;
font-size=?String;
font-weight=?String;
font-style=?String|}>[Any*];;
type basic-link =<fo:basic-link {|
color=?String;
text-decoration=?String;
font-style=?String;
internal-destination=?String;
external-destination=?String|}>[Any*]
type list-block =
<fo:list-block {| provisional-label-separation=?String; provisional-distance-between-starts=?String|}>[
<fo:list-block {|
provisional-label-separation=?String;
space-after.optimum=?String ;
provisional-distance-between-starts=?String|}>[
list-item* ];;
type list-item =
<fo:list-item space-after=?String>[
......@@ -34,8 +51,9 @@ type list-item =
end-indent=?String>[block*]
<fo:list-item-body start-indent=?String>[block*]];;
type flow = <fo:flow {|flow-name=String; font-size=String; text-align=?String|}>[ block* ];;
type static-content = <fo:static-content {||}>[ block* ];;
type static-content = <fo:static-content>[ block* ];;
type footnote = <fo:footnote>[inline footnote-body];;
type footnote-body = <fo:footnote-body>[(list-block | block | footnote)*];;
type page-sequence =
<fo:page-sequence {|master-reference=String|}>[ ( static-content? flow?) ];;
type repeatable-page-master-alternatives =
......
......@@ -20,23 +20,40 @@ let highlight (String -> [ (Char)* ] )
| [ c ; rest ] -> [c ; highlight rest]
| [] -> []
let text (t : [InlineText*]) : [(block|Char|line)*] =
let text (t : [InlineText*]) : [(block|basic-link|Char|inline|list-block|footnote)*] =
transform t with
|<b>s2 ->[<fo:inline font-weight="bold">[!(text s2)]]
|<i>s2 -> [<fo:inline font-style="italic">[!(text s2)]]
|<tt>s2 -> [<fo:inline font-family="Courier" color="green">[!(text s2)]]
|<em>s2 -> [<fo:inline color="blue" font-weight="bold" font-style="italic">[!(text s2)]]
|<em>s2 -> [<fo:inline font-style="italic">[!(text s2)]]
| z & Char -> [z]
| <code>x -> [<fo:inline color="red" font-weight="bold" font-family="Courier">[ !(highlight x)] ](*]*)
| <local href=_>s2 -> [<fo:inline color="pink" font-weight="bold" font-style="italic">[!(text s2)]](*['lien non encore implemente local href']*)
| <a href=_>s2 ->[<fo:inline color="pink" font-weight="bold" font-style="italic">[!(text s2)]] (*['lien non encore implemente a href']*)
|<footnote>t -> [<fo:block>[!(text t)]]
let content (t : Content) : [(block|Char|line|list-block)*] =
| <code>x -> [<fo:inline color="darkgreen" font-weight="bold" font-family="Courier">[ !(highlight x)] ]
| <local href=x>s2 ->[ <fo:basic-link color="blue" text-decoration="underline"
internal-destination=x>[!(text s2)]]
| <a href=['#' ;x]>s2 (* if it starts by # is an internal reference *)
->[ <fo:basic-link color="blue"
text-decoration="underline"
internal-destination=x>[!(text s2)]]
| <a href=x>s2 (* otherwise it is an external reference *)
->[ <fo:basic-link color="red"
text-decoration="underline"
font-style="italic"
external-destination=x>[!(text s2)]]
|<footnote>t -> [
<fo:footnote text-indent="0pt">[
<fo:inline baseline-shift="super" font-size="8pt">"(*)"
<fo:footnote-body>[
<fo:list-block provisional-label-separation="0pt"
provisional-distance-between-starts="18pt"
space-after.optimum="6pt">[
<fo:list-item>[
<fo:list-item-label end-indent="label-end()">[
<fo:block font-size="8pt">"(*)"]
<fo:list-item-body start-indent="body-start()">[
<fo:block font-size="8pt">[!(text t)]]]]]]]
let content (t : Content) : [(block|basic-link|Char|inline|list-block|footnote)*] =
transform t with
| <section title=title1>c -> [<fo:block>[<fo:block>[title1] !(content c) ]]
| <section title=title1>c -> [<fo:block space-before="5pt">[<fo:block space-after="3pt" font-weight="bold">[title1] !(content c) ]]
| ((<sample >s) | <sample highlight="false">s)
-> [<fo:block font-family="Courier"
font-size="10pt"
......@@ -99,14 +116,14 @@ let highlight (String -> [ (Char)* ] )
let ma (it : [Item]) : block =
match it with
| [<box title=t link=_>c] -> <fo:block>[<fo:block font-size="22pt" space-after="15pt" color="blue">[<fo:inline text-decoration="underline" font-weight="bold">[t]] !(content c)]
| [<box title=t link=x>c] -> <fo:block id=x>[<fo:block font-size="22pt" space-before="15pt">[<fo:block (*text-decoration="underline" color="blue"*) space-after="7pt" font-weight="bold">[t]] !(content c)]
| [<box {||}>c] -> <fo:block>[!(content c)]
| [<meta>c] -> (* non utilise pour manuel et tutoriel*)<fo:block>[!(content c)]
| [<left>c] -> <fo:block>[!(content c)]
| [<footnotes>[]] -> <fo:block>[ ]
| [<page name=_ > [(<title>_)]] -> <fo:block>['box vide!!!!!!!!!!!!!']
| [<page name=_ >[(<title>title1 litem::Item+)]] ->
<fo:block text-align-last="justify">[<fo:block text-align="center">[
| [<page name=x >[(<title>title1 litem::Item+)]] ->
<fo:block id=x text-align-last="justify">[<fo:block text-align="center">[
<fo:block font-size="30pt" space-after="15pt" space-before="15pt" color="indigo" >[
<fo:inline text-decoration="underline">[title1]]
] !(lireItem litem)
......@@ -163,6 +180,12 @@ match argv [] with
]
]
<fo:page-sequence 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:flow flow-name="xsl-region-body" font-size="12pt" text-align="justify"> [!(gen_page main_page)] ]] in
dump_to_file "../doc/fomanual/manual_fo.xml" (print_xml DebutFo)
(*print(print_xml(main_page));*)
......
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