Commit a71306b7 authored by Pietro Abate's avatar Pietro Abate

[r2005-03-27 22:45:23 by beppe] tutorial part

Original author: beppe
Date: 2005-03-27 22:45:24+00:00
parent a31a57d1
......@@ -2,10 +2,21 @@
JAVA_HOME=/usr/java/jre1.5.0
VERSION=0.3.2
CDUCE=/tmp/cduce-0.2.2/cduce
FOP=/tmp/fop-0.20.5/fop.sh
FOP=/tmp/fop-0.20.5/fop.sh
all:
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))
pdf: all
$(FOP) manual_fo.xml manual.pdf
tutorial_pdf: tutorial
$(FOP) tutorial_fo.xml tutorial.pdf
manual_pdf: manual
$(FOP) manual_fo.xml manual.pdf
all: manual, tutorial
(** Input types **)
type Page = <page name=Latin1 url=?String new=?"" leftbar=?("true"|"false")>[<title>String Item* ]
type Page = <page name=Latin1 url=?String new=?"" leftbar=?("true"|"false")>[<title>String <banner>[InlineText*]? Item* ]
......@@ -24,7 +24,10 @@ type Link =
<link url=String title=String>[ InlineText* ]
type Table=
<table {|border=?String; style=?String|}>[Tr*]
<table {|border=?String; style=?String|}>[Col* Tr*]
type Col = <col width=?String>[]
type Tr =
<tr>[(Td|Th)*]
type Td =
......@@ -59,7 +62,7 @@ type InlineText =
| <(`b|`i|`tt|`em) {| style=?String |}>[InlineText*]
| <code>String
| <local href=String>String
|<a href=String>String
| <a href=?String ; name=?String >[InlineText*]
| <footnote>[InlineText*]
|<br>[]
......
......@@ -68,13 +68,14 @@ let highlight (String -> [ (Char)* ] )
text-align="left"
space-after="10pt">[!(highlight s)]]
| <p>x -> [<fo:block space-after="15pt">[!(text x)]]
| <table> x -> [ <fo:table space-after="15pt">[
<fo:table-column column-width="80mm">[]
<fo:table-column column-width="80mm">[]
<fo:table-body>( transform x with
| <table> [ (col:: Col)* (rows::Tr)*] -> [
<fo:table space-after="15pt" table-layout="fixed" inline-progression-dimension.maximum="95%">[
!(map col with <col (_)>[] -> <fo:table-column width="proportional-column-width(1)">[])
<fo:table-body>( transform rows with
<tr> y -> [<fo:table-row>( transform y with
| <th> z -> [<fo:table-cell padding="6pt" background-color="silver" border="0.5pt solid black">[ <fo:block font-weight="bold">[!(content z) ]]]
| <td> z -> [<fo:table-cell padding="6pt" border="0.5pt solid black">[ <fo:block>[!(content z) ]]]
| <td style=['background:' ;c]> z -> [<fo:table-cell padding="3pt" background-color=c border="0.5pt solid black" text-align="left">[ <fo:block>[!(content z) ]]]
| <td> z -> [<fo:table-cell padding="3pt" border="0.5pt solid black" text-align="left">[ <fo:block>[!(content z) ]]]
)])
]](*]*)
| <ul>u ->[ <fo:list-block provisional-distance-between-starts="18pt"
......@@ -100,7 +101,7 @@ let highlight (String -> [ (Char)* ] )
| l & Link -> (link l)
| s & Slides -> (slides s)
| i & InlineText -> (text [i])
| <boxes-toc>_ -> [<fo:block>['A FAIRE BOX TOC']]
| <boxes-toc>_ -> []
| <pages-toc>_ ->[<fo:block>['A FAIRE PAGES TOC']]
| <site-toc>_ -> [<fo:block>['A FAIRE SITE TOC']]
| <local-links>_ -> [<fo:block>['A FAIRE LOCAL LINKS']]
......@@ -128,10 +129,10 @@ let ma (it : [Item]) : block =
| [<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)]
| [<left>_] -> <fo:block>[]
| [<footnotes>[]] -> <fo:block>[ ]
| [<page name=_ > [(<title>_)]] -> <fo:block>['box vide!!!!!!!!!!!!!']
| [<page name=x >[(<title>title1 litem::Item+)]] ->
| [<page name=_ > [(<title>_) (<banner>_)? ]] -> <fo:block>['box vide!!!!!!!!!!!!!']
| [<page name=x >[(<title>title1 (<banner>_)? litem::Item+)]] ->
<fo:block id=x break-before="page" text-align-last="justify">[
<fo:block text-align="left">[
<fo:block font-size="32pt" font-weight="bold" space-after="40pt" space-before="85pt" color="black" >[title1]
......@@ -148,11 +149,11 @@ let lireItem ([Item+] -> [block*])
let gen_page (page : Page, cduce_version : Latin1) : [block*] =
match page with
(* le cas sans item*)
<page name=_>[(<title>_)] -> [<fo:block text-align="center" font-size="35pt" color="green" space-after="30pt">
<page name=_>[(<title>_) (<banner>_)?] -> [<fo:block text-align="center" font-size="35pt" color="green" space-after="30pt">
["err"] ]
(* la cas de base *)
|<page name=_ >[(<title>title1 litem::Item+)] ->(
|<page name=_ >[(<title>title1 (<banner>_)? litem::Item+)] ->(
let sortie : [block+]=
[
......@@ -197,12 +198,16 @@ match argv [] with
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,cduce_version))] ]] in
dump_to_file ("../doc/fomanual/"@out_file) (print_xml DebutFo)
<fo:flow
flow-name="xsl-region-body"
font-size="12pt"
text-align="justify"> [!(gen_page(main_page,cduce_version))] ]] in
dump_to_file ("../doc/fomanual/"@out_file)
['<?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 ['Invalide input document\n' !err '\n'];
print ['Invalid input document\n' !err '\n'];
exit 2
)
| _ -> print_utf8 ("a pa trouve:");raise "erreur arg ";;
......
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