add tag ramka
authorJan Szejko <janek37@gmail.com>
Mon, 6 Nov 2017 15:09:01 +0000 (16:09 +0100)
committerJan Szejko <janek37@gmail.com>
Fri, 10 Nov 2017 12:31:23 +0000 (13:31 +0100)
(cherry picked from commit 8a57745)

librarian/epub/style.css
librarian/epub/xsltScheme.xsl
librarian/fb2/paragraphs.xslt
librarian/html.py
librarian/pdf/wl.cls
librarian/pdf/wl2tex.xslt
librarian/xslt/book2html.xslt
librarian/xslt/book2txt.xslt
librarian/xslt/config.xml
scripts/master.css
tests/files/example-wl.xml

index 622c8da..176614d 100644 (file)
@@ -30,14 +30,14 @@ body, p, h1, h2, h3, h4 {
 
 body
 {
-       line-height: 1.5em;
-       margin: 0;
+    line-height: 1.5em;
+    margin: 0;
 }
 
 a
 {
-       text-decoration: none;
-       color: #00e;
+    text-decoration: none;
+    color: #00e;
 }
 
 a img {
@@ -57,11 +57,11 @@ a img {
 
 .h2
 {
-       font-size: 2em;
-       margin: 0;
-       margin-top: 1.5em;
-       font-weight: bold;
-       line-height: 1.5em;
+    font-size: 2em;
+    margin: 0;
+    margin-top: 1.5em;
+    font-weight: bold;
+    line-height: 1.5em;
 }
 
 .h3
@@ -75,15 +75,15 @@ a img {
 
 .h4
 {
-       font-size: 1em;
+    font-size: 1em;
     margin: 0;
     margin-top: 1.5em;
-       line-height: 1.5em;
+    line-height: 1.5em;
 }
 
 p
 {
-       margin: 0;
+    margin: 0;
 }
 
 /* ======================== */
@@ -92,19 +92,19 @@ p
 
 .theme-begin
 {
-       border-left: 0.1em solid #DDDDDD;
-       color: #777;
-       padding: 0 0.5em;
-       width: 7.5em;
-       font-style: normal;
-       font-weight: normal;
-       font-size: 0.875em;
-       float: right;
-       margin-right: -9.5em;
-       clear: both;
-       left: 40em;
-       line-height: 1.5em;
-       text-align: left;
+    border-left: 0.1em solid #DDDDDD;
+    color: #777;
+    padding: 0 0.5em;
+    width: 7.5em;
+    font-style: normal;
+    font-weight: normal;
+    font-size: 0.875em;
+    float: right;
+    margin-right: -9.5em;
+    clear: both;
+    left: 40em;
+    line-height: 1.5em;
+    text-align: left;
 }
 
 .annotation-anchor
@@ -207,9 +207,9 @@ p
     text-align: center;
     font-weight: bold;
 
-       font-size: 1.125em;
-       line-height: 1.5em;
-       margin-bottom: -0.25em;
+    font-size: 1.125em;
+    line-height: 1.5em;
+    margin-bottom: -0.25em;
 }
 
 .subtitle
@@ -282,6 +282,11 @@ div.dedication div.paragaph
 }
 
 
+.frame
+{
+    border: 1px darkgray solid;
+}
+
 hr.spacer
 {
        height: 3em;
index 01870e6..73faf5d 100644 (file)
     </div>
   </xsl:template>
 
+  <xsl:template match="ramka">
+    <div class="frame" xmlns="http://www.w3.org/1999/xhtml">
+      <xsl:apply-templates />
+    </div>
+  </xsl:template>
+
   <xsl:template match="motto">
     <div class="motto" xmlns="http://www.w3.org/1999/xhtml">
       <xsl:apply-templates />
index 68c6257..d292bee 100644 (file)
@@ -39,6 +39,9 @@
                <empty-line/><p>————————</p><empty-line/>
        </xsl:template>
 
+       <xsl:template mode="para" match="ramka">
+               <xsl:apply-templates mode="para" />
+       </xsl:template>
 
 
        <xsl:template mode="para" match="*"/>
index 70fc6e5..c634874 100644 (file)
@@ -208,7 +208,7 @@ def any_ancestor(element, test):
 def add_anchors(root):
     counter = 1
     for element in root.iterdescendants():
-        if any_ancestor(element, lambda e: e.get('class') in ('note', 'motto', 'motto_podpis', 'dedication')
+        if any_ancestor(element, lambda e: e.get('class') in ('note', 'motto', 'motto_podpis', 'dedication', 'frame')
         or e.get('id') == 'nota_red'
         or e.tag == 'blockquote'):
             continue
index 76f8530..a747754 100644 (file)
@@ -350,6 +350,13 @@ Letters={Uppercase}
 \end{em}%
 }
 
+\newcommand{\ramka}[1]{%
+\noindent\fbox{%
+\parbox{\textwidth}{%
+#1%
+}}%
+}
+
 \newcommand{\dlugicytat}[1]{%
 \begin{quotation}%
 %\raggedright%
index 985847f..024b2e0 100644 (file)
 <!-- ==================================================================================== -->
 
 <xsl:template
-    match="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny|nota|dedykacja|dlugi_cytat|poezja_cyt|motto">
+    match="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny|nota|dedykacja|dlugi_cytat|poezja_cyt|motto|ramka">
     <cmd>
         <xsl:attribute name="name">
             <xsl:value-of select="wl:texcommand(name())" />
index 9e914c5..778202e 100644 (file)
     <div class="dedication"><xsl:apply-templates /></div>
 </xsl:template>
 
+<xsl:template match="ramka">
+    <div class="frame"><xsl:apply-templates /></div>
+</xsl:template>
+
 <xsl:template match="kwestia">
     <div class="kwestia">
         <xsl:apply-templates select="strofa|akap|didaskalia" />
index 317e581..f41d154 100644 (file)
 <xsl:apply-templates />
 </xsl:template>
 
+<xsl:template match="ramka">
+<xsl:apply-templates />
+</xsl:template>
+
 <xsl:template match="lista_osob">
 <xsl:text>
 
index e9e999c..0ce90e7 100644 (file)
@@ -26,6 +26,7 @@
         <kwestia />
         <motto />
         <didaskalia />
+        <ramka />
     </block>
 
     <inline-elements element="span" mixed="true">
         <dlugi_cytat />
         <poezja_cyt />
 
+        <ramka />
+
         <didaskalia />
     </editable>
 </config>
index 44fe927..a222548 100644 (file)
@@ -175,6 +175,10 @@ div.note p, div.dedication p, div.note p.paragraph, div.dedication p.paragraph {
     font-style: italic;
 }
 
+div.frame {
+    border: 1px darkgray solid;
+}
+
 hr.spacer {
     height: 3em;
     visibility: hidden;
index d2fd87b..ca17e7b 100644 (file)
@@ -92,6 +92,10 @@ autor_utworu, dzielo_nadrzedne, nazwa_utworu, podtytul, tłumacz (z DC)]</akap>
 <dlugi_cytat><akap>Cytowany akapit powinien wyglądać jak cytowany akapit.
 Znaczy, może mieć jakieś dodatkowe wcięcie, jakiś rodzaj wyróżnienia czy coś.</akap></dlugi_cytat>
 
+<akap>[ramka/akap]</akap>
+
+<ramka><akap>To jest ramka. W ramce są akapity i inne takie.</akap></ramka>
+
 <akap>[poezja_cyt/strofa]</akap>
 
 <poezja_cyt><strofa>To jest poezja/