Class: CBETA::P5aToHTMLForPDF
- Inherits:
-
Object
- Object
- CBETA::P5aToHTMLForPDF
- Includes:
- CbetaShare
- Defined in:
- lib/cbeta/p5a_to_html_for_pdf.rb
Overview
Convert CBETA XML P5a to HTML for PDF
You can get CBETA XML P5a from: github.com/cbeta-git/xml-p5a
Instance Method Summary collapse
-
#convert(target = nil) ⇒ Object
將 CBETA XML P5a 轉為 HTML 供轉為 PDF.
-
#initialize(xml_root, out_root, opts = {}) ⇒ P5aToHTMLForPDF
constructor
A new instance of P5aToHTMLForPDF.
Methods included from CbetaShare
Constructor Details
#initialize(xml_root, out_root, opts = {}) ⇒ P5aToHTMLForPDF
Returns a new instance of P5aToHTMLForPDF.
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/cbeta/p5a_to_html_for_pdf.rb', line 33 def initialize(xml_root, out_root, opts={}) @config = { toc: true } @config.merge!(opts) @xml_root = xml_root @out_root = out_root @cbeta = CBETA.new @gaijis = CBETA::Gaiji.new end |
Instance Method Details
#convert(target = nil) ⇒ Object
將 CBETA XML P5a 轉為 HTML 供轉為 PDF
T 是大正藏的 ID, CBETA 的藏經 ID 系統請參考: www.cbeta.org/format/id.php
53 54 55 56 57 58 |
# File 'lib/cbeta/p5a_to_html_for_pdf.rb', line 53 def convert(target=nil) return convert_all if target.nil? arg = target.upcase convert_collection(arg) end |