11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/asciidoctor-github-include.rb', line 11
def process doc, reader, target, attributes
begin
doc.attr('github-access-token').nil? ?
content = (open target).readlines :
content = (open target, "Authorization" => "token " + doc.attr('github-access-token')).readlines
rescue
warn %(asciidoctor: WARNING: Failed to retrieve GitHub URI #{target}. Did you set :github-access-token:?)
content = "WARNING: Failed to retrieve GitHub URI link:#{target}[]"
end
reader.push_include content, target, target, 1, attributes
reader
end
|