cbeta 2.2.21 → 2.2.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cbeta/p5a_to_html_for_pdf.rb +12 -27
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c051fafb22469b41ce99482cb6c7e42c2b57a934
|
4
|
+
data.tar.gz: b844d9fd876dcda4236f3c0d74b21baa234fec5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74c281e563811da223290c5cd35fc5246bae9f25267d634c553010ed3e9e7a9d7451d745b54408dbda05bec0218e1ac553fcb447b34c7ab37dd6bdbe806782cc
|
7
|
+
data.tar.gz: 25a7190bde65648a11d5ea65f476b247a406c50736df9f66c1f9b90c12f7f14e3af7581023e4a397bd2fa4270134f9c9e66df257abed8bda7f752af8b8fdcaf7
|
@@ -43,37 +43,17 @@ class CBETA::P5aToHTMLForPDF
|
|
43
43
|
|
44
44
|
# 將 CBETA XML P5a 轉為 HTML 供轉為 PDF
|
45
45
|
#
|
46
|
-
# @example for convert 大正藏第一冊:
|
47
|
-
#
|
48
|
-
# c = CBETA::P5aToHTMLForPDF.new('/PATH/TO/CBETA/XML/P5a', '/OUTPUT/FOLDER')
|
49
|
-
# c.convert('T01')
|
50
|
-
#
|
51
46
|
# @example for convert 大正藏全部:
|
52
47
|
#
|
53
48
|
# c = CBETA::P5aToHTMLForPDF.new('/PATH/TO/CBETA/XML/P5a', '/OUTPUT/FOLDER')
|
54
49
|
# c.convert('T')
|
55
50
|
#
|
56
|
-
# @example for convert 大正藏第五冊至第七冊:
|
57
|
-
#
|
58
|
-
# c = CBETA::P5aToHTMLForPDF.new('/PATH/TO/CBETA/XML/P5a', '/OUTPUT/FOLDER')
|
59
|
-
# c.convert('T05..T07')
|
60
|
-
#
|
61
51
|
# T 是大正藏的 ID, CBETA 的藏經 ID 系統請參考: http://www.cbeta.org/format/id.php
|
62
52
|
def convert(target=nil)
|
63
53
|
return convert_all if target.nil?
|
64
54
|
|
65
55
|
arg = target.upcase
|
66
|
-
|
67
|
-
convert_collection(arg)
|
68
|
-
else
|
69
|
-
if arg.include? '..'
|
70
|
-
arg.match(/^([^\.]+?)\.\.([^\.]+)$/) {
|
71
|
-
handle_vols($1, $2)
|
72
|
-
}
|
73
|
-
else
|
74
|
-
handle_vol(arg)
|
75
|
-
end
|
76
|
-
end
|
56
|
+
convert_collection(arg)
|
77
57
|
end
|
78
58
|
|
79
59
|
private
|
@@ -129,7 +109,10 @@ class CBETA::P5aToHTMLForPDF
|
|
129
109
|
|
130
110
|
def convert_collection(c)
|
131
111
|
@series = c
|
132
|
-
puts '
|
112
|
+
puts 'convert_collection ' + c
|
113
|
+
|
114
|
+
@orig = @cbeta.get_canon_abbr(c)
|
115
|
+
|
133
116
|
folder = File.join(@xml_root, @series)
|
134
117
|
@works = {}
|
135
118
|
prepare_work_list(folder)
|
@@ -385,13 +368,14 @@ class CBETA::P5aToHTMLForPDF
|
|
385
368
|
end
|
386
369
|
|
387
370
|
def handle_lem(e)
|
388
|
-
r =
|
371
|
+
r = nil
|
389
372
|
w = e['wit']
|
390
|
-
if
|
391
|
-
|
392
|
-
|
393
|
-
|
373
|
+
if e.key? 'wit'
|
374
|
+
if (w.include? 'CBETA') and (not w.include? @orig)
|
375
|
+
r = "<span class='corr'>%s</span>" % traverse(e)
|
376
|
+
end
|
394
377
|
end
|
378
|
+
r = traverse(e) if r.nil?
|
395
379
|
r
|
396
380
|
end
|
397
381
|
|
@@ -633,6 +617,7 @@ class CBETA::P5aToHTMLForPDF
|
|
633
617
|
|
634
618
|
@orig = @cbeta.get_canon_abbr(vol[0])
|
635
619
|
abort "未處理底本" if @orig.nil?
|
620
|
+
puts "#{__LINE__} orig: #{@orig}"
|
636
621
|
|
637
622
|
@vol = vol
|
638
623
|
@series = CBETA.get_canon_from_vol(vol)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbeta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ray Chou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby gem for use Chinese Buddhist Text resources made by CBETA (http://www.cbeta.org).
|
14
14
|
email: zhoubx@gmail.com
|