return toxml(content, pretty_print=pretty_print)
dc_fixed = {
- 'description': u'Publikacja zrealizowana w ramach projektu Cyfrowa Przyszłość (http://cyfrowaprzyszlosc.pl).',
+ 'description': u'Publikacja zrealizowana w ramach projektu Cyfrowa Przyszłość (http://edukacjamedialna.edu.pl).',
'relation': u'moduły powiązane linki',
'description.material': u'linki do załączników',
'rights': u'Creative Commons Uznanie autorstwa - Na tych samych warunkach 3.0',
return content
+def mark_czytelnia(content):
+ db = -1
+ de = -1
+ i = 0
+ czy_czytelnia = re.compile(r"[\s]*czytelnia[\s]*", re.I)
+ czytelnia = content[0].spawn(List)
+ czytelnia.type = 'czytelnia'
+ while i < len(content):
+ e = content[i]
+ if isinstance(e, Section):
+ if czy_czytelnia.match(e.title):
+ db = i + 1
+ elif db >= 1:
+ de = i
+ content[db:de] = [czytelnia]
+ break
+ elif db >= 0:
+ if isinstance(e, Paragraph):
+ if e.line:
+ czytelnia.append(e.line)
+ i += 1
+
+ return content
+
+
+
def move_evaluation(content):
evaluation = []
# some transformations
content = mark_activities(content)
content = mark_dictionary(content)
+ content = mark_czytelnia(content)
+
try:
content = remove_block(content, r"wykorzyst(yw)?ane metody[+ PA\[\].]*")
except NotFound:
p("<utwor>")
p(u'<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">')
- p(u'<rdf:Description rdf:about="http://redakcja.cyfrowaprzyszlosc.pl/documents/">')
+ p(u'<rdf:Description rdf:about="http://redakcja.edukacjamedialna.edu.pl/documents/">')
authors = map(unicode.strip, meta[u'Autorzy'].split(u','))
for author in authors:
names = author.split(u' ')
dc(u'description', dc_fixed['description'])
dc(u'description.material', dc_fixed['description.material'])
dc(u'relation', dc_fixed['relation'])
- dc(u'identifier.url', u'http://cyfrowaprzyszlosc.pl/%s' % slug)
+ dc(u'identifier.url', u'http://edukacjamedialna.edu.pl/%s' % slug)
dc(u'rights', dc_fixed['rights'])
dc(u'rights.license', u'http://creativecommons.org/licenses/by-sa/3.0/')
dc(u'format', u'xml')
color: black;
}
-/* XXX */
-body {
- counter-reset: listanum;
-}
-
-.htmlview span.lista[data-wlf-typ="num"]
-{
- counter-reset: listanum;
- list-style-type: none;
- list-style-position: inside;
-}
-.htmlview span.lista[data-wlf-typ="num"] .punkt:before {
- counter-increment:listanum;
- content: counter(listanum) ". ";
-}
-.htmlview span.lista[data-wlf-typ="punk"]
+.htmlview .lista[data-wlf-typ="alfa"]
{
- list-style-type: disc;
+ list-style-type: lower-alpha;
}
-.htmlview span.lista[data-wlf-typ="slowniczek"]
+.htmlview .lista[data-wlf-typ="slowniczek"]
{
list-style-type: none;
}
</span>
</xsl:template>
+ <xsl:template match="lista">
+ <xsl:variable name="listtag">
+ <xsl:choose>
+ <xsl:when test="@typ='num' or @typ='alfa'">ol</xsl:when>
+ <xsl:when test="@typ='punkt' or @typ='slowniczek' or @typ='czytelnia'">ul</xsl:when>
+ <xsl:otherwise>ul</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="{$listtag}">
+ <xsl:call-template name="standard-attributes" />
+ <xsl:apply-templates select="child::node()">
+ <xsl:with-param name="mixed" select="true()" />
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:template>
+
- <xsl:template match="punkt">
- <span x-editable="true" x-node="punkt" class="punkt">
+ <xsl:template match="punkt[../@typ='slowniczek']">
+ <dl x-node="punkt" class="punkt">
<xsl:call-template name="standard-attributes" />
<xsl:apply-templates select="child::node()">
<xsl:with-param name="mixed" select="true()" />
</xsl:apply-templates>
- </span>
+ </dl>
+ </xsl:template>
+
+ <xsl:template match="punkt[../@typ!='slowniczek']">
+ <li x-editable="true" x-node="punkt" class="punkt">
+ <xsl:call-template name="standard-attributes" />
+ <xsl:apply-templates select="child::node()">
+ <xsl:with-param name="mixed" select="true()" />
+ </xsl:apply-templates>
+ </li>
+ </xsl:template>
+
+
+ <xsl:template match="definiendum">
+ <dt x-editable="true" x-node="definiendum" class="definiendum">
+ <xsl:call-template name="standard-attributes" />
+ <xsl:apply-templates select="child::node()">
+ <xsl:with-param name="mixed" select="true()" />
+ </xsl:apply-templates>
+ </dt>
+ </xsl:template>
+
+ <xsl:template match="definiens">
+ <dd x-editable="true" x-node="definiendum" class="definiendum">
+ <xsl:call-template name="standard-attributes" />
+ <xsl:apply-templates select="child::node()">
+ <xsl:with-param name="mixed" select="true()" />
+ </xsl:apply-templates>
+ </dd>
</xsl:template>
<!--