summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-03-07 01:09:35 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-03-07 01:09:35 +0100
commit83c85b543ba272509e4759604b729e8abcc3aaf7 (patch)
tree77fb9a1f244ba1d2f02b861ba6a5a8cfa1c5726b
parent623ee2f2b9895aec44592132b971f9eae9f81105 (diff)
Got impressum working, after a multi-hour struggle
-rw-r--r--Makefile2
-rw-r--r--impressum.osml34
-rw-r--r--ontology/webpage.osml47
-rw-r--r--style/style.less11
-rw-r--r--style/typography.less22
-rw-r--r--xsl/webpage.xsl46
6 files changed, 148 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 8e21c8e..396d6a3 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ style/style.css: style/*.less
lessc style/style.less style/style.css #--clean-css="--s1"
# Compile all osml files to xml
-%.xml: %.osml
+%.xml: %.osml ontology/*.osml
ousia -F xml -o $@ $<
# Compile the xml files to html
diff --git a/impressum.osml b/impressum.osml
new file mode 100644
index 0000000..34d87f7
--- /dev/null
+++ b/impressum.osml
@@ -0,0 +1,34 @@
+%{
+ Ousía Homepage
+
+ (c) Andreas Stöckel, Benjamin Paaßen 2015
+
+ This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
+ International License. <http://creativecommons.org/licenses/by-sa/4.0/>
+}%
+
+\import[ontology]{ontology/webpage}
+
+\begin{webpage}{Ousía Framework -- Impressum}
+
+\begin{section}
+ \title{Impressum}
+
+ Angaben gemäß § 5 TMG
+
+ \subsection{Anschrift}
+ \address{
+ \name{Andreas Stöckel}
+ \street{Arnikastr.}
+ \number{5}
+ \plz{33729}
+ \city{Bielefeld}
+ }
+
+ \subsection{Kontakt}
+ \phone[office]{+49 0521 44698871}
+ \mail{andreas.stoeckel@googlemail.com}
+\end{section}
+
+\end{webpage}
+
diff --git a/ontology/webpage.osml b/ontology/webpage.osml
index d92d652..e413b91 100644
--- a/ontology/webpage.osml
+++ b/ontology/webpage.osml
@@ -17,6 +17,7 @@
\childRef[ref=section]
% Primitve text
+\struct#block
\struct#primitive
\struct#text[isa=primitive,transparent=true]
\primitive[type=string]
@@ -28,18 +29,20 @@
\field#subtitle[subtree=true,optional=true]
\childRef[ref=primitive]
\field
- \childRef[ref=paragraph]
+ \childRef[ref=block]
\childRef[ref=subsection]
-% Paragraph
-\struct#paragraph[transparent=true]
- \field
- \childRef[ref=primitive]
-
% Subsection
\struct#subsection
+ \field#subtitle[subtree=true,optional=false]
+ \childRef[ref=primitive]
\field
- \childRef[ref=paragraph]
+ \childRef[ref=block]
+
+% Paragraph
+\struct#paragraph[isa=block,transparent=true]
+ \field
+ \childRef[ref=primitive]
% Masthead, Pitch
\struct#masthead[isa=section]
@@ -67,5 +70,35 @@
\field
\childRef[ref=primitive]
+% addresses
+
+\struct#contact[isa=block,transparent=true]
+ \field
+ \childRef[ref=address]
+ \childRef[ref=phone]
+ \childRef[ref=mail]
+
+\struct#address
+ \primitive#name[type=string,subtree=true]
+ \primitive#street[type=string,subtree=true]
+ \primitive#number[type=int,subtree=true]
+ \primitive#plz[type=string,subtree=true]
+ \primitive#city[type=string,subtree=true]
+
+\typesystem#phone{
+ \enum#phone-type
+ \entry{office}
+ \entry{home}
+ \entry{mobile}
+}
+
+\struct#phone
+ \attributes
+ \attribute#type[type=phone-type]
+ \primitive#number[type=string]
+
+\struct#mail
+ \primitive[type=string]
+
\end{ontology}
diff --git a/style/style.less b/style/style.less
index 5b5d2de..3348e93 100644
--- a/style/style.less
+++ b/style/style.less
@@ -149,6 +149,17 @@ main a.button:hover {
color: white;
}
+/*
+ * Addresses
+ */
+
+span.address, span.mail, span.phone {
+ display: block;
+}
+
+span.address > span {
+ display: block;
+}
/*
* For screen
diff --git a/style/typography.less b/style/typography.less
index 336cd9b..d104536 100644
--- a/style/typography.less
+++ b/style/typography.less
@@ -8,7 +8,6 @@ html {
}
p {
- line-height: 1.75;
margin-bottom: 0.5rem;
}
@@ -48,6 +47,10 @@ header, main {
background-color: @color-bg;
}
+dt {
+ font-weight: bold;
+}
+
/**
* Footnotes
*/
@@ -62,9 +65,14 @@ sup {
* Main text
*/
+main, footer {
+ line-height: 1.75;
+}
+
main {
h1, h2, h3, h4, h5, h6 {
+ color: @color-main;
margin-top: 0.25em;
margin-bottom: 0.25em;
}
@@ -73,6 +81,18 @@ main {
font-size: 200%;
}
+ h2 {
+ font-size: 150%;
+ }
+
+ h3 {
+ font-size: 125%;
+ }
+
+ h4, h5, h6 {
+ font-weight: bold;
+ }
+
}
diff --git a/xsl/webpage.xsl b/xsl/webpage.xsl
index c6310e2..26a167a 100644
--- a/xsl/webpage.xsl
+++ b/xsl/webpage.xsl
@@ -104,11 +104,11 @@
</section>
</xsl:template>
- <!-- Subsections -->
- <xsl:template match="webpage:pitch|webpage:nav|webpage:subsection">
+ <!-- Columns -->
+ <xsl:template match="webpage:pitch|webpage:nav">
<div>
- <xsl:variable name="seqNo"><xsl:number level="any" count="webpage:pitch|webpage:nav|webpage:subsection" format="1"/></xsl:variable>
- <xsl:variable name="class">subsection<xsl:if test="self::webpage:pitch"> pitch</xsl:if><xsl:if test="self::webpage:nav"> nav</xsl:if> <xsl:if test="$seqNo = 1"> first</xsl:if></xsl:variable>
+ <xsl:variable name="seqNo"><xsl:number level="any" count="webpage:pitch|webpage:nav" format="1"/></xsl:variable>
+ <xsl:variable name="class">column<xsl:if test="self::webpage:pitch"> pitch</xsl:if><xsl:if test="self::webpage:nav"> nav</xsl:if> <xsl:if test="$seqNo = 1"> first</xsl:if></xsl:variable>
<xsl:attribute name="class">
<xsl:value-of select="$class"/>
</xsl:attribute>
@@ -116,7 +116,7 @@
</div>
</xsl:template>
- <!-- Titles and subtitles -->
+ <!-- Titles and subtitles in sections -->
<xsl:template match="title">
<xsl:if test="webpage:text">
<h1><xsl:apply-templates select="webpage:text"/></h1>
@@ -128,6 +128,15 @@
</xsl:if>
</xsl:template>
+ <!-- Subsections -->
+
+ <xsl:template match="webpage:subsection">
+ <div>
+ <xsl:apply-templates select="subtitle"/>
+ <xsl:apply-templates select="webpage:*"/>
+ </div>
+ </xsl:template>
+
<!-- Paragraphs -->
<xsl:template match="webpage:paragraph">
<p>
@@ -149,6 +158,33 @@
<span class="ipa"> [<xsl:value-of select="pronunciation"/>] </span>
</xsl:template>
+ <!-- addresses -->
+
+ <xsl:template match="webpage:contact">
+ <dl>
+ <xsl:apply-templates select="webpage:address|webpage:mail|webpage:phone"/>
+ </dl>
+ </xsl:template>
+
+ <xsl:template match="webpage:address">
+ <dt>Adresse:</dt>
+ <dd>
+ <dl>
+ <dd class="name"><xsl:value-of select="name"/></dd>
+ <dd class="street"><xsl:value-of select="street"/><xsl:text> </xsl:text><xsl:value-of select="number"/></dd>
+ <dd class="city"><xsl:value-of select="plz"/><xsl:text> </xsl:text><xsl:value-of select="city"/></dd>
+ </dl>
+ </dd>
+ </xsl:template>
+
+ <xsl:template match="webpage:mail">
+ <dt>E-Mail:</dt><dd><xsl:value-of select="."/></dd>
+ </xsl:template>
+
+ <xsl:template match="webpage:phone">
+ <dt>Telefon:</dt><dd><xsl:value-of select="."/></dd>
+ </xsl:template>
+
<!-- Footnotes -->
<!-- Adapted from: http://www.microhowto.info/howto/create_a_list_of_numbered_footnotes_using_xslt.html -->
<xsl:template match="webpage:footnote">