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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: caa1e9494adadf0a14d5697e39c49856d0fc78b0
4
- data.tar.gz: d79c705955a92c5e28b586ffd79abb797644c4ff
3
+ metadata.gz: ea12fa017eaf4ae788a7fd255c1275a1838c1f7b
4
+ data.tar.gz: 7aac3b9b69a78fb7ae9e437e85c27ad6beecbf26
5
5
  SHA512:
6
- metadata.gz: 03930f9cf0de98043b16cdbeb6ebbef9025e1f68d6d6f5892928147aa23846cfb6c4b15d92d737bb3c21f570a6a77de685215b5b53531ebf00972cb43ddfdb9e
7
- data.tar.gz: a1c9263e15fe42ce0cf3355b730bcacfb6c8122c852a3275242b34fb468f419875a217e177c0e30e8c6b86a44af8c66b7e3337540a71dc46bed31411033f09f1
6
+ metadata.gz: 0f276b1a59f04c62d6b01e37753af402690ef4881c4a03281d80d764fad522cd0d4037072e5036c945214e263509efd32ef6474169d38e79bd9f34f75289cf7d
7
+ data.tar.gz: 15424df54db71b27cb76dd1be4e24a9d251910191e15365edcde379ddb0b4bb8bd4fcbae0816571d45c0903e03174e0fcec75d8002bd4d1b49f183a4df9de01f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.1.5
2
+ * Fix ToC link on HTML docs
3
+
1
4
  ## 0.1.4
2
5
  * Provide :html option to render docs in HTML
3
6
 
@@ -16,7 +16,11 @@ module Jdoc
16
16
 
17
17
  def redcarpet
18
18
  @redcarpet ||= Redcarpet::Markdown.new(
19
- Redcarpet::Render::HTML.new(hard_wrap: true, filter_html: true),
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
- result = self.class.html_renderer.result(body: self.class.redcarpet.render(result)) if @html
54
- result
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
@@ -1,3 +1,3 @@
1
1
  module Jdoc
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
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
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-22 00:00:00.000000000 Z
11
+ date: 2014-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport