Permalink
Browse files

Table des matières pages XHTML + Book LARTC

  • Loading branch information...
1 parent beb54db commit 46edb101a55c751371eeb5e302d99bf7a21e462b @platu committed Aug 23, 2011
View
@@ -4,6 +4,7 @@ endif
# Liste des répertoires à traiter à partir de ce niveau
SUBDIRS = \
+ images \
guides
# articles \
View
@@ -7,7 +7,7 @@ CWD := $(shell pwd)
STYLESHEET := inetdoc
PAGEMENUITEM := $(subst $(MAIN_DIR),,$(CWD))
-PAGEMENUITEM := $(firstword $(shell echo $(PAGEMENUITEM)| sed 's/\// /g'))
+PAGEMENUCAT := $(firstword $(shell echo $(PAGEMENUITEM)| sed 's/\// /g'))
TIDY := /usr/bin/tidy -m -q -asxhtml -wrap 79
FOP := ~/SVN/fop/trunk/fop -l fr -c $(MAIN_DIR)/common/fop.xconf
@@ -59,7 +59,7 @@ symlink:
# La feuille de styles est éditée pour identifier la rubrique courante
$(STYLESHEET).css: $(MAIN_DIR)/styles/$(STYLESHEET).css
- @sed 's/.banner_menu #active/.banner_menu #$(PAGEMENUITEM)/' $< > $@
+ @sed 's/.banner_menu #active/.banner_menu #$(PAGEMENUCAT)/' $< > $@
#/*--------------------------------------------------------------------------
#* Traitement des fichiers sources DocBook XML
@@ -88,25 +88,31 @@ index.html: $(XHTML_OUTPUT)/$(BASENAME).xml
# Insertion du nom de fichier imprimable
# Copie du fichier source complet dans le répertoire de distribution
# Transformation XHTML du résultat de la validation XML
- # Extraction de la table des matières
- ( \
+ @( \
cd $(XHTML_OUTPUT) && \
sed -i 's/__printbasename__/$(BASENAME)\.pdf/g' $(BASENAME).xml && \
cp -a $(BASENAME).xml $(MAIN_DIR)/xml/ && \
- xsltproc --stringparam html.stylesheet $(STYLESHEET).css $(XSLT_STYLESHEET) $(BASENAME).xml && \
- sed -n '/<div class=\"toc\">/,/<\/div>/p' $@ > toc.htm \
+ xsltproc --stringparam html.stylesheet $(STYLESHEET).css $(XSLT_STYLESHEET) $(BASENAME).xml \
)
- # Traitement de la table des matières
- sed -i 's/<p>/<div class=\"sidetitle\">/;s/<\/p>/<\/div>/;s/<b>//;s/<\/b>//;/span/d' $(XHTML_OUTPUT)/toc.htm
# Formatage des pages
@for file in `ls $(XHTML_OUTPUT)/*.html`; do \
sed -i '/<title>/d;s/style=\"clear:* both\"//' $$file ;\
( cd $(MAIN_DIR) && \
nb --title $(BASENAME) make-page $(CWD)/$$file $(CWD)/`echo $${file##*/}` ) ;\
done
+ # Extraction et transformation de la table des matières
+ echo '<div id="links">' >$(XHTML_OUTPUT)/toc.htm
+ echo '<div class="sidetitle">Formats</div>' >>$(XHTML_OUTPUT)/toc.htm
+ echo '<div class="side">' >>$(XHTML_OUTPUT)/toc.htm
+ echo '<a href="/xml/$(BASENAME).xml" class="xml-small">Source DocBook XML</a>' >>$(XHTML_OUTPUT)/toc.htm
+ echo '<a href="/pdf/$(BASENAME).pdf" class="pdf-small">Fichier imprimable PDF</a>' >>$(XHTML_OUTPUT)/toc.htm
+ echo '<a href="https://github.com/platu/inetdoc/commits/master$(PAGEMENUITEM)/$(BASENAME).xml" class="git-small">Historique des versions</a>' >>$(XHTML_OUTPUT)/toc.htm
+ echo '</div>' >> $(XHTML_OUTPUT)/toc.htm
+ @sed -n '/<div class=\"toc\">/,/<\/div>/p' $(XHTML_OUTPUT)/$@ >> $(XHTML_OUTPUT)/toc.htm
+ @sed -i -f $(MAIN_DIR)/common/docbook-xml-toc.sed $(XHTML_OUTPUT)/toc.htm
+ echo '</div>' >> $(XHTML_OUTPUT)/toc.htm
# Insertion de la table des matières dans la partie liens de chaque page
- sed -i 's/<div class=\"toc\">/<div id=\"links\">/' $(XHTML_OUTPUT)/toc.htm
- for file in `ls *.html`; do \
+ @for file in `ls *.html`; do \
sed -n '1,/<div id=\"container\">/p' $$file >> $$file.tmp ;\
cat $(XHTML_OUTPUT)/toc.htm >> $$file.tmp ;\
sed -n '/<div id=\"content\">/,$$p' $$file >> $$file.tmp ;\
@@ -117,7 +123,7 @@ xml2pdf: $(MAIN_DIR)/pdf/$(BASENAME).pdf
$(MAIN_DIR)/pdf/$(BASENAME).pdf: $(XHTML_OUTPUT)/$(BASENAME).xml
# Transformation FO du résultat de la validation XML
- ( \
+ @( \
cd $(XHTML_OUTPUT) && \
xsltproc --output $(BASENAME).fo $(MAIN_DIR)/common/fopdf.xsl $(BASENAME).xml && \
$(FOP) -fo $(BASENAME).fo -pdf $@ \
View
@@ -0,0 +1,10 @@
+/toc/d
+s/<p>/<div class=\"sidetitle\">/
+s/<\/p>/<\/div><div class=\"side\">/
+s/<b>//
+s/<\/b>//
+/span/d
+/dl/d
+/dd/d
+/dt/d
+s/<\/a>/&<br \/>/
View
@@ -21,7 +21,8 @@
<!DOCTYPE xsl:stylesheet [
<!-- The below path is defined by the docbook-xsl-ns Debian package -->
<!ENTITY db_xsl_path "/usr/share/xml/docbook/stylesheet/docbook-xsl-ns/">
- <!ENTITY admon_gfx_path "images/">
+ <!ENTITY callout_gfx_path "&db_xsl_path;images/callouts/">
+ <!ENTITY admon_gfx_path "&db_xsl_path;images/">
]>
<xsl:stylesheet version="1.0"
@@ -90,10 +91,9 @@
</xsl:attribute-set>
<!--###################################################
- Custom Title Page
+ Custom Article Title Page
################################################### -->
-<!-- ### Page de titre article ### -->
<xsl:template name="article.titlepage.recto">
<fo:block>
<fo:block background-color="#333" padding="3pt">
@@ -155,135 +155,73 @@
</fo:block>
</xsl:template>
-<!-- ### Page de titre book ### -->
- <xsl:template name="book.titlepage.recto">
- <fo:block background-color="#af0228"
- color="#eee"
- font-family="DejaVuSans"
- font-size="24pt"
- font-weight="bold"
- text-align="left"
- padding="2pt">
- <xsl:value-of select="d:info/d:title"/>
- </fo:block>
- <xsl:for-each select="d:info/*/d:author|d:info/d:author">
- <fo:block color="#333"
- font-family="DejaVuSans"
- font-size="14pt"
- font-weight="bold"
- text-align="right"
- margin-right="10mm">
- <xsl:value-of select="d:firstname"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="d:surname"/>
- </fo:block>
- <fo:block color="#333"
- font-family="DejaVuSans"
- font-size="11pt"
- text-align="right"
- margin-right="10mm">
- <xsl:value-of select="d:affiliation/d:address/d:email"/>
- </fo:block>
- </xsl:for-each>
+<!--###################################################
+ Custom Book Title Page
+ ################################################### -->
- <xsl:choose>
- <xsl:when test="d:info/*/d:editor|d:info/d:editor">
- <fo:block color="#333"
- font-style="italic"
- text-align="right"
- margin-right="50mm">
- <xsl:text>Publié par :</xsl:text>
+ <xsl:template name="book.titlepage.recto">
+ <fo:block>
+ <fo:block background-color="#333" padding="3pt">
+ <fo:block color="#fff" text-align="right"
+ font-family="DejaVuSans-Bold" font-size="18pt"
+ margin-right="10mm" margin-bottom="5pt">
+ <xsl:value-of select="d:title|d:info/d:title" />
</fo:block>
- </xsl:when>
- </xsl:choose>
- <xsl:for-each select="d:info/*/d:editor|d:info/d:editor">
- <fo:block text-align="right"
- font-family="DejaVuSans"
- font-size="14pt"
- font-weight="bold"
- margin-right="10mm">
- <xsl:value-of select="d:firstname"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="d:surname"/>
+ <xsl:for-each select="//d:author">
+ <fo:block color="#eee" text-align="right"
+ font-family="DejaVuSans-Bold" font-size="10pt"
+ margin-right="10mm">
+ <xsl:value-of select="d:personname/d:firstname"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="d:personname/d:surname"/>
+ </fo:block>
+ <fo:block color="#ddd" text-align="right"
+ font-family="DejaVuSans" font-size="9pt"
+ margin-right="10mm">
+ <xsl:value-of select="d:affiliation/d:address/d:email"/>
+ </fo:block>
+ </xsl:for-each>
+
+ <xsl:choose>
+ <xsl:when test="//d:editor">
+ <fo:block color="#ddd" text-align="right"
+ font-style="italic" margin-right="50mm">
+ <xsl:text>Publié par :</xsl:text>
+ </fo:block>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:for-each select="//d:editor">
+ <fo:block color="#eee" text-align="right"
+ font-family="DejaVuSans-Bold" font-size="10pt"
+ margin-right="10mm">
+ <xsl:value-of select="d:personname/d:firstname"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="d:personname/d:surname"/>
+ </fo:block>
+ <fo:block color="#ddd" text-align="right"
+ font-family="DejaVuSans" font-size="9pt"
+ margin-right="10mm">
+ <xsl:value-of select="d:affiliation/d:address/d:email"/>
+ </fo:block>
+ </xsl:for-each>
</fo:block>
- <fo:block text-align="right"
- font-family="DejaVuSans"
- font-size="11pt"
- margin-right="10mm">
- <xsl:value-of select="d:affiliation/d:address/d:email"/>
+
+ <fo:block color="#fff" background-color="#af0228" text-align="left"
+ font-size="9pt" font-weight="bold" font-style="italic" padding="3pt">
+ <xsl:text>http://www.inetdoc.net</xsl:text>
</fo:block>
- </xsl:for-each>
-
- <fo:block background-color="#af0228"
- color="#eee"
- font-family="DejaVuSans"
- font-size="9pt"
- font-weight="bold"
- text-align="left"
- padding="2pt">
- <xsl:text>http://www.inetdoc.net</xsl:text>
- </fo:block>
- <fo:table font-size="8pt"
- space-before="2pt"
- text-align="start"
- table-layout="fixed"
- width="100%">
- <fo:table-column column-number="1"
- column-width="proportional-column-width(1)"/>
- <fo:table-column column-number="2"
- column-width="proportional-column-width(3)"/>
- <fo:table-column column-number="3"
- column-width="proportional-column-width(1)"/>
- <fo:table-body>
- <fo:table-row>
- <fo:table-cell number-columns-spanned="3"
- background-color="#eee"
- border-bottom="0.5pt solid #111"
- padding="3pt">
- <fo:block>
- <xsl:text>Historique des versions</xsl:text>
- </fo:block>
- </fo:table-cell>
- </fo:table-row>
- <xsl:for-each select="*/d:revhistory/d:revision">
- <fo:table-row>
- <fo:table-cell border-bottom="0.5pt solid #111"
- padding="3pt">
- <fo:block>
- <xsl:value-of select="d:revnumber"/>
- </fo:block>
- </fo:table-cell>
- <fo:table-cell border-bottom="0.5pt solid #111"
- padding="3pt">
- <fo:block>
- <xsl:value-of select="d:date"/>
- </fo:block>
- </fo:table-cell>
- <fo:table-cell border-bottom="0.5pt solid #111"
- padding="3pt">
- <fo:block>
- <xsl:value-of select="d:authorinitials"/>
- </fo:block>
- </fo:table-cell>
- </fo:table-row>
- <fo:table-row>
- <fo:table-cell number-columns-spanned="3"
- border-bottom="0.5pt solid #111"
- padding="3pt">
- <fo:block>
- <xsl:value-of select="d:revremark"/>
- </fo:block>
- </fo:table-cell>
- </fo:table-row>
- </xsl:for-each>
- </fo:table-body>
- </fo:table>
-
- <fo:block margin-left="10mm"
- margin-right="10mm">
- <xsl:value-of select="d:info/d:abstract"/>
+ <xsl:choose>
+ <xsl:when test="*/d:abstract">
+ <fo:block color="#333" text-align="left"
+ font-family="DejaVuSans" font-weight="bold" padding="3pt"
+ margin-top="6pt">
+ <xsl:value-of select="d:info/d:abstract"/>
+ </fo:block>
+ </xsl:when>
+ </xsl:choose>
</fo:block>
</xsl:template>
@@ -312,30 +250,23 @@
Custom Footer
################################################### -->
- <!-- This footer prints the Hibernate version number on the left side -->
+ <!-- This footer prints the Title on the left side -->
<xsl:template name="footer.content">
<xsl:param name="pageclass" select="''"/>
<xsl:param name="sequence" select="''"/>
<xsl:param name="position" select="''"/>
<xsl:param name="gentext-key" select="''"/>
<fo:block font-size="8pt">
- <xsl:variable name="Version">
- <xsl:choose>
- <xsl:when test="//d:revnumber">
- <xsl:value-of select="//d:title"/><xsl:text> </xsl:text><xsl:value-of select="//d:revnumber"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- nop -->
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:variable name="Title">
+ <xsl:value-of select="//d:title"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$sequence='blank'">
<xsl:choose>
<xsl:when test="$double.sided != 0 and $position = 'left'">
- <xsl:value-of select="$Version"/>
+ <xsl:value-of select="$Title"/>
</xsl:when>
<xsl:when test="$double.sided = 0 and $position = 'center'">
@@ -365,15 +296,15 @@
</xsl:when>
<xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='left'">
- <xsl:value-of select="$Version"/>
+ <xsl:value-of select="$Title"/>
</xsl:when>
<xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='right'">
- <xsl:value-of select="$Version"/>
+ <xsl:value-of select="$Title"/>
</xsl:when>
<xsl:when test="$double.sided = 0 and $position='left'">
- <xsl:value-of select="$Version"/>
+ <xsl:value-of select="$Title"/>
</xsl:when>
<xsl:otherwise>
@@ -688,8 +619,9 @@
################################################### -->
<!-- Use images for callouts instead of (1) (2) (3) -->
- <xsl:param name="callout.graphics" select="0" />
- <xsl:param name="callout.graphics.path">&admon_gfx_path;</xsl:param>
+ <xsl:param name="callout.graphics" select="1" />
+ <xsl:param name="callout.graphics.path">&callout_gfx_path;</xsl:param>
+ <xsl:param name="callout.graphics.number.limit" select="15" />
<xsl:param name="callout.unicode" select="1" />
<!-- Place callout marks at this column in annotated areas -->
View
@@ -19,8 +19,8 @@
<!DOCTYPE xsl:stylesheet [
<!-- The below path is defined by the docbook-xsl-ns Debian package -->
<!ENTITY db_xsl_path "/usr/share/xml/docbook/stylesheet/docbook-xsl-ns/">
- <!ENTITY callout_gfx_path "images/">
- <!ENTITY admon_gfx_path "images/">
+ <!ENTITY callout_gfx_path "/images/">
+ <!ENTITY admon_gfx_path "/images/">
]>
<xsl:stylesheet version="1.0"
@@ -119,7 +119,7 @@
<!-- Use images for callouts instead of (1) (2) (3) -->
<xsl:param name="callout.graphics" select="1" />
<xsl:param name="callout.graphics.path">&callout_gfx_path;</xsl:param>
- <xsl:param name="callout.graphics.number.limit" select="10" />
+ <xsl:param name="callout.graphics.number.limit" select="15" />
<!-- Place callout marks at this column in annotated areas -->
<xsl:param name="callout.defaultcolumn">90</xsl:param>
Oops, something went wrong.

0 comments on commit 46edb10

Please sign in to comment.