• R/O
  • SSH
  • HTTPS

sotp: Commit


Commit MetaInfo

Revision108 (tree)
Time2009-08-31 12:15:51
Authormiyabe

Log Message

(empty log message)

Change Summary

Incremental Difference

--- reiki/trunk/tools/make-toc.pl (revision 107)
+++ reiki/trunk/tools/make-toc.pl (revision 108)
@@ -202,7 +202,7 @@
202202 }
203203 }
204204
205- my $file = aj_get_number_part($filename);
205+ my $file = Ajino::aj_get_number_part($filename);
206206 print OUT "<r:statute file=\"$file\">\n";
207207 if ($handler->{kana}) {
208208 print OUT "<r:title>$handler->{title}<r:kana>$handler->{kana}</r:kana></r:title>\n";
--- reiki/trunk/tools/make-index.pl (revision 107)
+++ reiki/trunk/tools/make-index.pl (revision 108)
@@ -5,7 +5,7 @@
55 use XML::SAX::ParserFactory;
66 use htdocs::lib::Ajino;
77
8-my $db = aj_get_db();
8+my $db = Ajino::aj_get_db();
99 my $stmt = $db->prepare("INSERT INTO search(word,kana,file,score,surrounding)
1010 VALUES (?,?,?,1,?)");
1111 my $stmt2 = $db->prepare("UPDATE search SET score=? WHERE file=? AND word=?");
--- reiki/trunk/tools/make-pdf.pl (revision 107)
+++ reiki/trunk/tools/make-pdf.pl (revision 108)
@@ -7,8 +7,9 @@
77 use htdocs::lib::Ajino;
88
99 my $xslt = XML::LibXSLT->new();
10-$xslt->register_function("urn:perl", "filter", \&aj_xslt_filter);
11-my $stylesheet = $xslt->parse_stylesheet_file('htdocs/style/pdf-statute.xsl');
10+$xslt->register_function("urn:perl", "filter", \&Ajino::aj_xslt_filter);
11+my $tocStyle = $xslt->parse_stylesheet_file('htdocs/style/pdf-toc.xsl');
12+my $statuteStyle = $xslt->parse_stylesheet_file('htdocs/style/pdf-statute.xsl');
1213
1314 my $dir = $ARGV[0];
1415 my $pdfWorkDir = "$dir/_pdf";
@@ -16,13 +17,26 @@
1617 mkdir($pdfWorkDir);
1718 mkdir($pdfDir);
1819
20+# 目次
1921 {
22+ my $results = $tocStyle->transform_file("$dir/toc.xml");
23+ my $session = Ajino::get_cssj_session();
24+ open(CONTENT, ">$pdfWorkDir/!010toc.pdf");
25+ $session->set_output(*CONTENT);
26+ $session->start_main(*STDOUT, '.', 'text/html', 'UTF-8');
27+ binmode(STDOUT);
28+ $tocStyle->output_fh( $results, *STDOUT );
29+ $session->end_main(*STDOUT);
30+ $session->close();
31+ close(CONTENT);
32+}
33+
34+{
2035 package TocHandler;
2136 use strict;
2237 use utf8;
2338 use base qw( XML::SAX::Base );
2439 use htdocs::lib::Ajino;
25- require 'htdocs/lib/PDF.pm';
2640
2741 sub new {
2842 my $class = shift;
@@ -62,7 +76,7 @@
6276 # 編の扉
6377 $self->{partHead} = 0;
6478
65- my $session = get_cssj_session();
79+ my $session = Ajino::get_cssj_session();
6680 $file =~ /(.*)-/;
6781 open(CONTENT, ">$pdfWorkDir/$1.pdf");
6882 $session->set_output(*CONTENT);
@@ -78,17 +92,27 @@
7892 }
7993 h1 {
8094 text-align: center;
81- margin-top: 23mm;
95+ margin-top: 45mm;
96+ margin-left: 28mm;
97+ font-size: 20pt;
98+ font-weight: normal;
99+ page-break-after: left;
100+ position: relative;
101+ z-index: 10;
82102 }
83-body {
103+div {
84104 background-color: -cssj-gray(80%);
85- margin: -3mm;
86- padding-top: 25mm 19mm 25mm 31mm;
87- page-break-after: left;
105+ top: -3mm;
106+ left: -3mm;
107+ right: -3mm;
108+ bottom: -3mm;
109+ -cssj-page-content: fill;
110+ z-index: 0;
88111 }
89112 </style>
90113 </head>
91114 <body>
115+ <div></div>
92116 <h1>$self->{partMarker} $self->{partTitle}</h1>
93117 </body>
94118 </html>
@@ -111,9 +135,9 @@
111135 $params{'markerOffset'} = $1 % 20 * 10 - 22;
112136
113137 # 例規
114- my $results = $stylesheet->transform_file("$dir/content/$file.xml", %params);
138+ my $results = $statuteStyle->transform_file("$dir/content/$file.xml", %params);
115139
116- my $session = get_cssj_session();
140+ my $session = Ajino::get_cssj_session();
117141 open(CONTENT, ">$pdfWorkDir/$file.pdf");
118142 my $pageNumber;
119143 open(META, ">$pdfDir/$file.pdf.meta.xml");
@@ -136,7 +160,7 @@
136160 $session->set_output(*CONTENT);
137161 $session->start_main(*STDOUT, '.');
138162 binmode(STDOUT);
139- $stylesheet->output_fh( $results, *STDOUT );
163+ $statuteStyle->output_fh( $results, *STDOUT );
140164 $session->end_main(*STDOUT);
141165 $session->close();
142166 print META "<number-of-pages>$pageNumber</number-of-pages>\n";
--- reiki/trunk/htdocs/style/pdf-toc.css (nonexistent)
+++ reiki/trunk/htdocs/style/pdf-toc.css (revision 108)
@@ -0,0 +1,59 @@
1+@import 'pdf-common.css';
2+
3+div.title h1 {
4+ page-break-after: left;
5+ text-align: center;
6+ margin-top: 23mm;
7+ font-size: 20pt;
8+}
9+
10+h1 {
11+ font-size: 12pt;
12+}
13+h2 {
14+ font-size: 12pt;
15+ border-bottom: 1pt solid;
16+ border-left: 1em solid;
17+ padding-left: .5em;
18+ margin-top: 2em;
19+}
20+h3 {
21+ font-size: 10pt;
22+ margin-left: 1em;
23+}
24+h1, h2, h3 {
25+ font-weight: normal;
26+}
27+h2 b,
28+h3 b {
29+ margin-right: 1em;
30+}
31+div.statute {
32+ clear: both;
33+ position: relative;
34+ page-break-inside: avoid;
35+}
36+span.title {
37+ display: inline-block;
38+ max-width: 80mm;
39+ padding-right: 1em;
40+}
41+span.title span {
42+ background-color: White;
43+ padding-left: 1em;
44+}
45+span.page {
46+ position: absolute;
47+ background-color: White;
48+ padding-left: .5em;
49+ bottom: 0;
50+ right: 0;
51+}
52+div.statute div {
53+ height: .6em;
54+ margin-top: -.6em;
55+ border-top: 1pt dotted;
56+}
57+div.page-break {
58+ page-break-before: right;
59+}
\ No newline at end of file
--- reiki/trunk/htdocs/style/common-statute.xsl (revision 107)
+++ reiki/trunk/htdocs/style/common-statute.xsl (revision 108)
@@ -34,6 +34,12 @@
3434 <td class="nowrap">最終改正:</td>
3535 <td class="date"><xsl:apply-templates select="r:revisions/r:revision[position()=last()]" /></td>
3636 </tr>
37+ <tr>
38+ <td class="nowrap">図書掲載頁:</td>
39+ <td class="date"><xsl:value-of select="number(substring-before($file,'-'))"/>-<xsl:value-of select="number(substring-after($file,'-'))"/>-1
40+~
41+<xsl:value-of select="document(concat('../data/pdf/',$file,'.pdf.meta.xml'))/meta/number-of-pages/text()" /></td>
42+ </tr>
3743 </table>
3844 <hr/>
3945 <xsl:call-template name="buttons" />
@@ -359,18 +365,11 @@
359365
360366 <xsl:template name="buttons">
361367 <div class="buttons">
362- <button type="button" onclick="window.print()">印刷</button>
363- <button type="button" onclick="window.open('../data/content/{$file}.xml')">XML</button>
364- <button type="button" onclick="window.open('../edit/{$file}.xml')">編集</button>
368+ <a href="javascript:window.print()">印刷</a>
369+ <a href="../data/pdf/{$file}.pdf" target="_blank">PDF</a>
370+ <a href="../data/content/{$file}.xml" target="_blank">XML</a>
371+ <a href="../edit/{$file}.xml" target="_blank">編集</a>
365372 </div>
366- <hr />
367- <div class="buttons">
368-<button type="button" onclick="window.open('../data/pdf/{$file}.pdf')">PDF</button>
369-図書掲載頁
370-<xsl:value-of select="number(substring-before($file,'-'))"/>-<xsl:value-of select="number(substring-after($file,'-'))"/>-1
371-~
372-<xsl:value-of select="document(concat('../data/pdf/',$file,'.pdf.meta.xml'))/meta/number-of-pages/text()" />頁
373- </div>
374373 </xsl:template>
375374
376375 <!-- テキスト処理 -->
--- reiki/trunk/htdocs/style/pdf-common.css (nonexistent)
+++ reiki/trunk/htdocs/style/pdf-common.css (revision 108)
@@ -0,0 +1,77 @@
1+@page {
2+ margin-top: 22mm;
3+ margin-left: 16mm;
4+ margin-right: 16mm;
5+ margin-bottom: 22mm;
6+ counter-increment: page;
7+}
8+@page:right {
9+ margin-left: 28mm;
10+}
11+
12+@page:left {
13+ margin-right: 28mm;
14+}
15+
16+/* 最終ページは常に左に来させるため。 */
17+body {
18+ page-break-after: left;
19+}
20+
21+body,td {
22+ font: normal 8pt/1.35 IPAPMincho;
23+ text-align: justify;
24+ margin: 0;
25+}
26+
27+a:link {
28+ text-decoration: none;
29+ color: Black;
30+}
31+span.number {
32+ display: inline-block;
33+ min-width: 1.2em;
34+ text-align: center;
35+ text-indent: 0;
36+}
37+#nombre-left, #nombre-right {
38+ bottom: -10mm;
39+ width: 100%;
40+ font: normal 7pt/1 sans-serif;
41+}
42+
43+#nombre-left {
44+ -cssj-page-content: nombre-left left;
45+ text-align: left;
46+ padding-left: 2em;
47+}
48+
49+#nombre-right {
50+ -cssj-page-content: nombre-right right;
51+ text-align: right;
52+ padding-right: 2em;
53+}
54+
55+#nombre-left:after,
56+#nombre-right:after {
57+ content: counter(page);
58+}
59+
60+#header-left,
61+#header-right {
62+ top: -10mm;
63+ width: 100%;
64+ border-bottom: .5pt solid Black;
65+ vertical-align: middle;
66+ line-height: 2.4;
67+}
68+
69+#header-left {
70+ -cssj-page-content: header-left left;
71+ text-align: left;
72+}
73+
74+#header-right {
75+ -cssj-page-content: header-right right;
76+ text-align: right;
77+}
--- reiki/trunk/htdocs/style/pdf-statute.css (revision 107)
+++ reiki/trunk/htdocs/style/pdf-statute.css (revision 108)
@@ -1,28 +1,5 @@
1-@page {
2- margin-top: 22mm;
3- margin-left: 16mm;
4- margin-right: 16mm;
5- margin-bottom: 22mm;
6- counter-increment: page;
7-}
8-@page:right {
9- margin-left: 28mm;
10-}
1+@import 'pdf-common.css';
112
12-@page:left {
13- margin-right: 28mm;
14-}
15-
16-/* 最終ページは常に左に来させるため。 */
17-body {
18- page-break-after: left;
19-}
20-
21-body,td {
22- font: normal 8pt/1.35 IPAPMincho;
23- text-align: justify;
24- margin: 0;
25-}
263 img {
274 max-width: 83mm;
285 max-height: 143mm;
@@ -49,58 +26,6 @@
4926 orphans: 10;
5027 }
5128
52-a:link {
53- text-decoration: none;
54- color: Black;
55-}
56-span.number {
57- display: inline-block;
58- min-width: 1.2em;
59- text-align: center;
60- text-indent: 0;
61-}
62-
63-#nombre-left, #nombre-right {
64- bottom: -10mm;
65- width: 100%;
66- font: normal 7pt/1 sans-serif;
67-}
68-
69-#nombre-left {
70- -cssj-page-content: nombre-left left;
71- text-align: left;
72- padding-left: 2em;
73-}
74-
75-#nombre-right {
76- -cssj-page-content: nombre-right right;
77- text-align: right;
78- padding-right: 2em;
79-}
80-
81-#nombre-left:after,
82-#nombre-right:after {
83- content: counter(page);
84-}
85-
86-#header-left,
87-#header-right {
88- top: -10mm;
89- width: 100%;
90- border-bottom: .5pt solid Black;
91- vertical-align: middle;
92- line-height: 2.4;
93-}
94-
95-#header-left {
96- -cssj-page-content: header-left left;
97- text-align: left;
98-}
99-
100-#header-right {
101- -cssj-page-content: header-right right;
102- text-align: right;
103-}
10429 #marker-left,
10530 #marker-right {
10631 width: 10mm;
--- reiki/trunk/htdocs/style/browse-toc.xsl (revision 107)
+++ reiki/trunk/htdocs/style/browse-toc.xsl (revision 108)
@@ -23,6 +23,7 @@
2323 <xsl:call-template name="sidebar" />
2424
2525 <div class="main">
26+ <div>掲載例規 <xsl:value-of select="count(descendant::r:statute)" />件</div>
2627 <xsl:apply-templates select="r:part|r:chapter|r:section|r:subsection|r:division" mode="main"/>
2728 </div>
2829 </div>
@@ -37,7 +38,9 @@
3738
3839 <xsl:template name="navigator">
3940 <h1><xsl:value-of select="$title"/></h1>
40- <div class="date"><xsl:value-of select="$date"/>現在</div>
41+ <div class="date">
42+ <xsl:value-of select="$date"/>現在
43+ </div>
4144 <hr/>
4245 <div class="navigator">
4346 <a href="aiueo.html">五十音目次</a><br />
@@ -51,6 +54,11 @@
5154 <xsl:template name="sidebar">
5255 <div class="sidebar">
5356 <xsl:call-template name="navigator" />
57+ <div class="buttons">
58+ <a href="../data/toc.xml">XML</a>
59+ <a href="../data/pdf/!010toc.pdf">PDF</a>
60+ </div>
61+ <hr/>
5462 <h3>体系</h3>
5563 <div class="outline">
5664 <ul>
@@ -58,8 +66,6 @@
5866 </ul>
5967 </div>
6068 <hr/>
61- <button type="button" onclick="window.open('../data/toc.xml')">XML</button>
62- <hr/>
6369 </div>
6470 </xsl:template>
6571
@@ -77,6 +83,9 @@
7783 <!-- 体系見出し -->
7884 <xsl:template match="r:part" mode="main">
7985 <div id="{generate-id()}">
86+ <div class="volume">
87+ <xsl:value-of select="count(descendant::r:statute)" />件
88+ </div>
8089 <h2><b><xsl:value-of select="r:marker/text()" /></b>
8190 <xsl:value-of select="r:text/text()" /></h2>
8291 <xsl:call-template name="statutes" />
@@ -96,10 +105,11 @@
96105 <xsl:if test="r:statute">
97106 <table>
98107 <thead>
108+<tr>
99109 <th>件名</th>
100110 <th>制定年月日</th>
101111 <th>種別・番号</th>
102- <th>図書掲載頁</th>
112+</tr>
103113 </thead>
104114 <tbody><xsl:apply-templates select="r:statute" mode="main"/></tbody></table>
105115 </xsl:if>
@@ -109,11 +119,6 @@
109119 <td class="title"><a href="{@file}.html"><xsl:value-of select="r:title/text()" /></a></td>
110120 <td class="revision"><xsl:value-of select="r:revision/@date" /></td>
111121 <td class="revision"><xsl:value-of select="r:revision/text()" /></td>
112- <td class="revision"><a href="../data/pdf/{@file}.pdf" target="_blank">
113- <xsl:value-of select="number(substring-before(@file,'-'))"/>-<xsl:value-of select="number(substring-after(@file,'-'))"/>-1
114- ~
115- <xsl:value-of select="r:number-of-pages/text()" />
116- </a></td>
117122 </tr>
118123 </xsl:template>
119124 <xsl:template match="node()" priority="-1" mode="main" />
--- reiki/trunk/htdocs/style/pdf-toc.xsl (nonexistent)
+++ reiki/trunk/htdocs/style/pdf-toc.xsl (revision 108)
@@ -0,0 +1,231 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<xsl:stylesheet version="1.0"
3+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4+ xmlns:r="http://www.cssj.jp/ns/reiki"
5+ xmlns:html="http://www.w3.org/1999/xhtml">
6+ <xsl:variable name="title" select="/r:toc/r:title"/>
7+ <xsl:variable name="date" select="/r:toc/r:date"/>
8+
9+ <xsl:template match="/r:toc">
10+ <html>
11+ <head>
12+ <style type="text/css">
13+ @import 'style/pdf-toc.css';
14+ </style>
15+ </head>
16+ <body>
17+ <div class="title">
18+ <h1><xsl:value-of select="$title" /> 目次</h1>
19+ </div>
20+ <div id="nombre-left"></div>
21+ <div id="nombre-right"></div>
22+ <div id="header-left"><xsl:value-of select="$title" /> 体系目次</div>
23+ <div id="header-right"><xsl:value-of select="$title" /> 体系目次</div>
24+ <h1>体系目次</h1>
25+ <xsl:apply-templates select="r:part|r:chapter|r:section|r:subsection|r:division" mode="main"/>
26+
27+ <div class="page-break"></div>
28+
29+ <div id="header-left"><xsl:value-of select="$title" /> 五十音順目次</div>
30+ <div id="header-right"><xsl:value-of select="$title" /> 五十音順目次</div>
31+ <h1>五十音順目次</h1>
32+ <xsl:call-template name="main">
33+ <xsl:with-param name="prefix">あ</xsl:with-param>
34+ </xsl:call-template>
35+ <xsl:call-template name="main">
36+ <xsl:with-param name="prefix">い</xsl:with-param>
37+ </xsl:call-template>
38+ <xsl:call-template name="main">
39+ <xsl:with-param name="prefix">う</xsl:with-param>
40+ </xsl:call-template>
41+ <xsl:call-template name="main">
42+ <xsl:with-param name="prefix">え</xsl:with-param>
43+ </xsl:call-template>
44+ <xsl:call-template name="main">
45+ <xsl:with-param name="prefix">お</xsl:with-param>
46+ </xsl:call-template>
47+
48+ <xsl:call-template name="main">
49+ <xsl:with-param name="prefix">か</xsl:with-param>
50+ </xsl:call-template>
51+ <xsl:call-template name="main">
52+ <xsl:with-param name="prefix">き</xsl:with-param>
53+ </xsl:call-template>
54+ <xsl:call-template name="main">
55+ <xsl:with-param name="prefix">く</xsl:with-param>
56+ </xsl:call-template>
57+ <xsl:call-template name="main">
58+ <xsl:with-param name="prefix">け</xsl:with-param>
59+ </xsl:call-template>
60+ <xsl:call-template name="main">
61+ <xsl:with-param name="prefix">こ</xsl:with-param>
62+ </xsl:call-template>
63+
64+ <xsl:call-template name="main">
65+ <xsl:with-param name="prefix">さ</xsl:with-param>
66+ </xsl:call-template>
67+ <xsl:call-template name="main">
68+ <xsl:with-param name="prefix">し</xsl:with-param>
69+ </xsl:call-template>
70+ <xsl:call-template name="main">
71+ <xsl:with-param name="prefix">す</xsl:with-param>
72+ </xsl:call-template>
73+ <xsl:call-template name="main">
74+ <xsl:with-param name="prefix">せ</xsl:with-param>
75+ </xsl:call-template>
76+ <xsl:call-template name="main">
77+ <xsl:with-param name="prefix">そ</xsl:with-param>
78+ </xsl:call-template>
79+
80+ <xsl:call-template name="main">
81+ <xsl:with-param name="prefix">た</xsl:with-param>
82+ </xsl:call-template>
83+ <xsl:call-template name="main">
84+ <xsl:with-param name="prefix">ち</xsl:with-param>
85+ </xsl:call-template>
86+ <xsl:call-template name="main">
87+ <xsl:with-param name="prefix">つ</xsl:with-param>
88+ </xsl:call-template>
89+ <xsl:call-template name="main">
90+ <xsl:with-param name="prefix">て</xsl:with-param>
91+ </xsl:call-template>
92+ <xsl:call-template name="main">
93+ <xsl:with-param name="prefix">と</xsl:with-param>
94+ </xsl:call-template>
95+
96+ <xsl:call-template name="main">
97+ <xsl:with-param name="prefix">な</xsl:with-param>
98+ </xsl:call-template>
99+ <xsl:call-template name="main">
100+ <xsl:with-param name="prefix">に</xsl:with-param>
101+ </xsl:call-template>
102+ <xsl:call-template name="main">
103+ <xsl:with-param name="prefix">ぬ</xsl:with-param>
104+ </xsl:call-template>
105+ <xsl:call-template name="main">
106+ <xsl:with-param name="prefix">ね</xsl:with-param>
107+ </xsl:call-template>
108+ <xsl:call-template name="main">
109+ <xsl:with-param name="prefix">の</xsl:with-param>
110+ </xsl:call-template>
111+
112+ <xsl:call-template name="main">
113+ <xsl:with-param name="prefix">は</xsl:with-param>
114+ </xsl:call-template>
115+ <xsl:call-template name="main">
116+ <xsl:with-param name="prefix">ひ</xsl:with-param>
117+ </xsl:call-template>
118+ <xsl:call-template name="main">
119+ <xsl:with-param name="prefix">ふ</xsl:with-param>
120+ </xsl:call-template>
121+ <xsl:call-template name="main">
122+ <xsl:with-param name="prefix">へ</xsl:with-param>
123+ </xsl:call-template>
124+ <xsl:call-template name="main">
125+ <xsl:with-param name="prefix">ほ</xsl:with-param>
126+ </xsl:call-template>
127+
128+ <xsl:call-template name="main">
129+ <xsl:with-param name="prefix">ま</xsl:with-param>
130+ </xsl:call-template>
131+ <xsl:call-template name="main">
132+ <xsl:with-param name="prefix">み</xsl:with-param>
133+ </xsl:call-template>
134+ <xsl:call-template name="main">
135+ <xsl:with-param name="prefix">む</xsl:with-param>
136+ </xsl:call-template>
137+ <xsl:call-template name="main">
138+ <xsl:with-param name="prefix">め</xsl:with-param>
139+ </xsl:call-template>
140+ <xsl:call-template name="main">
141+ <xsl:with-param name="prefix">も</xsl:with-param>
142+ </xsl:call-template>
143+
144+ <xsl:call-template name="main">
145+ <xsl:with-param name="prefix">や</xsl:with-param>
146+ </xsl:call-template>
147+ <xsl:call-template name="main">
148+ <xsl:with-param name="prefix">ゆ</xsl:with-param>
149+ </xsl:call-template>
150+ <xsl:call-template name="main">
151+ <xsl:with-param name="prefix">よ</xsl:with-param>
152+ </xsl:call-template>
153+
154+ <xsl:call-template name="main">
155+ <xsl:with-param name="prefix">ら</xsl:with-param>
156+ </xsl:call-template>
157+ <xsl:call-template name="main">
158+ <xsl:with-param name="prefix">り</xsl:with-param>
159+ </xsl:call-template>
160+ <xsl:call-template name="main">
161+ <xsl:with-param name="prefix">る</xsl:with-param>
162+ </xsl:call-template>
163+ <xsl:call-template name="main">
164+ <xsl:with-param name="prefix">れ</xsl:with-param>
165+ </xsl:call-template>
166+ <xsl:call-template name="main">
167+ <xsl:with-param name="prefix">ろ</xsl:with-param>
168+ </xsl:call-template>
169+
170+ <xsl:call-template name="main">
171+ <xsl:with-param name="prefix">わ</xsl:with-param>
172+ </xsl:call-template>
173+ <xsl:call-template name="main">
174+ <xsl:with-param name="prefix">を</xsl:with-param>
175+ </xsl:call-template>
176+ <xsl:call-template name="main">
177+ <xsl:with-param name="prefix">ん</xsl:with-param>
178+ </xsl:call-template>
179+ </body>
180+ </html>
181+ </xsl:template>
182+
183+ <!-- 体系見出し -->
184+ <xsl:template match="r:part" mode="main">
185+ <div>
186+ <h2><b><xsl:value-of select="r:marker/text()" /></b>
187+ <xsl:value-of select="r:text/text()" /></h2>
188+ <xsl:apply-templates select="r:statute" mode="main"/>
189+ <xsl:apply-templates select="r:part|r:chapter|r:section|r:subsection|r:division" mode="main"/>
190+ </div>
191+ </xsl:template>
192+ <xsl:template match="r:chapter|r:section|r:subsection|r:division" mode="main">
193+ <div id="{generate-id()}">
194+ <h3><b><xsl:value-of select="r:marker/text()" /></b>
195+ <xsl:value-of select="r:text/text()" /></h3>
196+ <xsl:apply-templates select="r:statute" mode="main"/>
197+ <xsl:apply-templates select="r:part|r:chapter|r:section|r:subsection|r:division" mode="main"/>
198+ </div>
199+ </xsl:template>
200+
201+ <!-- 五十音見出し -->
202+ <xsl:template name="main">
203+ <xsl:param name="prefix" />
204+ <xsl:if test="descendant::r:statute[substring(r:title/r:kana/html:u/text(),1,1)=$prefix]">
205+ <div id="{$prefix}">
206+ <h2><b><xsl:value-of select="$prefix" /></b></h2>
207+ <xsl:apply-templates select="descendant::r:statute[substring(r:title/r:kana/html:u/text(),1,1)=$prefix]" mode="main">
208+ <xsl:sort select="r:title/r:kana/html:u/text()" lang="ja"/>
209+ </xsl:apply-templates>
210+ </div>
211+ </xsl:if>
212+ </xsl:template>
213+
214+ <!-- 例規 -->
215+ <xsl:template match="r:statute" mode="main">
216+ <div class="statute">
217+ <span class="page">
218+ <xsl:value-of select="number(substring-before(@file,'-'))"/>-<xsl:value-of select="number(substring-after(@file,'-'))"/>-1
219+ </span>
220+ <span class="title"><span>
221+ <a href="{@file}.html"><xsl:value-of select="r:title/text()" /></a>
222+ <xsl:if test="r:revision/@date">
223+ (<xsl:value-of select="r:revision/@date" /><xsl:value-of select="r:revision/text()" />)
224+ </xsl:if>
225+ </span></span>
226+ <div></div>
227+ </div>
228+ </xsl:template>
229+ <xsl:template match="node()" priority="-1" mode="main" />
230+
231+</xsl:stylesheet>
--- reiki/trunk/htdocs/style/pdf-statute.xsl (revision 107)
+++ reiki/trunk/htdocs/style/pdf-statute.xsl (revision 108)
@@ -14,10 +14,17 @@
1414 <head>
1515 <style type="text/css">
1616 @import 'style/pdf-statute.css';
17- #marker-left,
18- #marker-right {
19- top: <xsl:value-of select="$markerOffset"/>mm;
20- }
17+ #marker-left,
18+ #marker-right {
19+ top: <xsl:value-of select="$markerOffset"/>mm;
20+ }
21+ <xsl:if test="$chapterHead">
22+ h1 {
23+ visibility: hidden;
24+ margin: 0;
25+ height: 0;
26+ }
27+ </xsl:if>
2128 </style>
2229 <xsl:call-template name="head" />
2330 </head>
@@ -34,11 +41,9 @@
3441 <div id="header-right"><span class="h1"></span><span class="h2"><img src="style/pdf/lb.svgz" class="lb"/><img src="style/pdf/rb.svgz" class="rb"/></span></div>
3542 <div id="marker-left"></div>
3643 <div id="marker-right"></div>
37-<xsl:if test="$chapterHead">
3844 <h1>
3945 <xsl:apply-templates select="r:statutes/r:chapter/r:marker/node()" mode="html"/> <xsl:apply-templates select="r:statutes/r:chapter/r:text/node()" mode="html"/>
4046 </h1>
41-</xsl:if>
4247 <h2>○<xsl:apply-templates select="r:title/node()" mode="html"/></h2>
4348 <xsl:apply-templates select="r:revisions/r:revision[@date][1]" mode="established"/>
4449 <xsl:apply-templates select="r:revisions" mode="revisions"/>
--- reiki/trunk/htdocs/style/common-statute.css (revision 107)
+++ reiki/trunk/htdocs/style/common-statute.css (revision 108)
@@ -61,7 +61,7 @@
6161 div.sidebar div.navigator a {
6262 margin-right: 1em;
6363 }
64-div.sidebar div.buttons button {
64+div.sidebar div.buttons a {
6565 margin-right: 1em;
6666 }
6767 div.sidebar span.caption {
--- reiki/trunk/htdocs/style/browse-aiueo.xsl (revision 107)
+++ reiki/trunk/htdocs/style/browse-aiueo.xsl (revision 108)
@@ -379,7 +379,6 @@
379379 <th>件名</th>
380380 <th>制定年月日</th>
381381 <th>種別・番号</th>
382- <th>図書掲載頁</th>
383382 </thead>
384383 <tbody>
385384 <xsl:apply-templates select="descendant::r:statute[substring(r:title/r:kana/html:u/text(),1,1)=$prefix]" mode="main">
@@ -399,11 +398,6 @@
399398 </td>
400399 <td class="revision"><xsl:value-of select="r:revision/@date" /></td>
401400 <td class="revision"><xsl:value-of select="r:revision/text()" /></td>
402- <td class="revision"><a href="../data/pdf/{@file}.pdf" target="_blank">
403- <xsl:value-of select="number(substring-before(@file,'-'))"/>-<xsl:value-of select="number(substring-after(@file,'-'))"/>-1
404- ~
405- <xsl:value-of select="r:number-of-pages/text()" />
406- </a></td>
407401 </tr>
408402 </xsl:template>
409403 <xsl:template match="node()" priority="-1" mode="main" />
--- reiki/trunk/htdocs/style/browse-search.xsl (revision 107)
+++ reiki/trunk/htdocs/style/browse-search.xsl (revision 108)
@@ -63,12 +63,7 @@
6363 </xsl:template>
6464
6565 <xsl:template match="word">
66- <div>
67- <xsl:value-of select="text()"/>
68- <xsl:if test="kana/text() and text()!=kana/text()">
69- (<xsl:value-of select="kana/text()"/>)
70- </xsl:if>
71- </div>
66+ <div><xsl:value-of select="text()"/></div>
7267 </xsl:template>
7368
7469 <xsl:template name="main">
--- reiki/trunk/htdocs/style/browse-toc.css (revision 107)
+++ reiki/trunk/htdocs/style/browse-toc.css (revision 108)
@@ -10,6 +10,10 @@
1010 div.main {
1111 font-size: 12pt;
1212 }
13+div.main div.volume {
14+ float: right;
15+ font-size: 10pt;
16+}
1317 div.main h2 {
1418 font-weight: normal;
1519 font-size: 16pt;
--- reiki/trunk/htdocs/lib/PDF.pm (revision 107)
+++ reiki/trunk/htdocs/lib/PDF.pm (nonexistent)
@@ -1,38 +0,0 @@
1-use strict;
2-use utf8;
3-use File::Basename;
4-use CSSJ::Driver("create_driver_for");
5-
6-sub get_cssj_session() {
7- my $driver = create_driver_for( 'localhost', '8099', "utf-8" );
8- my $session = $driver->create_session( 'user', 'kappa' );
9- $session->set_property( 'output.pdf.version', '1.4A-1' );
10- $session->set_property( 'output.pdf.fonts.policy', 'embedded' );
11- $session->set_property( 'output.pdf.bookmarks', 'true' );
12- $session->set_property( 'output.page-width', '148mm' );
13- $session->set_property( 'output.page-height', '210mm' );
14-
15- my $dir = dirname(__FILE__).'/../';
16- $session->start_resource( *STDOUT, "style/pdf-statute.css", 'text/css');
17- binmode(STDOUT);
18- open( IN_RSRC, "$dir/style/pdf-statute.css");
19- while (<IN_RSRC>) { print; }
20- close(IN_RSRC);
21- $session->end_resource(*STDOUT);
22-
23- my $imgbase = "$dir/style/pdf";
24- opendir DH, $imgbase;
25- while ( my $imgfile = readdir DH ) {
26- next if substr($imgfile, 0, 1) eq '.';
27- $session->start_resource( *STDOUT, "style/pdf/$imgfile" );
28- binmode(STDOUT);
29- open( IN_IMG, "$imgbase/$imgfile" );
30- while (<IN_IMG>) { print; }
31- close(IN_IMG);
32- $session->end_resource(*STDOUT);
33- }
34- closedir DH;
35-
36- return $session;
37-}
38-1;
\ No newline at end of file
--- reiki/trunk/htdocs/lib/Ajino.pm (revision 107)
+++ reiki/trunk/htdocs/lib/Ajino.pm (revision 108)
@@ -1,6 +1,9 @@
1+package Ajino;
12 use strict;
23 use utf8;
34 use DBI;
5+use File::Basename;
6+use CSSJ::Driver("create_driver_for");
47
58 use constant AJ_REIKI_URI => 'http://www.cssj.jp/ns/reiki';
69
@@ -19,4 +22,50 @@
1922 return $node;
2023 }
2124
25+sub get_cssj_session() {
26+ my $driver = create_driver_for( 'localhost', '8099', "utf-8" );
27+ my $session = $driver->create_session( 'user', 'kappa' );
28+ $session->set_property( 'output.pdf.version', '1.4A-1' );
29+ $session->set_property( 'output.pdf.fonts.policy', 'embedded' );
30+ $session->set_property( 'output.pdf.bookmarks', 'true' );
31+ $session->set_property( 'output.page-width', '148mm' );
32+ $session->set_property( 'output.page-height', '210mm' );
33+ $session->set_property( 'output.clip', 'false' );
34+
35+ my $dir = dirname(__FILE__).'/../';
36+ $session->start_resource( *STDOUT, "style/pdf-common.css", 'text/css');
37+ binmode(STDOUT);
38+ open( IN_RSRC, "$dir/style/pdf-common.css");
39+ while (<IN_RSRC>) { print; }
40+ close(IN_RSRC);
41+ $session->end_resource(*STDOUT);
42+ $session->start_resource( *STDOUT, "style/pdf-statute.css", 'text/css');
43+ binmode(STDOUT);
44+ open( IN_RSRC, "$dir/style/pdf-statute.css");
45+ while (<IN_RSRC>) { print; }
46+ close(IN_RSRC);
47+ $session->end_resource(*STDOUT);
48+ $session->start_resource( *STDOUT, "style/pdf-toc.css", 'text/css');
49+ binmode(STDOUT);
50+ open( IN_RSRC, "$dir/style/pdf-toc.css");
51+ while (<IN_RSRC>) { print; }
52+ close(IN_RSRC);
53+ $session->end_resource(*STDOUT);
54+
55+ my $imgbase = "$dir/style/pdf";
56+ opendir DH, $imgbase;
57+ while ( my $imgfile = readdir DH ) {
58+ next if substr($imgfile, 0, 1) eq '.';
59+ $session->start_resource( *STDOUT, "style/pdf/$imgfile" );
60+ binmode(STDOUT);
61+ open( IN_IMG, "$imgbase/$imgfile" );
62+ while (<IN_IMG>) { print; }
63+ close(IN_IMG);
64+ $session->end_resource(*STDOUT);
65+ }
66+ closedir DH;
67+
68+ return $session;
69+}
70+
2271 1;
\ No newline at end of file
Show on old repository browser