pbsimply 3.6.2 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pbsimply/accs.rb +1 -1
- data/lib/pbsimply/docengine/misc.rb +7 -7
- data/lib/pbsimply/docengine/rdoc.rb +1 -2
- data/lib/pbsimply/document.rb +3 -3
- data/lib/pbsimply/eruby.rb +112 -0
- data/lib/pbsimply/frontmatter.rb +8 -2
- data/lib/pbsimply/template-engine.rb +46 -0
- data/lib/pbsimply.rb +13 -3
- data/themes/pandoc/_pandoc_base/.accsindex.erb +24 -27
- data/themes/pandoc/_pandoc_base/.pbsimply.yaml +10 -0
- data/themes/pandoc/_pandoc_new/.accsindex.erb +24 -27
- data/themes/pandoc/_pandoc_new/.pbsimply.yaml +10 -0
- data/themes/rbmdlib/init322/.accsindex.erb +13 -16
- data/themes/rbmdlib/init322/.pbsimply.yaml.erb +10 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 717a87ae1856795d8986e631c8d5d116755d6424a6e1dd1c2327e7d06eaac809
|
|
4
|
+
data.tar.gz: c36c32dd6bff2322e7424930a557a247354a05095f61f748940ea946e7f156ce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 129096f38f40fcce9d44f6c4e3a530a163d84b0211047dddf89b3a0d044e7fa54d62d1da7a51802824b58e0cc5f809e8237e01454dc874b1c159aec45f6339e2
|
|
7
|
+
data.tar.gz: 69dbd490e5cdd2194d04037fa04605ca8c1968304cdf8cf39e8bddddd17cf587d41b36dc20f7b70c126676d5173d69ad3a61cdfe3f7136df051f1f095350c76b
|
data/lib/pbsimply/accs.rb
CHANGED
|
@@ -24,8 +24,7 @@ class PBSimply
|
|
|
24
24
|
article_body = markdown.render(File.read procdoc)
|
|
25
25
|
|
|
26
26
|
# Process with eRuby temaplte.
|
|
27
|
-
|
|
28
|
-
doc = erb_template.result(binding)
|
|
27
|
+
doc = expand_template binding
|
|
29
28
|
|
|
30
29
|
doc
|
|
31
30
|
end
|
|
@@ -51,8 +50,7 @@ class PBSimply
|
|
|
51
50
|
article_body = markdown.to_html
|
|
52
51
|
|
|
53
52
|
# Process with eRuby temaplte.
|
|
54
|
-
|
|
55
|
-
doc = erb_template.result(binding)
|
|
53
|
+
doc = expand_template binding
|
|
56
54
|
|
|
57
55
|
doc
|
|
58
56
|
end
|
|
@@ -71,13 +69,15 @@ class PBSimply
|
|
|
71
69
|
|
|
72
70
|
def process_document(dir, filename, frontmatter, orig_filepath, ext, procdoc)
|
|
73
71
|
options = @config["commonmarker_options"] ? @config["commonmarker_options"].transform_keys(&:to_sym) : {}
|
|
72
|
+
options.each do |k,v|
|
|
73
|
+
options[k] = v.transform_keys(&:to_sym)
|
|
74
|
+
end
|
|
74
75
|
|
|
75
76
|
# Getting HTML string.
|
|
76
|
-
article_body = Commonmarker.
|
|
77
|
+
article_body = Commonmarker.to_html(File.read(procdoc), options: options)
|
|
77
78
|
|
|
78
79
|
# Process with eRuby temaplte.
|
|
79
|
-
|
|
80
|
-
doc = erb_template.result(binding)
|
|
80
|
+
doc = expand_template binding
|
|
81
81
|
|
|
82
82
|
doc
|
|
83
83
|
end
|
|
@@ -20,8 +20,7 @@ class PBSimply
|
|
|
20
20
|
article_body = rdoc.convert(get_markup_document(procdoc))
|
|
21
21
|
|
|
22
22
|
# Process with eRuby temaplte.
|
|
23
|
-
|
|
24
|
-
doc = erb_template.result(binding)
|
|
23
|
+
doc = expand_template binding
|
|
25
24
|
|
|
26
25
|
doc
|
|
27
26
|
end
|
data/lib/pbsimply/document.rb
CHANGED
|
@@ -13,8 +13,8 @@ class PBSimply
|
|
|
13
13
|
@now = pbs.now
|
|
14
14
|
@accs_processing = pbs.accs_processing
|
|
15
15
|
@outfile = pbs.outfile
|
|
16
|
-
|
|
17
|
-
@frontmatter = pbs.frontmatter.merge
|
|
16
|
+
fmt, @pos = read_frontmatter(pbs.dir, filename)
|
|
17
|
+
@frontmatter = pbs.frontmatter.merge fmt
|
|
18
18
|
@modified = true
|
|
19
19
|
@proc_doc_path = nil
|
|
20
20
|
end
|
|
@@ -42,7 +42,7 @@ class PBSimply
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
def draft?
|
|
45
|
-
frontmatter["draft"]
|
|
45
|
+
frontmatter["draft"] || frontmatter["pbsimply_exclude"]
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def to_a
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/bin/env ruby
|
|
2
|
+
require 'time'
|
|
3
|
+
require 'erb'
|
|
4
|
+
|
|
5
|
+
module PBSimply::ERuby
|
|
6
|
+
include ::ERB::Util
|
|
7
|
+
|
|
8
|
+
class WrapErubi
|
|
9
|
+
def initialize
|
|
10
|
+
require 'erubi'
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def load_doc str
|
|
14
|
+
@processor = ::Erubi::Engine.new(str)
|
|
15
|
+
self
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def generate bounded
|
|
19
|
+
eval(@processor.src, bounded)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
class WrapErubis
|
|
24
|
+
def initialize
|
|
25
|
+
require 'erubis'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def load_doc str
|
|
29
|
+
@processor = ::Erubis::Eruby.new(str)
|
|
30
|
+
self
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def generate bounded
|
|
34
|
+
@processor.result(bounded)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
class WrapErb
|
|
39
|
+
def initialize config
|
|
40
|
+
@config = config
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def load_doc str
|
|
44
|
+
@processor = ::ERB.new(str, trim_mode: (@config["erb_trm_mode"] || "%<>"))
|
|
45
|
+
self
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def generate bounded
|
|
49
|
+
@processor.result(bounded)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def erblib
|
|
54
|
+
return @eruby_lib if @eruby_lib
|
|
55
|
+
case @config["eruby_lib"]
|
|
56
|
+
when "erubis"
|
|
57
|
+
@eruby_lib = WrapErubis.new
|
|
58
|
+
when "erubi"
|
|
59
|
+
@eruby_lib = WrapErubi.new
|
|
60
|
+
else
|
|
61
|
+
@eruby_lib = WrapErb.new @config
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
@eruby_lib
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def file_and_render fp, bounded
|
|
68
|
+
erblib.load_doc(File.read(fp)).generate(bounded)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def str_and_render str, bounded
|
|
72
|
+
erblib.load_doc(str).generate(bounded)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
private
|
|
76
|
+
|
|
77
|
+
def parse_time
|
|
78
|
+
if (Numeric === time_elem && time_elem > 1000000000000)
|
|
79
|
+
# JavaScript milliseconds
|
|
80
|
+
Time.at(time_elem / 1000)
|
|
81
|
+
elsif Numeric === time_elem
|
|
82
|
+
# Unix
|
|
83
|
+
Time.at(time_elem)
|
|
84
|
+
elsif String === time_elem
|
|
85
|
+
# Generic String
|
|
86
|
+
Time.parse(time_elem)
|
|
87
|
+
elsif Array === time_elem
|
|
88
|
+
# #local arguments array
|
|
89
|
+
Time.local(*time_elem)
|
|
90
|
+
else
|
|
91
|
+
Time.now
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def iso8601 time_elem
|
|
96
|
+
parse_time(time_elem).iso8601
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def httpdate time_elem
|
|
100
|
+
parse_time(time_elem).httpdate
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def rfc822 time_elem
|
|
104
|
+
parse_time(time_elem).rfc822
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
alias rfc2822 rfc822
|
|
108
|
+
|
|
109
|
+
def xmldate time_elem
|
|
110
|
+
parse_time(time_elem).xmlschema
|
|
111
|
+
end
|
|
112
|
+
end
|
data/lib/pbsimply/frontmatter.rb
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/bin/env ruby
|
|
2
2
|
require 'erb'
|
|
3
3
|
require 'yaml'
|
|
4
|
+
require 'time'
|
|
5
|
+
require 'date'
|
|
4
6
|
|
|
5
7
|
module PBSimply::Frontmatter
|
|
6
8
|
# Read Frontmatter from the document.
|
|
@@ -132,6 +134,11 @@ module PBSimply::Frontmatter
|
|
|
132
134
|
end
|
|
133
135
|
|
|
134
136
|
raise PBSimply::DocumentError.new("This document has no frontmatter") unless frontmatter
|
|
137
|
+
|
|
138
|
+
if (frontmatter["draft"] || frontmatter["pbsimply_exclude"])
|
|
139
|
+
return frontmatter, pos
|
|
140
|
+
end
|
|
141
|
+
|
|
135
142
|
raise PBSimply::DocumentError.new("This document has no title.") unless frontmatter["title"]
|
|
136
143
|
|
|
137
144
|
outpath = case
|
|
@@ -170,8 +177,7 @@ module PBSimply::Frontmatter
|
|
|
170
177
|
frontmatter["title_encoded"] = ERB::Util.url_encode(frontmatter["title"])
|
|
171
178
|
frontmatter["title_html_escaped"] = ERB::Util.html_escape(frontmatter["title"])
|
|
172
179
|
fts = frontmatter["timestamp"]
|
|
173
|
-
|
|
174
|
-
if DateTime === fts
|
|
180
|
+
if Time === fts || DateTime === fts
|
|
175
181
|
frontmatter["timestamp_xmlschema"] = fts.xmlschema
|
|
176
182
|
frontmatter["timestamp_jplocal"] = fts.strftime('%Y年%m月%d日 %H時%M分%S秒')
|
|
177
183
|
frontmatter["timestamp_rubytimestr"] = fts.strftime('%a %b %d %H:%M:%S %Z %Y')
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/bin/env ruby
|
|
2
|
+
|
|
3
|
+
module PBSimply::TemplateEngine
|
|
4
|
+
class TplEngineLiquid
|
|
5
|
+
def initialize template
|
|
6
|
+
require 'liquid'
|
|
7
|
+
@template = template
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def generate frontmatter, article_body
|
|
11
|
+
Liquid::Template.parse(@template).render(
|
|
12
|
+
"frontmatter" => frontmatter,
|
|
13
|
+
"article_body" => body
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
class TplEngineMustache
|
|
19
|
+
def initialize template
|
|
20
|
+
require 'mustache'
|
|
21
|
+
@template = template
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def generate frontmatter, article_body
|
|
25
|
+
Mustache.render(@template, {
|
|
26
|
+
frontmatter: frontmatter,
|
|
27
|
+
article_body: article_body
|
|
28
|
+
})
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def expand_template binding
|
|
33
|
+
$stderr.puts @config["template_format"]
|
|
34
|
+
case @config["template_format"]
|
|
35
|
+
when "liquid"
|
|
36
|
+
tpl = TplEngineLiquid.new(File.read(@config["template"]))
|
|
37
|
+
tpl.generate(binding.local_variable_get(:frontmatter), binding.local_variable_get(:article_body))
|
|
38
|
+
when "mustache"
|
|
39
|
+
$stderr.puts "mustache"
|
|
40
|
+
tpl = TplEngineMustache.new(File.read(@config["template"]))
|
|
41
|
+
tpl.generate(binding.local_variable_get(:frontmatter), binding.local_variable_get(:article_body))
|
|
42
|
+
else
|
|
43
|
+
file_and_render(@config["template"], binding)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
data/lib/pbsimply.rb
CHANGED
|
@@ -17,13 +17,17 @@ require 'pbsimply/prayer'
|
|
|
17
17
|
require 'pbsimply/plugger'
|
|
18
18
|
require 'pbsimply/hooks'
|
|
19
19
|
require 'pbsimply/accs'
|
|
20
|
-
require 'pbsimply/config-checker
|
|
20
|
+
require 'pbsimply/config-checker'
|
|
21
21
|
require 'pbsimply/document'
|
|
22
|
+
require 'pbsimply/eruby'
|
|
23
|
+
require 'pbsimply/template-engine'
|
|
22
24
|
|
|
23
25
|
class PBSimply
|
|
24
26
|
include Prayer
|
|
25
27
|
include Plugger
|
|
26
28
|
include ACCS
|
|
29
|
+
include ERuby
|
|
30
|
+
include TemplateEngine
|
|
27
31
|
|
|
28
32
|
# Custom exception
|
|
29
33
|
class PBSimplyError < StandardError
|
|
@@ -223,13 +227,19 @@ class PBSimply
|
|
|
223
227
|
draft_articles = []
|
|
224
228
|
target_docs = []
|
|
225
229
|
effective_docs = []
|
|
230
|
+
exclude_files = []
|
|
226
231
|
$stderr.puts "in #{@dir}..."
|
|
227
232
|
|
|
233
|
+
# Check exclude file
|
|
234
|
+
if File.exist?(File.join(@dir, ".pbsimply-exclude"))
|
|
235
|
+
exclude_files = File.read(File.join(@dir, ".pbsimply-exclude")).each_line.map(&:chomp).reject(&:empty?)
|
|
236
|
+
end
|
|
237
|
+
|
|
228
238
|
$stderr.puts "Checking Frontmatter..."
|
|
229
239
|
Dir.foreach(@dir) do |filename|
|
|
230
240
|
next if filename == "." || filename == ".." || filename == ".index.md"
|
|
231
241
|
next unless File.file? File.join(@dir, filename)
|
|
232
|
-
if filename =~ /^\./ || filename =~ /^draft-/
|
|
242
|
+
if filename =~ /^\./ || filename =~ /^draft-/ || exclude_files.include?(filename)
|
|
233
243
|
draft_articles.push({
|
|
234
244
|
article_filename: filename.sub(/^(?:\.|draft-)/, ""),
|
|
235
245
|
filename: filename,
|
|
@@ -442,7 +452,7 @@ class PBSimply
|
|
|
442
452
|
##### Post eRuby
|
|
443
453
|
if @config["post_eruby"]
|
|
444
454
|
$stderr.puts "Porcessing with eRuby."
|
|
445
|
-
doc =
|
|
455
|
+
doc = str_and_render(dov, binding)
|
|
446
456
|
end
|
|
447
457
|
|
|
448
458
|
# Write out
|
|
@@ -16,35 +16,32 @@ else
|
|
|
16
16
|
@indexes.each {|filename, index| articles[(index["category"] || "default")].push index }
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
articles.keys.sort.each do |catname|
|
|
20
|
+
cat = articles[catname]
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
% cat = articles[catname]
|
|
23
|
-
|
|
24
|
-
% unless articles.length == 1
|
|
22
|
+
unless articles.length == 1
|
|
25
23
|
# <%= catname %>
|
|
26
|
-
|
|
24
|
+
<% end
|
|
25
|
+
|
|
26
|
+
sort_method = case @config["accs_sort_by"]
|
|
27
|
+
when "title"
|
|
28
|
+
lambda {|i| [i["title"].to_s, i["date"]] }
|
|
29
|
+
when "name"
|
|
30
|
+
lambda {|i| [i["_filename"].to_s, i["title"].to_s, i["date"]] }
|
|
31
|
+
when "serial"
|
|
32
|
+
lambda {|i| [i["serial"].to_s, i["date"], i["_filename"].to_s] }
|
|
33
|
+
else
|
|
34
|
+
lambda {|i| [i["date"], i["title"].to_s, i["_last_update"].to_i] }
|
|
35
|
+
end
|
|
27
36
|
|
|
28
|
-
|
|
29
|
-
sort_method
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
lambda {|i| [i["serial"].to_s, i["date"], i["_filename"].to_s] }
|
|
36
|
-
else
|
|
37
|
-
lambda {|i| [i["date"], i["title"].to_s, i["_last_update"].to_i] }
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
list = if @config["accs_order"] == "desc"
|
|
41
|
-
cat.sort_by(&sort_method).reverse
|
|
42
|
-
else
|
|
43
|
-
cat.sort_by(&sort_method)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
list.each do |i|
|
|
37
|
+
list = if @config["accs_order"] == "desc"
|
|
38
|
+
cat.sort_by(&sort_method).reverse
|
|
39
|
+
else
|
|
40
|
+
cat.sort_by(&sort_method)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
list.each do |i|
|
|
47
44
|
%>* [<%= i["title"] %>](<%= i["page_url"] %>)
|
|
48
|
-
<% end
|
|
45
|
+
<% end
|
|
49
46
|
|
|
50
|
-
|
|
47
|
+
end %>
|
|
@@ -7,6 +7,9 @@ outdir: ../Build
|
|
|
7
7
|
# Template file path.
|
|
8
8
|
# ./template.html by default.
|
|
9
9
|
template: template.html
|
|
10
|
+
# Configure the template engine/template format. The default is eruby, and liquid and mustache can be specified.
|
|
11
|
+
# This setting is only effective when using a document processor that defaults to eRuby. It does not function when using a document processor that employs a different dedicated template engine (e.g., Pandoc).
|
|
12
|
+
# template_format: eruby
|
|
10
13
|
#
|
|
11
14
|
# Loading CSS files (userd by Pandoc's default template.)
|
|
12
15
|
# This values must be *server's URL*.
|
|
@@ -23,6 +26,13 @@ toc: true
|
|
|
23
26
|
# Enable eRuby template expansion. true or false. false by default.
|
|
24
27
|
# This settings is not avilable on rdoc, rdoc_markdown, kramdown, redcarpet or cmark engine.
|
|
25
28
|
post_eruby: false
|
|
29
|
+
# Specify the eRuby processor library.
|
|
30
|
+
# The default is erb; erubis and erubi can be specified.
|
|
31
|
+
# Since these libraries are not fully compatible with each other, specifying one may change behavior or cause it to fail to function properly.
|
|
32
|
+
# eruby_lib: erb
|
|
33
|
+
# Specifies the value for the `trim_mode` parameter passed to the ERB constructor. The default is `%<>`.
|
|
34
|
+
# Specifying this value may cause .erb files used by the theme to malfunction.
|
|
35
|
+
# erb_trim_mode: "%<>"
|
|
26
36
|
# Default metadata. If same key exists in document's frontmatter, document's frontmatter is given priority to this settings.
|
|
27
37
|
default_meta:
|
|
28
38
|
author: "John Doe"
|
|
@@ -16,35 +16,32 @@ else
|
|
|
16
16
|
@indexes.each {|filename, index| articles[(index["category"] || "default")].push index }
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
articles.keys.sort.each do |catname|
|
|
20
|
+
cat = articles[catname]
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
% cat = articles[catname]
|
|
23
|
-
|
|
24
|
-
% unless articles.length == 1
|
|
22
|
+
unless articles.length == 1 %>
|
|
25
23
|
# <%= catname %>
|
|
26
|
-
|
|
24
|
+
<% end
|
|
25
|
+
|
|
26
|
+
sort_method = case @config["accs_sort_by"]
|
|
27
|
+
when "title"
|
|
28
|
+
lambda {|i| [i["title"].to_s, i["date"]] }
|
|
29
|
+
when "name"
|
|
30
|
+
lambda {|i| [i["_filename"].to_s, i["title"].to_s, i["date"]] }
|
|
31
|
+
when "serial"
|
|
32
|
+
lambda {|i| [i["serial"].to_s, i["date"], i["_filename"].to_s] }
|
|
33
|
+
else
|
|
34
|
+
lambda {|i| [i["date"], i["title"].to_s, i["_last_update"].to_i] }
|
|
35
|
+
end
|
|
27
36
|
|
|
28
|
-
|
|
29
|
-
sort_method
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
lambda {|i| [i["serial"].to_s, i["date"], i["_filename"].to_s] }
|
|
36
|
-
else
|
|
37
|
-
lambda {|i| [i["date"], i["title"].to_s, i["_last_update"].to_i] }
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
list = if @config["accs_order"] == "desc"
|
|
41
|
-
cat.sort_by(&sort_method).reverse
|
|
42
|
-
else
|
|
43
|
-
cat.sort_by(&sort_method)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
list.each do |i|
|
|
37
|
+
list = if @config["accs_order"] == "desc"
|
|
38
|
+
cat.sort_by(&sort_method).reverse
|
|
39
|
+
else
|
|
40
|
+
cat.sort_by(&sort_method)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
list.each do |i|
|
|
47
44
|
%>* [<%= i["title"] %>](<%= i["page_url"] %>)
|
|
48
|
-
<% end
|
|
45
|
+
<% end
|
|
49
46
|
|
|
50
|
-
|
|
47
|
+
end %>
|
|
@@ -7,6 +7,9 @@ outdir: ../Build
|
|
|
7
7
|
# Template file path.
|
|
8
8
|
# ./template.html by default.
|
|
9
9
|
template: template.html
|
|
10
|
+
# Configure the template engine/template format. The default is eruby, and liquid and mustache can be specified.
|
|
11
|
+
# This setting is only effective when using a document processor that defaults to eRuby. It does not function when using a document processor that employs a different dedicated template engine (e.g., Pandoc).
|
|
12
|
+
# template_format: eruby
|
|
10
13
|
#
|
|
11
14
|
# Loading CSS files (userd by Pandoc's default template.)
|
|
12
15
|
# This values must be *server's URL*.
|
|
@@ -20,6 +23,13 @@ toc: true
|
|
|
20
23
|
# Enable eRuby template expansion. true or false. false by default.
|
|
21
24
|
# This settings is not avilable on rdoc, rdoc_markdown, kramdown, redcarpet or cmark engine.
|
|
22
25
|
post_eruby: false
|
|
26
|
+
# Specify the eRuby processor library.
|
|
27
|
+
# The default is erb; erubis and erubi can be specified.
|
|
28
|
+
# Since these libraries are not fully compatible with each other, specifying one may change behavior or cause it to fail to function properly.
|
|
29
|
+
# eruby_lib: erb
|
|
30
|
+
# Specifies the value for the `trim_mode` parameter passed to the ERB constructor. The default is `%<>`.
|
|
31
|
+
# Specifying this value may cause .erb files used by the theme to malfunction.
|
|
32
|
+
# erb_trim_mode: "%<>"
|
|
23
33
|
# Default metadata. If same key exists in document's frontmatter, document's frontmatter is given priority to this settings.
|
|
24
34
|
default_meta:
|
|
25
35
|
author: "John Doe"
|
|
@@ -11,25 +11,22 @@ articles = Hash.new {|h,k| h[k] = Array.new }
|
|
|
11
11
|
articles[(index["category"] || "default")].push index
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
artkeys = articles.keys.sort
|
|
15
|
+
artkeys.each do |catname|
|
|
16
|
+
cat = articles[catname]
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
% artkeys.each do |catname|
|
|
18
|
-
% cat = articles[catname]
|
|
19
|
-
|
|
20
|
-
% if articles.length > 1
|
|
18
|
+
if articles.length > 1 %>
|
|
21
19
|
# <%= catname %>
|
|
22
|
-
|
|
20
|
+
<% end
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
end
|
|
22
|
+
list = if @config["accs_order"] == "desc" || @index["accs_order"] == "desc" || @index["blogmode"]
|
|
23
|
+
cat.sort_by {|i| [i["date"].to_s, i["title"].to_s, i["_last_update"].to_i] }.reverse
|
|
24
|
+
else
|
|
25
|
+
cat.sort_by {|i| [i["date"].to_s, i["title"].to_s, i["_last_update"].to_i] }
|
|
26
|
+
end
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
list.each do |i|
|
|
32
29
|
%>* [<%= i["title"].gsub('@', '\@') %>](<%= File.basename(i["_filename"].to_s, ".*") + ".html" %>) (<%= i["date"] %>)
|
|
33
|
-
<% end
|
|
30
|
+
<% end
|
|
34
31
|
|
|
35
|
-
|
|
32
|
+
end %>
|
|
@@ -7,6 +7,9 @@ outdir: ../Build
|
|
|
7
7
|
# Template file path.
|
|
8
8
|
# ./template.html by default.
|
|
9
9
|
template: template.erb
|
|
10
|
+
# Configure the template engine/template format. The default is eruby, and liquid and mustache can be specified.
|
|
11
|
+
# This setting is only effective when using a document processor that defaults to eRuby. It does not function when using a document processor that employs a different dedicated template engine (e.g., Pandoc).
|
|
12
|
+
# template_format: eruby
|
|
10
13
|
#
|
|
11
14
|
# Loading CSS files (userd by Pandoc's default template.)
|
|
12
15
|
# This values must be *server's URL*.
|
|
@@ -21,6 +24,13 @@ template: template.erb
|
|
|
21
24
|
# Enable eRuby template expansion. true or false. false by default.
|
|
22
25
|
# This settings is not avilable on rdoc, rdoc_markdown, kramdown, redcarpet or cmark engine.
|
|
23
26
|
post_eruby: false
|
|
27
|
+
# Specify the eRuby processor library.
|
|
28
|
+
# The default is erb; erubis and erubi can be specified.
|
|
29
|
+
# Since these libraries are not fully compatible with each other, specifying one may change behavior or cause it to fail to function properly.
|
|
30
|
+
eruby_lib: erb
|
|
31
|
+
# Specifies the value for the `trim_mode` parameter passed to the ERB constructor. The default is `%<>`.
|
|
32
|
+
# Specifying this value may cause .erb files used by the theme to malfunction.
|
|
33
|
+
# erb_trim_mode: "%<>"
|
|
24
34
|
# Default metadata. If same key exists in document's frontmatter, document's frontmatter is given priority to this settings.
|
|
25
35
|
default_meta:
|
|
26
36
|
author: "John Doe"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pbsimply
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Masaki Haruka
|
|
@@ -37,10 +37,12 @@ files:
|
|
|
37
37
|
- lib/pbsimply/docengine/pandoc.rb
|
|
38
38
|
- lib/pbsimply/docengine/rdoc.rb
|
|
39
39
|
- lib/pbsimply/document.rb
|
|
40
|
+
- lib/pbsimply/eruby.rb
|
|
40
41
|
- lib/pbsimply/frontmatter.rb
|
|
41
42
|
- lib/pbsimply/hooks.rb
|
|
42
43
|
- lib/pbsimply/plugger.rb
|
|
43
44
|
- lib/pbsimply/prayer.rb
|
|
45
|
+
- lib/pbsimply/template-engine.rb
|
|
44
46
|
- themes/contribute/README.md
|
|
45
47
|
- themes/default.yaml
|
|
46
48
|
- themes/pandoc/_pandoc_base/.accsindex.erb
|
|
@@ -108,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
108
110
|
- !ruby/object:Gem::Version
|
|
109
111
|
version: '0'
|
|
110
112
|
requirements: []
|
|
111
|
-
rubygems_version:
|
|
113
|
+
rubygems_version: 4.0.3
|
|
112
114
|
specification_version: 4
|
|
113
115
|
summary: Flexible and programmable static site generator with pluggable Markdown engines
|
|
114
116
|
test_files: []
|