Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
hdoc
Commits
75c39a3c
Commit
75c39a3c
authored
Dec 15, 2016
by
Raphaël
Browse files
Adding of main.css to flat_hdoc and leveling of titles+div
parent
3e3c0696
Changes
2
Hide whitespace changes
Inline
Side-by-side
hdoc_to_pdf/.Rhistory
0 → 100644
View file @
75c39a3c
hdoc_to_pdf/xsl/hdoc_flattenizer.xsl
View file @
75c39a3c
...
...
@@ -2,8 +2,11 @@
<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"
>
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"
/>
...
...
@@ -13,5 +16,47 @@
</xsl:copy>
</xsl:template>
<xsl:template
match=
"html"
>
<html>
<xsl:apply-templates/>
</html>
</xsl:template>
<xsl:template
match=
"head"
>
<head>
<xsl:apply-templates
select=
"node()|@*"
/>
<link>
<xsl:attribute
name=
"ref"
>
stylesheet
</xsl:attribute>
<xsl:attribute
name=
"type"
>
text/css
</xsl:attribute>
<xsl:attribute
name=
"href"
>
css/main.css
</xsl:attribute>
</link>
</head>
</xsl:template>
<xsl:template
match=
"section"
>
<xsl:variable
name=
"level"
select=
"count(ancestor::section) + 1"
/>
<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=
"div"
>
<xsl:variable
name=
"level"
select=
"count(ancestor::section) + 1"
/>
<div>
<xsl:element
name=
"h{$level}"
>
<xsl:value-of
select=
"h6"
/>
</xsl:element>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template
match=
"h6"
>
</xsl:template>
</xsl:stylesheet>
Write
Preview
Supports
Markdown
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