Commit 498ebfcd authored by Pietro Abate's avatar Pietro Abate

[r2005-03-27 23:37:29 by beppe] Tutorial nearly complete

Original author: beppe
Date: 2005-03-27 23:37:29+00:00
parent a71306b7
......@@ -20,9 +20,11 @@ type block =
linefeed-treatment=?("preserve"|"ignore");
margin-bottom=?String;
margin-left=?String;
margin-right=?String;
padding-after=?String;
padding-before=?String;
padding-start=?String;
padding-end=?String;
white-space-collapse=?("false"|"true"|"inherit");
white-space-treatment=?("preserve"|"ignore")|}>[
Any* ];;
......
......@@ -6,17 +6,17 @@ include "typeFO.cd";;
(* Highlighting text between {{...}} *)
let highlight (String -> [ (Char)* ] )
| [ '{{%%' h ::(Char ) '%%}}' ; rest ] ->
h @ highlight rest
let highlight (String -> [ (Char| inline)* ] )
| [ '{{%%' h ::(Char *?) '%%}}' ; rest ] ->
[<fo:inline color="red" font-weight="bold" font-style="italic"> h; highlight rest]
| [ '{{' h ::(Char *?) '}}' ; rest ] ->
h @ highlight rest
[<fo:inline color="red" font-weight="bold"> h; highlight rest] h @ highlight rest
| [ '$$%%' h ::(Char *?) '%%$$' ; rest ] ->
h @ highlight rest
[<fo:inline color="darkblue" font-weight="bold" font-style="italic"> h; highlight rest]
| [ '$$' h ::(Char *?) '$$' ; rest ] ->
h @ highlight rest
[<fo:inline color="darkblue" font-weight="bold"> h; highlight rest]
| [ '%%' h ::(Char *?) '%%' ; rest ] ->
h @ highlight rest
[<fo:inline font-style="italic"> h; highlight rest]
| [ c ; rest ] -> [c ; highlight rest]
| [] -> []
......@@ -54,6 +54,36 @@ let highlight (String -> [ (Char)* ] )
let content (t : Content) : [(block|basic-link|Char|inline|list-block|footnote|table)*] =
transform t with
| <section title=title1>c -> [<fo:block space-before="5pt">[<fo:block space-after="4pt" font-size="14pt" font-weight="bold">[title1] !(content c) ]]
|((<sessionsample >s) | <sessionsample highlight="false">s)
-> [<fo:block font-family="Courier"
font-size="10pt"
linefeed-treatment="preserve"
white-space-collapse="false"
white-space-treatment="preserve"
background-color="white"
border-style="dashed"
padding-start="34pt"
padding-end="34pt"
padding-before="14pt"
padding-after="14pt"
margin-bottom="3pt"
margin-left="15pt"
margin-right="15pt"
text-align="left"
space-after="10pt">[!(highlight s)]]
|((<xmlsample >s) | <xmlsample highlight="false">s)
-> [<fo:block font-family="Courier"
font-size="10pt"
linefeed-treatment="preserve"
white-space-collapse="false"
white-space-treatment="preserve"
background-color="lightyellow"
border-style="dashed"
padding-start="4pt"
padding-after="4pt"
margin-bottom="3pt"
text-align="left"
space-after="10pt">[!(highlight s)]]
| ((<sample >s) | <sample highlight="false">s)
-> [<fo:block font-family="Courier"
font-size="10pt"
......@@ -95,20 +125,37 @@ let highlight (String -> [ (Char)* ] )
<fo:block>(string_of(i)@".")]
<fo:list-item-body start-indent="body-start()">[
<fo:block>[ !(content c) ]]]])]
|((<xmlsample >s) | <xmlsample highlight="false">s) -> [<fo:block>[!(highlight s)]]
|((<sessionsample >s) | <sessionsample highlight="false">s) -> [<fo:block>[!(highlight s)]]
| p & Paper -> (paper p)
| l & Link -> (link l)
| s & Slides -> (slides s)
| i & InlineText -> (text [i])
| <boxes-toc>_ -> []
| <note>s -> [<fo:block
background-color="lightgreen"
border-style="dashed"
padding-before="15pt"
padding-end="25pt"
padding-start="25pt"
padding-after="15pt"
margin-left="35pt"
margin-right="35pt"
space-after="10pt">[(<fo:inline font-weight="bold">"Note: ") !(content s)]]
| <pages-toc>_ ->[<fo:block>['A FAIRE PAGES TOC']]
| <site-toc>_ -> [<fo:block>['A FAIRE SITE TOC']]
| <local-links>_ -> [<fo:block>['A FAIRE LOCAL LINKS']]
| <two-columns>_ -> [<fo:block>['A FAIRE TWO COLUMNS']]
| <note>_ -> [<fo:block>['A FAIRE NOTE']]
| <two-columns>[ <left>x <right>y ] ->
[<fo:table
space-after="15pt"
table-layout="fixed"
inline-progression-dimension.maximum="125%">[
<fo:table-column>[]
<fo:table-column>[]
<fo:table-body>[
<fo:table-row>[
<fo:table-cell padding="3pt">(content x)
<fo:table-cell padding="3pt">(content y)]]]]
| <footnotes>_ -> [<fo:block>['A FAIRE FOOTNOTE']]
| <demo>_ -> [<fo:block>['A FAIRE DEMO LABEL']]
| <boxes-toc>_ -> []
let paper (p : Paper) : [block*] =
......
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