Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hdoc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Stephane Crozat
hdoc
Commits
38191260
Commit
38191260
authored
Dec 26, 2016
by
bperraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Transformation of list bullets to euro dash
parent
6294391a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
124 additions
and
108 deletions
+124
-108
hdoc_to_pdf/css/main.css
hdoc_to_pdf/css/main.css
+20
-6
hdoc_to_pdf/xsl/hdoc_flattenizer.xsl
hdoc_to_pdf/xsl/hdoc_flattenizer.xsl
+53
-52
hdoc_to_pdf/xsl/last_transformer.xsl
hdoc_to_pdf/xsl/last_transformer.xsl
+25
-23
hdoc_to_pdf/xsl/ns_remover.xsl
hdoc_to_pdf/xsl/ns_remover.xsl
+26
-27
No files found.
hdoc_to_pdf/css/main.css
View file @
38191260
...
...
@@ -63,19 +63,33 @@ h3 {counter-reset: h4}
h4
{
counter-reset
:
h5
}
h5
{
counter-reset
:
h6
}
h2
:before
{
counter-increment
:
h2
;
content
:
counter
(
h2
)
".\0000a0\0000a0"
}
h3
:before
{
counter-increment
:
h3
;
content
:
counter
(
h2
)
"."
counter
(
h3
)
".\0000a0\0000a0"
}
h4
:before
{
counter-increment
:
h4
;
content
:
counter
(
h2
)
"."
counter
(
h3
)
"."
counter
(
h4
)
".\0000a0\0000a0"
}
h5
:before
{
counter-increment
:
h5
;
content
:
counter
(
h2
)
"."
counter
(
h3
)
"."
counter
(
h4
)
"."
counter
(
h5
)
".\0000a0\0000a0"
}
h6
:before
{
counter-increment
:
h6
;
content
:
counter
(
h2
)
"."
counter
(
h3
)
"."
counter
(
h4
)
"."
counter
(
h5
)
"."
counter
(
h6
)
".\0000a0\0000a0"
}
h2
:
:
before
{
counter-increment
:
h2
;
content
:
counter
(
h2
)
".\0000a0\0000a0"
}
h3
:
:
before
{
counter-increment
:
h3
;
content
:
counter
(
h2
)
"."
counter
(
h3
)
".\0000a0\0000a0"
}
h4
:
:
before
{
counter-increment
:
h4
;
content
:
counter
(
h2
)
"."
counter
(
h3
)
"."
counter
(
h4
)
".\0000a0\0000a0"
}
h5
:
:
before
{
counter-increment
:
h5
;
content
:
counter
(
h2
)
"."
counter
(
h3
)
"."
counter
(
h4
)
"."
counter
(
h5
)
".\0000a0\0000a0"
}
h6
:
:
before
{
counter-increment
:
h6
;
content
:
counter
(
h2
)
"."
counter
(
h3
)
"."
counter
(
h4
)
"."
counter
(
h5
)
"."
counter
(
h6
)
".\0000a0\0000a0"
}
/* Global lists styling */
ul
>
li
>
p
,
ol
>
li
>
p
{
ul
>
li
p
,
ol
>
li
p
{
text-indent
:
0
;
}
ul
{
list-style-type
:
none
;
}
ul
>
li
{
position
:
relative
;
}
ul
>
li
::before
{
position
:
absolute
;
left
:
-5mm
;
content
:
"\2013"
;
}
/* Title formatting */
...
...
hdoc_to_pdf/xsl/hdoc_flattenizer.xsl
View file @
38191260
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
version=
"2.0"
xpath-default-namespace=
"http://www.w3.org/1999/xhtml"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema
"
xmlns=
"http://www.w3.org/1999/xhtml"
>
<xsl:output
method=
"xml"
indent=
"yes"
/
>
<xsl:template
match=
"node()|@*"
>
<
xsl:copy>
<xsl:apply-templates
select=
"node()|@*"
/
>
</xsl:copy>
</xsl:template
>
<
xsl:template
match=
"html
"
>
<html
lang=
"fr"
>
<xsl:apply-templates/
>
</html
>
</xsl:template>
<xsl:template
match=
"head"
>
<head>
<xsl:apply-templates
select=
"node()|@*"
/>
<link>
<xsl:attribute
name=
"rel"
>
stylesheet
</xsl:attribute>
<xsl:attribute
name=
"type"
>
text/css
</xsl:attribute>
<xsl:attribute
name=
"href"
>
main.css
</xsl:attribute>
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
version=
"2.0"
xpath-default-namespace=
"http://www.w3.org/1999/xhtml"
xmlns=
"http://www.w3.org/1999/xhtml
"
>
<xsl:output
method=
"xml"
indent=
"yes"
/>
<xsl:template
match=
"node()|@*"
>
<xsl:copy>
<xsl:apply-templates
select=
"node()|@*"
/
>
</
xsl:copy>
</xsl:template
>
<!-- Ajout de l'attribut lang --
>
<xsl:template
match=
"html"
>
<
html
lang=
"fr
"
>
<xsl:apply-templates/
>
</html
>
</xsl:template
>
<!-- Ajout de la référence au CSS -->
<xsl:template
match=
"head"
>
<head>
<xsl:apply-templates
select=
"node()|@*"
/>
<link>
<xsl:attribute
name=
"rel"
>
stylesheet
</xsl:attribute>
<xsl:attribute
name=
"type"
>
text/css
</xsl:attribute>
<xsl:attribute
name=
"href"
>
main.css
</xsl:attribute>
<xsl:attribute
name=
"media"
>
print
</xsl:attribute>
</link>
</head>
</xsl:template>
<xsl:template
match=
"section"
>
<xsl:variable
name=
"level"
select=
"count(ancestor::section) + 2"
/>
<div>
<xsl:element
name=
"h{$level}"
>
<xsl:value-of
select=
"header/h1"
/>
</xsl:element>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template
match=
"header"
>
</xsl:template>
<xsl:template
match=
"h6"
>
<xsl:variable
name=
"level"
select=
"count(ancestor::section) + 2"
/>
<xsl:element
name=
"h{$level}"
>
<xsl:value-of
select=
"."
/>
</xsl:element>
</xsl:template>
</link>
</head>
</xsl:template>
<!-- "Aplatissement" des sections en div avec numérotation correcte des hn -->
<xsl:template
match=
"section"
>
<xsl:variable
name=
"level"
select=
"count(ancestor::section) + 2"
/>
<div>
<xsl:element
name=
"h{$level}"
>
<xsl:value-of
select=
"header/h1"
/>
</xsl:element>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template
match=
"header"
>
</xsl:template>
<xsl:template
match=
"h6"
>
<xsl:variable
name=
"level"
select=
"count(ancestor::section) + 2"
/>
<xsl:element
name=
"h{$level}"
>
<xsl:value-of
select=
"."
/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
hdoc_to_pdf/xsl/last_transformer.xsl
View file @
38191260
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
version=
"2.0"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
xpath-default-namespace=
"http://www.w3.org/1999/xhtml"
>
<xsl:output
method=
"xml"
indent=
"yes"
/>
<xsl:template
match=
"node()|@*"
>
<xsl:copy>
<xsl:apply-templates
select=
"node()|@*"
/>
</xsl:copy>
</xsl:template>
<xsl:template
match=
"body"
>
<body>
<h1><xsl:value-of
select=
"/html/head/title"
/></h1>
<p
class=
"authors"
><xsl:value-of
select=
"/html/head/meta[@name='author']/@content"
/></p>
<xsl:apply-templates
select=
"node()|@*"
/>
</body>
</xsl:template>
<xsl:template
match=
"footer[not(node())]"
/>
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
version=
"2.0"
xpath-default-namespace=
"http://www.w3.org/1999/xhtml"
xmlns=
"http://www.w3.org/1999/xhtml"
>
<xsl:output
method=
"xml"
indent=
"yes"
/>
<xsl:template
match=
"node()|@*"
>
<xsl:copy>
<xsl:apply-templates
select=
"node()|@*"
/>
</xsl:copy>
</xsl:template>
<!-- Traitement du titre et des auteurs du document -->
<xsl:template
match=
"body"
>
<body>
<h1><xsl:value-of
select=
"/html/head/title"
/></h1>
<p
class=
"authors"
><xsl:value-of
select=
"/html/head/meta[@name='author']/@content"
/></p>
<xsl:apply-templates
select=
"node()|@*"
/>
</body>
</xsl:template>
<!-- Cleaning des footers vides -->
<xsl:template
match=
"footer[not(node())]"
/>
</xsl:stylesheet>
hdoc_to_pdf/xsl/ns_remover.xsl
View file @
38191260
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version=
"2.0"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xpath-default-namespace=
"http://www.utc.fr/ics/hdoc/xhtml"
xmlns=
"http://www.w3.org/1999/xhtml"
>
<xsl:output
method=
"xml"
indent=
"yes"
/>
<!-- Identity transformation -->
<xsl:template
match=
"node()|@*"
>
<xsl:copy>
<xsl:apply-templates
select=
"node()|@*"
/>
</xsl:copy>
</xsl:template>
<!-- Namespace substitution for hdoc elements -->
<xsl:template
match=
"*"
priority=
"1"
>
<xsl:element
name=
"{local-name()}"
>
<xsl:apply-templates
select=
"node()|@*"
/>
</xsl:element>
</xsl:template>
<!-- Suppress processing-instructions -->
<xsl:template
match=
"processing-instruction()"
priority=
"1"
/>
</xsl:stylesheet>
<xsl:stylesheet
version=
"2.0"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xpath-default-namespace=
"http://www.utc.fr/ics/hdoc/xhtml"
xmlns=
"http://www.w3.org/1999/xhtml"
>
<xsl:output
method=
"xml"
indent=
"yes"
/>
<!-- Identity transformation -->
<xsl:template
match=
"node()|@*"
>
<xsl:copy>
<xsl:apply-templates
select=
"node()|@*"
/>
</xsl:copy>
</xsl:template>
<!-- Namespace substitution for hdoc elements -->
<xsl:template
match=
"*"
priority=
"1"
>
<xsl:element
name=
"{local-name()}"
>
<xsl:apply-templates
select=
"node()|@*"
/>
</xsl:element>
</xsl:template>
<!-- Suppress processing-instructions -->
<xsl:template
match=
"processing-instruction()"
priority=
"1"
/>
</xsl:stylesheet>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment