Commit 9c81f335 authored by Pietro Abate's avatar Pietro Abate

[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 87f3088d
......@@ -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 diff is collapsed.
......@@ -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