From: Jan Szejko Date: Thu, 27 Jul 2017 09:41:30 +0000 (+0200) Subject: increased word spacing in WL XML X-Git-Tag: 1.7~43 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/a4af74c13b9139bb75ce9e6d40d743f58089b2ef?ds=sidebyside increased word spacing in WL XML --- diff --git a/librarian/epub/style.css b/librarian/epub/style.css index d217cce..78ed5bc 100644 --- a/librarian/epub/style.css +++ b/librarian/epub/style.css @@ -330,6 +330,12 @@ em.author-emphasis letter-spacing: 0.1em; } +em.wieksze-odstepy +{ + font-style: normal; + word-spacing: 1em; +} + .person-list em.person { font-style: normal; diff --git a/librarian/epub/xsltScheme.xsl b/librarian/epub/xsltScheme.xsl index 29966e4..3b7036c 100644 --- a/librarian/epub/xsltScheme.xsl +++ b/librarian/epub/xsltScheme.xsl @@ -270,6 +270,12 @@ + + + + + + diff --git a/librarian/fb2/inline.xslt b/librarian/fb2/inline.xslt index 3429e29..351d13c 100644 --- a/librarian/fb2/inline.xslt +++ b/librarian/fb2/inline.xslt @@ -39,6 +39,9 @@ + + + diff --git a/librarian/pdf/wl.cls b/librarian/pdf/wl.cls index 824ac19..4d010a9 100644 --- a/librarian/pdf/wl.cls +++ b/librarian/pdf/wl.cls @@ -533,6 +533,11 @@ Letters={Uppercase} \newcommand{\indeksdolny}[1]{% \textsubscript{#1}% } +\newcommand{\wiekszeodstepy}[1]{% +\spaceskip 3\fontdimen2\font plus 3\fontdimen3\font minus 3\fontdimen4\font \relax% +#1% +\spaceskip \fontdimen2\font plus \fontdimen3\font minus \fontdimen4\font \relax% +} \newcommand{\osoba}[1]{% #1% diff --git a/librarian/pdf/wl2tex.xslt b/librarian/pdf/wl2tex.xslt index f26f62a..4c8be32 100644 --- a/librarian/pdf/wl2tex.xslt +++ b/librarian/pdf/wl2tex.xslt @@ -362,7 +362,7 @@ + match="pa|pe|pr|pt|mat|didask_tekst|slowo_obce|wyroznienie|osoba|indeks_dolny|wieksze_odstepy"> diff --git a/librarian/xslt/book2html.xslt b/librarian/xslt/book2html.xslt index d62071e..c4757e1 100644 --- a/librarian/xslt/book2html.xslt +++ b/librarian/xslt/book2html.xslt @@ -303,6 +303,10 @@ + + + + diff --git a/librarian/xslt/book2txt.xslt b/librarian/xslt/book2txt.xslt index 514d624..36032cf 100644 --- a/librarian/xslt/book2txt.xslt +++ b/librarian/xslt/book2txt.xslt @@ -282,6 +282,10 @@ + + + + diff --git a/librarian/xslt/config.xml b/librarian/xslt/config.xml index 113c464..29905da 100644 --- a/librarian/xslt/config.xml +++ b/librarian/xslt/config.xml @@ -37,6 +37,7 @@ + diff --git a/librarian/xslt/normalize.xslt b/librarian/xslt/normalize.xslt deleted file mode 100644 index 435c30a..0000000 --- a/librarian/xslt/normalize.xslt +++ /dev/null @@ -1,405 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - p - - - - - - - - - - - - - - - - - - dot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ` - - - - - - ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Nieprzetworzony węzeł: - - - - - - - - \ No newline at end of file diff --git a/scripts/master.css b/scripts/master.css index 44fe927..b2ea786 100644 --- a/scripts/master.css +++ b/scripts/master.css @@ -210,3 +210,8 @@ em.person { font-variant: small-caps; } +em.wieksze-odstepy +{ + font-style: normal; + word-spacing: 1em; +} diff --git a/scripts/normalize.py b/scripts/normalize.py deleted file mode 100644 index 6f6013f..0000000 --- a/scripts/normalize.py +++ /dev/null @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from __future__ import with_statement - -import re -import sys -import os.path - -sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - -from StringIO import StringIO -from lxml import etree -import librarian - -REPLACEMENTS = ( - (u'---', u'\u2014'), # mdash - (u'--', u'\u2013'), # ndash - (u'...', u'\u2026'), # ldots - (u',,', u'\u201E'), # lower double back-quote - (u'"', u'\u201D'), # upper double quote -) - -DIALOG_EXPR = re.compile(r"\s*---\s(.*)") - -def wl_normalize_text(context, text): - """XPath extension function converting all entites in passed text.""" - if isinstance(text, list): - text = u''.join(text) - - for code, ucode in REPLACEMENTS: - text = text.replace(code, ucode) - - return text - -def wl_fix_dialog(context, data): - - if isinstance(data, list): - text = u''.join(data) - else: - text = data - - m = DIALOG_EXPR.match(text) - - if m is not None: - return m.group(1) - else: - return text - - -def filter_verse_ends(data): - return data.replace('/\n', '
') - -ns = etree.FunctionNamespace('http://wolnelektury.pl/functions') -ns['normalize-text'] = wl_normalize_text -ns['fix-dialog-line'] = wl_fix_dialog - -def normalize_stylesheet(): - return etree.XSLT(etree.parse(os.path.join(os.path.dirname(librarian.__file__), 'xslt', 'normalize.xslt'))) - -if __name__ == '__main__': - tran = normalize_stylesheet() - input = StringIO( f ) - doc = trans( etree.parse(input) ) - print etree.tostring(doc, pretty_print=True, encoding=unicode).encode('utf-8') - - for err in trans.error_log: - sys.stderr.write( (u"%s\n" % err).encode('utf-8') ) - diff --git a/tests/files/example-wl.xml b/tests/files/example-wl.xml index 945eee5..3c4b29b 100644 --- a/tests/files/example-wl.xml +++ b/tests/files/example-wl.xml @@ -129,6 +129,7 @@ rzu. wyroznienie, slowo_obce indeks_dolny: H2O +większe odstępy między słowami [Przypisy: pa, pt, pr, pe]