Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathRakefile
More file actions
Latest commit
31 lines (23 loc) · 848 Bytes
/
Copy pathRakefile
File metadata and controls
31 lines (23 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require'kramdown'
require'yaml'
require'ostruct'
require_relative'_src/lib/util'
require_relative'_src/lib/file'
require_relative'_src/lib/toc'
require_relative'_src/lib/render'
file'_data/book.yml'=>FileList['_src/*.md']do |t|
puts"Rerendering TOC"
chapters=TOC.(t.prerequisites)
File.write(t.name,Util.deep_stringify_keys(chapters: chapters).to_yaml)
end
rule/^(\d+\.\d+|evolution)\.md$/=>->(s){"_src/#{s}"}do |t|
from,to=t.prerequisites.first,t.name
puts"Rendering #{from} => #{to}"
File.write(to,Render.(from))
end
VERSIONS=[*('2.4'..'2.7'), *('3.0'..'3.4'),'4.0']
desc'Convert file contents from source to target (prettify)'
taskcontents: ['evolution', *VERSIONS].map(&'%s.md'.method(:%))
desc'Render TOC for the changelog "book"'
tasktoc: '_data/book.yml'
taskdefault: %i[toccontents]