rdoc-markdown 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7fe864809969e8bc21a90e174270ac16a0d346dc7e909b2bc621af2518bbc971
|
|
4
|
+
data.tar.gz: 8aa123afbc0ba9e29fe03e3d922636cae237183bfa0af99ac25feed38fe7eb12
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 452aa91cfc511f89e840b11b76dcaa8b6cb295acf8e20a59296f9298991d0c46a03274bc09e2e53ad56901803dd03cb36786480f574b222e547267cc1df0d9ad
|
|
7
|
+
data.tar.gz: ecabd0ada5aae3f3e0055f6cee4e8a41cf10497d13f116a05dae7863c1f6d15d3f6b4166602d947c96a7a9e624e2bcb637056feae2b083c8596c9c5675a43e4d
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.20.0
|
|
6
|
+
|
|
7
|
+
- Restore legacy anchors in a single Markdown substitution pass.
|
|
8
|
+
- Reduce internal-link candidate construction and deduplication work.
|
|
9
|
+
|
|
10
|
+
## 0.19.1
|
|
11
|
+
|
|
12
|
+
- Store fullpath for files, instead of just file names.
|
|
13
|
+
|
|
5
14
|
## 0.19.0
|
|
6
15
|
|
|
7
16
|
- Remove the `markdown_unknown_tags` option and use reverse_markdown's default handling.
|
|
@@ -14,7 +14,7 @@ class RDoc::Generator::Markdown::Conversion
|
|
|
14
14
|
document = fragment.document
|
|
15
15
|
fragment.css("a").each { |link| normalize_link(link, document) }
|
|
16
16
|
markdown = ReverseMarkdown.convert(fragment, github_flavored: true).dup
|
|
17
|
-
|
|
17
|
+
markdown.gsub!(Regexp.union(anchor_aliases.keys), anchor_aliases)
|
|
18
18
|
normalize_definition_list_code_blocks(markdown).rstrip.gsub(/^(#+)(\s)/) do
|
|
19
19
|
"#{"#" * [Regexp.last_match(1).length + heading_level_offset, 6].min}#{Regexp.last_match(2)}"
|
|
20
20
|
end
|
|
@@ -101,13 +101,13 @@ class RDoc::Generator::Markdown::Conversion
|
|
|
101
101
|
#
|
|
102
102
|
# @param anchors [Nokogiri::XML::NodeSet] Legacy anchor spans.
|
|
103
103
|
#
|
|
104
|
-
# @return [
|
|
104
|
+
# @return [Hash{String => String}] Token-to-anchor HTML lookup.
|
|
105
105
|
def tokenize_legacy_anchors(anchors)
|
|
106
|
-
anchors.
|
|
106
|
+
anchors.each.with_index.to_h do |span, index|
|
|
107
107
|
token = "RDocMarkdownAnchor#{index}End"
|
|
108
|
-
|
|
108
|
+
anchor = %(<a id="#{span["id"]}"></a>)
|
|
109
109
|
span.replace(token)
|
|
110
|
-
[token,
|
|
110
|
+
[token, anchor]
|
|
111
111
|
end
|
|
112
112
|
end
|
|
113
113
|
|
|
@@ -19,7 +19,7 @@ module RDoc::Generator::Markdown::Index
|
|
|
19
19
|
def write_index(csv)
|
|
20
20
|
csv << %w[name type path]
|
|
21
21
|
classes.each { |klass| write_class_rows(csv, klass, output_path_for(klass)) }
|
|
22
|
-
pages.each { |page| csv << [
|
|
22
|
+
pages.each { |page| csv << [normalize_input_path_for_output(page.relative_name), "File", page_output_path(page)] }
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
# Writes one class and its visible member rows.
|
|
@@ -83,11 +83,16 @@ module RDoc::Generator::Markdown::Paths
|
|
|
83
83
|
#
|
|
84
84
|
# @return [String, nil] Resolved output path, or nil when unresolved.
|
|
85
85
|
def self.resolve_output_path_from(path, current_dir, state)
|
|
86
|
+
return if path.empty? || path.match?(%r{\A(?:[a-z][a-z0-9+.-]*:|//)}i)
|
|
87
|
+
|
|
86
88
|
candidates = [path, path.delete_prefix("#{state.root_path_segment}/")]
|
|
87
89
|
candidates += candidates.map { |candidate| candidate.sub(/_(md|markdown)\.md\z/i, '.\1') }
|
|
88
|
-
|
|
90
|
+
candidates.uniq!
|
|
89
91
|
|
|
90
|
-
|
|
92
|
+
candidates.find { |candidate| state.known_output_paths.include?(candidate) } ||
|
|
93
|
+
candidates.lazy
|
|
94
|
+
.map { |candidate| current_dir.join(candidate).cleanpath.to_s }
|
|
95
|
+
.find { |candidate| state.known_output_paths.include?(candidate) }
|
|
91
96
|
end
|
|
92
97
|
|
|
93
98
|
# Normalizes an input filename into an output-relative source path.
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "erb"
|
|
4
|
+
# standard:disable Lint/RedundantRequireStatement
|
|
5
|
+
require "set"
|
|
6
|
+
# standard:enable Lint/RedundantRequireStatement
|
|
4
7
|
require "reverse_markdown"
|
|
5
8
|
require "csv"
|
|
6
9
|
require "fileutils"
|
|
@@ -173,8 +176,8 @@ class RDoc::Generator::Markdown
|
|
|
173
176
|
classes: classes,
|
|
174
177
|
pages: pages,
|
|
175
178
|
class_output_paths: class_output_paths,
|
|
176
|
-
markdown_output_object_ids: (classes + pages).
|
|
177
|
-
known_output_paths: class_output_paths.values
|
|
179
|
+
markdown_output_object_ids: (classes + pages).to_set(&:object_id),
|
|
180
|
+
known_output_paths: class_output_paths.values.to_set.merge(pages.map { |page| page_output_path(page) }),
|
|
178
181
|
root_path_segment: Pathname.new(options.root || ".").basename
|
|
179
182
|
)
|
|
180
183
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rdoc-markdown
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.20.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stanislav (Stas) Katkov
|
|
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
208
208
|
- !ruby/object:Gem::Version
|
|
209
209
|
version: '0'
|
|
210
210
|
requirements: []
|
|
211
|
-
rubygems_version: 4.0.
|
|
211
|
+
rubygems_version: 4.0.19
|
|
212
212
|
specification_version: 4
|
|
213
213
|
summary: RDoc plugin to generate markdown documentation
|
|
214
214
|
test_files: []
|