-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
40 lines (35 loc) · 1.56 KB
/
Rakefile
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
32
33
34
35
36
37
38
39
40
require 'bundler/gem_tasks'
require 'confctl'
require 'md2man/rakefile'
require 'md2man/roff/engine'
require 'md2man/html/engine'
# Override markdown engine to add extra parameter
[Md2Man::Roff, Md2Man::HTML].each do |mod|
mod.send(:remove_const, :ENGINE)
mod.send(:const_set, :ENGINE, Redcarpet::Markdown.new(mod.const_get(:Engine),
tables: true,
autolink: true,
superscript: true,
strikethrough: true,
no_intra_emphasis: false,
fenced_code_blocks: true,
# This option is needed for command options to be rendered property
disable_indented_code_blocks: true))
end
desc 'Generate man/man8/confctl-options.nix.8.md'
task 'confctl-options' do
ConfCtl::Logger.open('rake', output: $stdout)
opts = ConfCtl::ModuleOptions.new(nix: ConfCtl::Nix.stateless)
opts.read
ConfCtl::ErbTemplate.render_to('confctl-options.nix/main', {
date: Time.now,
version: 'master',
opts:,
print_options: proc do |opt_list|
ConfCtl::ErbTemplate.render('confctl-options.nix/options', {
opts: opt_list,
indent: proc { |s, n| s.split("\n").join("\n#{' ' * n}") }
})
end
}, 'man/man8/confctl-options.nix.8.md')
end