jdoc 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/jdoc/generator.rb +12 -3
- data/lib/jdoc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea12fa017eaf4ae788a7fd255c1275a1838c1f7b
|
4
|
+
data.tar.gz: 7aac3b9b69a78fb7ae9e437e85c27ad6beecbf26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f276b1a59f04c62d6b01e37753af402690ef4881c4a03281d80d764fad522cd0d4037072e5036c945214e263509efd32ef6474169d38e79bd9f34f75289cf7d
|
7
|
+
data.tar.gz: 15424df54db71b27cb76dd1be4e24a9d251910191e15365edcde379ddb0b4bb8bd4fcbae0816571d45c0903e03174e0fcec75d8002bd4d1b49f183a4df9de01f
|
data/CHANGELOG.md
CHANGED
data/lib/jdoc/generator.rb
CHANGED
@@ -16,7 +16,11 @@ module Jdoc
|
|
16
16
|
|
17
17
|
def redcarpet
|
18
18
|
@redcarpet ||= Redcarpet::Markdown.new(
|
19
|
-
Redcarpet::Render::HTML.new(
|
19
|
+
Redcarpet::Render::HTML.new(
|
20
|
+
filter_html: true,
|
21
|
+
hard_wrap: true,
|
22
|
+
with_toc_data: true,
|
23
|
+
),
|
20
24
|
autolink: true,
|
21
25
|
fenced_code_blocks: true,
|
22
26
|
)
|
@@ -47,11 +51,16 @@ module Jdoc
|
|
47
51
|
end
|
48
52
|
|
49
53
|
# Generates Markdown or HTML documentation from JSON schema
|
54
|
+
# @note Add some fix to adapt to GitHub anchor style
|
50
55
|
# @return [String]
|
51
56
|
def call
|
52
57
|
result = self.class.markdown_renderer.result(schema: schema)
|
53
|
-
|
54
|
-
|
58
|
+
if @html
|
59
|
+
result = self.class.html_renderer.result(body: self.class.redcarpet.render(result))
|
60
|
+
result.gsub(/id="(.+)"/) {|text| text.tr("/:", "") }
|
61
|
+
else
|
62
|
+
result
|
63
|
+
end
|
55
64
|
end
|
56
65
|
|
57
66
|
private
|
data/lib/jdoc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|