literate_md 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/literate_md +3 -2
- metadata +3 -3
data/bin/literate_md
CHANGED
@@ -60,7 +60,7 @@ if opts.weave
|
|
60
60
|
code = File.open(file, 'r'){|f|f.read}
|
61
61
|
r.renderer.original_text = code
|
62
62
|
html = r.render(code)
|
63
|
-
write_to("#{opts.outputdir}/#{file}.html", html)
|
63
|
+
write_to("#{opts.outputdir}/#{File.basename(file)}.html", html)
|
64
64
|
}
|
65
65
|
end
|
66
66
|
|
@@ -75,7 +75,8 @@ class Tangle < Redcarpet::Render::Base
|
|
75
75
|
[{:start => code.length}]
|
76
76
|
(1..chunks.length-1).each{|index|
|
77
77
|
last, this = chunks[index-1], chunks[index]
|
78
|
-
|
78
|
+
new_snippet = code[last[:start] + last[:anchor_len], this[:start]]
|
79
|
+
@links[normalise(last[:anchor],lang)] << new_snippet if not new_snippet.strip.empty?
|
79
80
|
}
|
80
81
|
nil
|
81
82
|
end
|
metadata
CHANGED