coridoc-html 1.1.23
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 +7 -0
- data/LICENSE.txt +21 -0
- data/lib/coridoc/html/asset_resolver.rb +174 -0
- data/lib/coridoc/html/builder.rb +94 -0
- data/lib/coridoc/html/cleaner.rb +236 -0
- data/lib/coridoc/html/config.rb +154 -0
- data/lib/coridoc/html/converter_base.rb +174 -0
- data/lib/coridoc/html/converters/a.rb +77 -0
- data/lib/coridoc/html/converters/aside.rb +20 -0
- data/lib/coridoc/html/converters/audio.rb +19 -0
- data/lib/coridoc/html/converters/base.rb +100 -0
- data/lib/coridoc/html/converters/blockquote.rb +25 -0
- data/lib/coridoc/html/converters/br.rb +17 -0
- data/lib/coridoc/html/converters/bypass.rb +82 -0
- data/lib/coridoc/html/converters/code.rb +25 -0
- data/lib/coridoc/html/converters/div.rb +23 -0
- data/lib/coridoc/html/converters/dl.rb +82 -0
- data/lib/coridoc/html/converters/drop.rb +26 -0
- data/lib/coridoc/html/converters/em.rb +23 -0
- data/lib/coridoc/html/converters/figure.rb +33 -0
- data/lib/coridoc/html/converters/h.rb +58 -0
- data/lib/coridoc/html/converters/head.rb +29 -0
- data/lib/coridoc/html/converters/hr.rb +17 -0
- data/lib/coridoc/html/converters/img.rb +105 -0
- data/lib/coridoc/html/converters/li.rb +39 -0
- data/lib/coridoc/html/converters/mark.rb +21 -0
- data/lib/coridoc/html/converters/markup.rb +93 -0
- data/lib/coridoc/html/converters/math.rb +42 -0
- data/lib/coridoc/html/converters/media_base.rb +48 -0
- data/lib/coridoc/html/converters/ol.rb +42 -0
- data/lib/coridoc/html/converters/p.rb +64 -0
- data/lib/coridoc/html/converters/pass_through.rb +15 -0
- data/lib/coridoc/html/converters/positional_formatting.rb +35 -0
- data/lib/coridoc/html/converters/pre.rb +60 -0
- data/lib/coridoc/html/converters/q.rb +25 -0
- data/lib/coridoc/html/converters/strong.rb +22 -0
- data/lib/coridoc/html/converters/sub.rb +20 -0
- data/lib/coridoc/html/converters/sup.rb +20 -0
- data/lib/coridoc/html/converters/table.rb +64 -0
- data/lib/coridoc/html/converters/td.rb +42 -0
- data/lib/coridoc/html/converters/text.rb +66 -0
- data/lib/coridoc/html/converters/tr.rb +27 -0
- data/lib/coridoc/html/converters/video.rb +27 -0
- data/lib/coridoc/html/converters.rb +104 -0
- data/lib/coridoc/html/drop/annotation_drop.rb +31 -0
- data/lib/coridoc/html/drop/base.rb +72 -0
- data/lib/coridoc/html/drop/bibliography_drop.rb +15 -0
- data/lib/coridoc/html/drop/bibliography_entry_drop.rb +24 -0
- data/lib/coridoc/html/drop/block_drop.rb +78 -0
- data/lib/coridoc/html/drop/definition_item_drop.rb +61 -0
- data/lib/coridoc/html/drop/definition_list_drop.rb +15 -0
- data/lib/coridoc/html/drop/document_drop.rb +52 -0
- data/lib/coridoc/html/drop/drop_factory.rb +64 -0
- data/lib/coridoc/html/drop/footnote_drop.rb +24 -0
- data/lib/coridoc/html/drop/image_drop.rb +35 -0
- data/lib/coridoc/html/drop/inline_element_drop.rb +43 -0
- data/lib/coridoc/html/drop/list_block_drop.rb +19 -0
- data/lib/coridoc/html/drop/list_item_drop.rb +20 -0
- data/lib/coridoc/html/drop/raw_inline_element_drop.rb +30 -0
- data/lib/coridoc/html/drop/table_cell_drop.rb +35 -0
- data/lib/coridoc/html/drop/table_drop.rb +15 -0
- data/lib/coridoc/html/drop/table_row_drop.rb +23 -0
- data/lib/coridoc/html/drop/term_drop.rb +24 -0
- data/lib/coridoc/html/drop/text_content_drop.rb +15 -0
- data/lib/coridoc/html/drop/toc_drop.rb +15 -0
- data/lib/coridoc/html/drop/toc_entry_drop.rb +32 -0
- data/lib/coridoc/html/drop.rb +40 -0
- data/lib/coridoc/html/errors.rb +11 -0
- data/lib/coridoc/html/escape.rb +29 -0
- data/lib/coridoc/html/frontmatter_meta.rb +157 -0
- data/lib/coridoc/html/html_converter.rb +161 -0
- data/lib/coridoc/html/input_config.rb +71 -0
- data/lib/coridoc/html/layout_renderer.rb +195 -0
- data/lib/coridoc/html/lint/registrations.rb +40 -0
- data/lib/coridoc/html/lint.rb +16 -0
- data/lib/coridoc/html/plugin.rb +93 -0
- data/lib/coridoc/html/plugins/plateau.rb +212 -0
- data/lib/coridoc/html/postprocessor.rb +19 -0
- data/lib/coridoc/html/reference_materializers/link.rb +44 -0
- data/lib/coridoc/html/reference_materializers/navigation.rb +77 -0
- data/lib/coridoc/html/reference_materializers.rb +22 -0
- data/lib/coridoc/html/render_options.rb +40 -0
- data/lib/coridoc/html/renderer.rb +136 -0
- data/lib/coridoc/html/section_numberable.rb +9 -0
- data/lib/coridoc/html/spa.rb +49 -0
- data/lib/coridoc/html/static.rb +57 -0
- data/lib/coridoc/html/tag_mapping.rb +106 -0
- data/lib/coridoc/html/template_caching.rb +31 -0
- data/lib/coridoc/html/template_config.rb +92 -0
- data/lib/coridoc/html/template_helpers.rb +66 -0
- data/lib/coridoc/html/template_locator.rb +120 -0
- data/lib/coridoc/html/theme.rb +7 -0
- data/lib/coridoc/html/title_text.rb +57 -0
- data/lib/coridoc/html/toc_builder.rb +114 -0
- data/lib/coridoc/html/toc_serializer.rb +32 -0
- data/lib/coridoc/html/transform/from_core_model.rb +35 -0
- data/lib/coridoc/html/transform/to_core_model.rb +39 -0
- data/lib/coridoc/html/version.rb +7 -0
- data/lib/coridoc/html.rb +246 -0
- metadata +255 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Coridoc
|
|
4
|
+
module Html
|
|
5
|
+
# Serializes a document's TOC structure to JSON for inline embedding.
|
|
6
|
+
#
|
|
7
|
+
# Used by the SPA layout to provide client-side navigation data.
|
|
8
|
+
class TocSerializer
|
|
9
|
+
def build_json(document, opts)
|
|
10
|
+
return { entries: [], numbered: false } unless document.is_a?(CoreModel::StructuralElement)
|
|
11
|
+
|
|
12
|
+
opts = RenderOptions.new(**opts) unless opts.is_a?(RenderOptions)
|
|
13
|
+
numbered = opts.section_numbers == true
|
|
14
|
+
builder = TocBuilder.from_options(opts)
|
|
15
|
+
toc = builder.build(document)
|
|
16
|
+
{ entries: serialize_entries(toc.entries), numbered: numbered }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def serialize_entries(entries)
|
|
20
|
+
entries.map do |entry|
|
|
21
|
+
{
|
|
22
|
+
id: entry.id,
|
|
23
|
+
title: TitleText.resolve(entry.title),
|
|
24
|
+
number: entry.number,
|
|
25
|
+
level: entry.level,
|
|
26
|
+
children: entry.children.any? ? serialize_entries(entry.children) : []
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'coridoc'
|
|
4
|
+
|
|
5
|
+
module Coridoc
|
|
6
|
+
module Html
|
|
7
|
+
module Transform
|
|
8
|
+
# Transforms CoreModel to HTML output
|
|
9
|
+
#
|
|
10
|
+
# This transformer converts CoreModel to HTML strings by delegating
|
|
11
|
+
# to the existing theme/renderer pipeline.
|
|
12
|
+
class FromCoreModel
|
|
13
|
+
class << self
|
|
14
|
+
# Transform a CoreModel to HTML string
|
|
15
|
+
#
|
|
16
|
+
# @param model [Coridoc::CoreModel::Base, Array] CoreModel to transform
|
|
17
|
+
# @param options [Hash] Renderer options (e.g., theme)
|
|
18
|
+
# @return [String] HTML output
|
|
19
|
+
def transform(model, options = {})
|
|
20
|
+
case model
|
|
21
|
+
when Coridoc::CoreModel::Base
|
|
22
|
+
Html.serialize(model, options)
|
|
23
|
+
when Array
|
|
24
|
+
model.map { |item| transform(item, options) }.join("\n")
|
|
25
|
+
else
|
|
26
|
+
model.to_s
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def transform(model, options = {}) = self.class.transform(model, options)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'leptris'
|
|
4
|
+
require 'coridoc'
|
|
5
|
+
|
|
6
|
+
module Coridoc
|
|
7
|
+
module Html
|
|
8
|
+
module Transform
|
|
9
|
+
# Transforms Leptris HTML nodes to CoreModel
|
|
10
|
+
#
|
|
11
|
+
# Leptris serves as the HTML model layer. This transformer converts
|
|
12
|
+
# Leptris::XML::Document or Leptris::XML::Node objects into CoreModel
|
|
13
|
+
# by delegating to the existing input converter pipeline.
|
|
14
|
+
class ToCoreModel
|
|
15
|
+
class << self
|
|
16
|
+
# Transform an HTML model (Leptris node) to CoreModel
|
|
17
|
+
#
|
|
18
|
+
# @param model [Leptris::XML::Document, Leptris::XML::Node, Coridoc::CoreModel::Base]
|
|
19
|
+
# HTML input model to transform
|
|
20
|
+
# @return [Coridoc::CoreModel::Base] CoreModel equivalent
|
|
21
|
+
def transform(model)
|
|
22
|
+
case model
|
|
23
|
+
when Coridoc::CoreModel::Base
|
|
24
|
+
model
|
|
25
|
+
when Leptris::XML::Document, Leptris::XML::Node
|
|
26
|
+
::Coridoc::Html::HtmlConverter.to_core_model(model)
|
|
27
|
+
when Array
|
|
28
|
+
model.map { |item| transform(item) }
|
|
29
|
+
else
|
|
30
|
+
model
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def transform(model) = self.class.transform(model)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
data/lib/coridoc/html.rb
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Coridoc
|
|
4
|
+
module Html
|
|
5
|
+
HTML_EXTENSIONS = %w[.html .htm].freeze
|
|
6
|
+
|
|
7
|
+
module FormatDetection
|
|
8
|
+
def html_extension?(filename)
|
|
9
|
+
HTML_EXTENSIONS.any? { |ext| filename.downcase.end_with?(ext) }
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
module Coridoc
|
|
16
|
+
module Html
|
|
17
|
+
autoload :InputConfig, 'coridoc/html/input_config'
|
|
18
|
+
autoload :Cleaner, 'coridoc/html/cleaner'
|
|
19
|
+
autoload :Errors, 'coridoc/html/errors'
|
|
20
|
+
autoload :Plugin, 'coridoc/html/plugin'
|
|
21
|
+
autoload :Postprocessor, 'coridoc/html/postprocessor'
|
|
22
|
+
autoload :Converters, 'coridoc/html/converters'
|
|
23
|
+
autoload :HtmlConverter, 'coridoc/html/html_converter'
|
|
24
|
+
# Registration side effect: loading registers rules into Coridoc::Lint.registry.
|
|
25
|
+
autoload :Lint, 'coridoc/html/lint'
|
|
26
|
+
|
|
27
|
+
def self.input_config
|
|
28
|
+
@input_config ||= InputConfig.new
|
|
29
|
+
yield @input_config if block_given?
|
|
30
|
+
@input_config
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.reset_input_config!
|
|
34
|
+
@input_config = nil
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def self.cleaner
|
|
38
|
+
@cleaner ||= Cleaner.new
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def self.to_coridoc(html, options = {})
|
|
42
|
+
HtmlConverter.to_core_model(html, options)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
module Coridoc
|
|
48
|
+
module Html
|
|
49
|
+
# Autoload HTML components
|
|
50
|
+
autoload :Config, 'coridoc/html/config'
|
|
51
|
+
autoload :AssetResolver, 'coridoc/html/asset_resolver'
|
|
52
|
+
autoload :TagMapping, 'coridoc/html/tag_mapping'
|
|
53
|
+
autoload :Escape, 'coridoc/html/escape'
|
|
54
|
+
autoload :SectionNumberable, 'coridoc/html/section_numberable'
|
|
55
|
+
autoload :TemplateCaching, 'coridoc/html/template_caching'
|
|
56
|
+
autoload :TitleText, 'coridoc/html/title_text'
|
|
57
|
+
|
|
58
|
+
# Drop layer — self-registering drops loaded via parent namespace file
|
|
59
|
+
require_relative 'html/drop'
|
|
60
|
+
|
|
61
|
+
# FrontmatterBlock -> <meta> tag mapping (HTML-specific concern)
|
|
62
|
+
autoload :FrontmatterMeta, 'coridoc/html/frontmatter_meta'
|
|
63
|
+
|
|
64
|
+
# Autoload HTML output converters
|
|
65
|
+
autoload :ConverterBase, 'coridoc/html/converter_base'
|
|
66
|
+
autoload :Static, 'coridoc/html/static'
|
|
67
|
+
autoload :Spa, 'coridoc/html/spa'
|
|
68
|
+
autoload :TocBuilder, 'coridoc/html/toc_builder'
|
|
69
|
+
|
|
70
|
+
# Theme system
|
|
71
|
+
autoload :Theme, 'coridoc/html/theme'
|
|
72
|
+
autoload :TemplateLocator, 'coridoc/html/template_locator'
|
|
73
|
+
autoload :TemplateConfig, 'coridoc/html/template_config'
|
|
74
|
+
# Side-effect: registers Liquid filters on load
|
|
75
|
+
require_relative 'html/template_helpers'
|
|
76
|
+
autoload :Renderer, 'coridoc/html/renderer'
|
|
77
|
+
autoload :LayoutRenderer, 'coridoc/html/layout_renderer'
|
|
78
|
+
autoload :Builder, 'coridoc/html/builder'
|
|
79
|
+
autoload :RenderOptions, 'coridoc/html/render_options'
|
|
80
|
+
autoload :TocSerializer, 'coridoc/html/toc_serializer'
|
|
81
|
+
|
|
82
|
+
# CoreModel transformers
|
|
83
|
+
module Transform
|
|
84
|
+
autoload :ToCoreModel, 'coridoc/html/transform/to_core_model'
|
|
85
|
+
autoload :FromCoreModel, 'coridoc/html/transform/from_core_model'
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Validate that input is a CoreModel type
|
|
89
|
+
#
|
|
90
|
+
# @param document [Object] Document to validate
|
|
91
|
+
# @raise [ArgumentError] If document is not a CoreModel type
|
|
92
|
+
# @return [Object] The validated document
|
|
93
|
+
def self.validate_core_model!(document)
|
|
94
|
+
return document if document.nil?
|
|
95
|
+
|
|
96
|
+
unless document.is_a?(Coridoc::CoreModel::Base)
|
|
97
|
+
raise ArgumentError,
|
|
98
|
+
'coridoc-html only accepts CoreModel types. ' \
|
|
99
|
+
"Got: #{document.class}. " \
|
|
100
|
+
'Transform your document to CoreModel before passing to HTML conversion.'
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
document
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Parse HTML content and return CoreModel elements (may be an Array)
|
|
107
|
+
def self.parse(html, options = {})
|
|
108
|
+
HtmlConverter.to_core_model(html, options)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Parse HTML content directly into a CoreModel document
|
|
112
|
+
#
|
|
113
|
+
# Unlike #parse which returns an Array of CoreModel elements,
|
|
114
|
+
# this wraps the result into a top-level DocumentElement document
|
|
115
|
+
# suitable for use with Coridoc.serialize and other CoreModel pipelines.
|
|
116
|
+
#
|
|
117
|
+
# @param html [String] HTML content
|
|
118
|
+
# @param options [Hash] Parse options
|
|
119
|
+
# @return [Coridoc::CoreModel::DocumentElement] CoreModel document
|
|
120
|
+
def self.parse_to_core(html, options = {})
|
|
121
|
+
elements = parse(html, options)
|
|
122
|
+
|
|
123
|
+
return elements if elements.is_a?(Coridoc::CoreModel::Base)
|
|
124
|
+
|
|
125
|
+
# Extract document title from the first heading element
|
|
126
|
+
title = nil
|
|
127
|
+
children = elements
|
|
128
|
+
if elements.is_a?(Array) && !elements.empty?
|
|
129
|
+
first = elements.first
|
|
130
|
+
if first.is_a?(Coridoc::CoreModel::StructuralElement) &&
|
|
131
|
+
first.section? && first.level == 1
|
|
132
|
+
title = first.title
|
|
133
|
+
children = first.children + elements[1..]
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
Coridoc::CoreModel::DocumentElement.new(
|
|
138
|
+
title: title,
|
|
139
|
+
children: Array(children)
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Parse HTML file
|
|
144
|
+
def self.from_file(filename, **)
|
|
145
|
+
content = File.read(filename)
|
|
146
|
+
parse(content, **)
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Serialize CoreModel document to HTML
|
|
150
|
+
#
|
|
151
|
+
# Uses the unified Liquid template renderer.
|
|
152
|
+
#
|
|
153
|
+
# @param document [Coridoc::CoreModel::Base] CoreModel document to serialize
|
|
154
|
+
# @param options [Hash] Output options
|
|
155
|
+
# @return [String] HTML output
|
|
156
|
+
def self.serialize(document, options = {})
|
|
157
|
+
validate_core_model!(document)
|
|
158
|
+
|
|
159
|
+
layout = options.delete(:layout) || :static
|
|
160
|
+
renderer = Renderer.new(template_dirs: options.delete(:template_dirs))
|
|
161
|
+
renderer.render_html5(document, layout: layout, **options)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Serialize CoreModel document to static HTML
|
|
165
|
+
#
|
|
166
|
+
# Uses the classic theme renderer for traditional HTML output.
|
|
167
|
+
#
|
|
168
|
+
# @param document [Coridoc::CoreModel::Base] CoreModel document to serialize
|
|
169
|
+
# @param config [Hash, Static::Configuration] Static converter configuration
|
|
170
|
+
# @return [String] HTML output
|
|
171
|
+
def self.serialize_static(document, config = {})
|
|
172
|
+
Static.convert(document, config)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Serialize CoreModel document to SPA HTML
|
|
176
|
+
#
|
|
177
|
+
# Uses the modern theme renderer for Vue.js + Tailwind output.
|
|
178
|
+
#
|
|
179
|
+
# @param document [Coridoc::CoreModel::Base] CoreModel document to serialize
|
|
180
|
+
# @param config [Hash, Spa::Configuration] SPA converter configuration
|
|
181
|
+
# @return [String] HTML output
|
|
182
|
+
def self.serialize_spa(document, config = {})
|
|
183
|
+
Spa.convert(document, config)
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Serialize CoreModel document to HTML with specified format
|
|
187
|
+
#
|
|
188
|
+
# @param document [Coridoc::CoreModel::Base] CoreModel document to serialize
|
|
189
|
+
# @param format [Symbol] Output format (:static, :spa, :classic)
|
|
190
|
+
# @param options [Hash] Converter options
|
|
191
|
+
# @return [String] HTML output
|
|
192
|
+
def self.serialize_as(document, format, options = {})
|
|
193
|
+
case format.to_sym
|
|
194
|
+
when :static, :html_static, :classic
|
|
195
|
+
serialize_static(document, options)
|
|
196
|
+
when :spa, :html_spa, :modern
|
|
197
|
+
serialize_spa(document, options)
|
|
198
|
+
else
|
|
199
|
+
raise ArgumentError, "Unknown output format: #{format}. " \
|
|
200
|
+
'Valid formats: :static, :spa'
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Transform HTML model to CoreModel
|
|
205
|
+
#
|
|
206
|
+
# @param document [Object] HTML input model
|
|
207
|
+
# @return [Coridoc::CoreModel::Base] CoreModel document
|
|
208
|
+
def self.to_core_model(document)
|
|
209
|
+
Transform::ToCoreModel.transform(document)
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Check if this format can transform the given model to CoreModel
|
|
213
|
+
#
|
|
214
|
+
# HTML uses Leptris::XML as its model layer. Accepts Leptris nodes
|
|
215
|
+
# and CoreModel objects (pass-through).
|
|
216
|
+
#
|
|
217
|
+
# @param model [Object] The model to check
|
|
218
|
+
# @return [Boolean] true if the model is a Leptris node or CoreModel
|
|
219
|
+
def self.handles_model?(model)
|
|
220
|
+
model.is_a?(Leptris::XML::Node) ||
|
|
221
|
+
model.is_a?(Leptris::XML::Document) ||
|
|
222
|
+
model.is_a?(Coridoc::CoreModel::Base)
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
def self.to_core(document)
|
|
226
|
+
to_core_model(document)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Transform CoreModel to HTML-ready structure
|
|
230
|
+
#
|
|
231
|
+
# @param core_document [Coridoc::CoreModel::Base] CoreModel document
|
|
232
|
+
# @return [Object] HTML-ready structure
|
|
233
|
+
def self.from_core_model(core_document)
|
|
234
|
+
Transform::FromCoreModel.transform(core_document)
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Register after all module methods are defined
|
|
240
|
+
Coridoc.register_format(:html, Coridoc::Html,
|
|
241
|
+
aliases: %w[html htm],
|
|
242
|
+
extensions: %w[.html .htm])
|
|
243
|
+
|
|
244
|
+
# Reference materializers for format: :html. Required (not autoloaded)
|
|
245
|
+
# because registration is a load-time side effect, like register_format.
|
|
246
|
+
require 'coridoc/html/reference_materializers'
|
metadata
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: coridoc-html
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.1.23
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Ribose Inc.
|
|
8
|
+
bindir: exe
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: coridoc
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '3.0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '3.0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: coridoc-adoc
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - "~>"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '2.0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '2.0'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: leptris
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: 1.9.222
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: 1.9.222
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: marcel
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - "~>"
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '1.0'
|
|
61
|
+
type: :runtime
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - "~>"
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '1.0'
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: plurimath
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - "~>"
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '0.11'
|
|
75
|
+
type: :runtime
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - "~>"
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: '0.11'
|
|
82
|
+
- !ruby/object:Gem::Dependency
|
|
83
|
+
name: rspec
|
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - ">="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '0'
|
|
89
|
+
type: :development
|
|
90
|
+
prerelease: false
|
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - ">="
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: '0'
|
|
96
|
+
- !ruby/object:Gem::Dependency
|
|
97
|
+
name: rspec-its
|
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - ">="
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: '0'
|
|
103
|
+
type: :development
|
|
104
|
+
prerelease: false
|
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
106
|
+
requirements:
|
|
107
|
+
- - ">="
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: '0'
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: simplecov
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - ">="
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '0'
|
|
117
|
+
type: :development
|
|
118
|
+
prerelease: false
|
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - ">="
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '0'
|
|
124
|
+
description: Provides HTML to AsciiDoc conversion and AsciiDoc to HTML rendering with
|
|
125
|
+
both classic and modern Vue.js SPA themes
|
|
126
|
+
email:
|
|
127
|
+
- open.source@ribose.com
|
|
128
|
+
executables: []
|
|
129
|
+
extensions: []
|
|
130
|
+
extra_rdoc_files: []
|
|
131
|
+
files:
|
|
132
|
+
- LICENSE.txt
|
|
133
|
+
- lib/coridoc/html.rb
|
|
134
|
+
- lib/coridoc/html/asset_resolver.rb
|
|
135
|
+
- lib/coridoc/html/builder.rb
|
|
136
|
+
- lib/coridoc/html/cleaner.rb
|
|
137
|
+
- lib/coridoc/html/config.rb
|
|
138
|
+
- lib/coridoc/html/converter_base.rb
|
|
139
|
+
- lib/coridoc/html/converters.rb
|
|
140
|
+
- lib/coridoc/html/converters/a.rb
|
|
141
|
+
- lib/coridoc/html/converters/aside.rb
|
|
142
|
+
- lib/coridoc/html/converters/audio.rb
|
|
143
|
+
- lib/coridoc/html/converters/base.rb
|
|
144
|
+
- lib/coridoc/html/converters/blockquote.rb
|
|
145
|
+
- lib/coridoc/html/converters/br.rb
|
|
146
|
+
- lib/coridoc/html/converters/bypass.rb
|
|
147
|
+
- lib/coridoc/html/converters/code.rb
|
|
148
|
+
- lib/coridoc/html/converters/div.rb
|
|
149
|
+
- lib/coridoc/html/converters/dl.rb
|
|
150
|
+
- lib/coridoc/html/converters/drop.rb
|
|
151
|
+
- lib/coridoc/html/converters/em.rb
|
|
152
|
+
- lib/coridoc/html/converters/figure.rb
|
|
153
|
+
- lib/coridoc/html/converters/h.rb
|
|
154
|
+
- lib/coridoc/html/converters/head.rb
|
|
155
|
+
- lib/coridoc/html/converters/hr.rb
|
|
156
|
+
- lib/coridoc/html/converters/img.rb
|
|
157
|
+
- lib/coridoc/html/converters/li.rb
|
|
158
|
+
- lib/coridoc/html/converters/mark.rb
|
|
159
|
+
- lib/coridoc/html/converters/markup.rb
|
|
160
|
+
- lib/coridoc/html/converters/math.rb
|
|
161
|
+
- lib/coridoc/html/converters/media_base.rb
|
|
162
|
+
- lib/coridoc/html/converters/ol.rb
|
|
163
|
+
- lib/coridoc/html/converters/p.rb
|
|
164
|
+
- lib/coridoc/html/converters/pass_through.rb
|
|
165
|
+
- lib/coridoc/html/converters/positional_formatting.rb
|
|
166
|
+
- lib/coridoc/html/converters/pre.rb
|
|
167
|
+
- lib/coridoc/html/converters/q.rb
|
|
168
|
+
- lib/coridoc/html/converters/strong.rb
|
|
169
|
+
- lib/coridoc/html/converters/sub.rb
|
|
170
|
+
- lib/coridoc/html/converters/sup.rb
|
|
171
|
+
- lib/coridoc/html/converters/table.rb
|
|
172
|
+
- lib/coridoc/html/converters/td.rb
|
|
173
|
+
- lib/coridoc/html/converters/text.rb
|
|
174
|
+
- lib/coridoc/html/converters/tr.rb
|
|
175
|
+
- lib/coridoc/html/converters/video.rb
|
|
176
|
+
- lib/coridoc/html/drop.rb
|
|
177
|
+
- lib/coridoc/html/drop/annotation_drop.rb
|
|
178
|
+
- lib/coridoc/html/drop/base.rb
|
|
179
|
+
- lib/coridoc/html/drop/bibliography_drop.rb
|
|
180
|
+
- lib/coridoc/html/drop/bibliography_entry_drop.rb
|
|
181
|
+
- lib/coridoc/html/drop/block_drop.rb
|
|
182
|
+
- lib/coridoc/html/drop/definition_item_drop.rb
|
|
183
|
+
- lib/coridoc/html/drop/definition_list_drop.rb
|
|
184
|
+
- lib/coridoc/html/drop/document_drop.rb
|
|
185
|
+
- lib/coridoc/html/drop/drop_factory.rb
|
|
186
|
+
- lib/coridoc/html/drop/footnote_drop.rb
|
|
187
|
+
- lib/coridoc/html/drop/image_drop.rb
|
|
188
|
+
- lib/coridoc/html/drop/inline_element_drop.rb
|
|
189
|
+
- lib/coridoc/html/drop/list_block_drop.rb
|
|
190
|
+
- lib/coridoc/html/drop/list_item_drop.rb
|
|
191
|
+
- lib/coridoc/html/drop/raw_inline_element_drop.rb
|
|
192
|
+
- lib/coridoc/html/drop/table_cell_drop.rb
|
|
193
|
+
- lib/coridoc/html/drop/table_drop.rb
|
|
194
|
+
- lib/coridoc/html/drop/table_row_drop.rb
|
|
195
|
+
- lib/coridoc/html/drop/term_drop.rb
|
|
196
|
+
- lib/coridoc/html/drop/text_content_drop.rb
|
|
197
|
+
- lib/coridoc/html/drop/toc_drop.rb
|
|
198
|
+
- lib/coridoc/html/drop/toc_entry_drop.rb
|
|
199
|
+
- lib/coridoc/html/errors.rb
|
|
200
|
+
- lib/coridoc/html/escape.rb
|
|
201
|
+
- lib/coridoc/html/frontmatter_meta.rb
|
|
202
|
+
- lib/coridoc/html/html_converter.rb
|
|
203
|
+
- lib/coridoc/html/input_config.rb
|
|
204
|
+
- lib/coridoc/html/layout_renderer.rb
|
|
205
|
+
- lib/coridoc/html/lint.rb
|
|
206
|
+
- lib/coridoc/html/lint/registrations.rb
|
|
207
|
+
- lib/coridoc/html/plugin.rb
|
|
208
|
+
- lib/coridoc/html/plugins/plateau.rb
|
|
209
|
+
- lib/coridoc/html/postprocessor.rb
|
|
210
|
+
- lib/coridoc/html/reference_materializers.rb
|
|
211
|
+
- lib/coridoc/html/reference_materializers/link.rb
|
|
212
|
+
- lib/coridoc/html/reference_materializers/navigation.rb
|
|
213
|
+
- lib/coridoc/html/render_options.rb
|
|
214
|
+
- lib/coridoc/html/renderer.rb
|
|
215
|
+
- lib/coridoc/html/section_numberable.rb
|
|
216
|
+
- lib/coridoc/html/spa.rb
|
|
217
|
+
- lib/coridoc/html/static.rb
|
|
218
|
+
- lib/coridoc/html/tag_mapping.rb
|
|
219
|
+
- lib/coridoc/html/template_caching.rb
|
|
220
|
+
- lib/coridoc/html/template_config.rb
|
|
221
|
+
- lib/coridoc/html/template_helpers.rb
|
|
222
|
+
- lib/coridoc/html/template_locator.rb
|
|
223
|
+
- lib/coridoc/html/theme.rb
|
|
224
|
+
- lib/coridoc/html/title_text.rb
|
|
225
|
+
- lib/coridoc/html/toc_builder.rb
|
|
226
|
+
- lib/coridoc/html/toc_serializer.rb
|
|
227
|
+
- lib/coridoc/html/transform/from_core_model.rb
|
|
228
|
+
- lib/coridoc/html/transform/to_core_model.rb
|
|
229
|
+
- lib/coridoc/html/version.rb
|
|
230
|
+
homepage: https://github.com/coridoc/coridoc
|
|
231
|
+
licenses:
|
|
232
|
+
- MIT
|
|
233
|
+
metadata:
|
|
234
|
+
homepage_uri: https://github.com/coridoc/coridoc
|
|
235
|
+
source_code_uri: https://github.com/coridoc/coridoc
|
|
236
|
+
changelog_uri: https://github.com/coridoc/coridoc/releases
|
|
237
|
+
rubygems_mfa_required: 'true'
|
|
238
|
+
rdoc_options: []
|
|
239
|
+
require_paths:
|
|
240
|
+
- lib
|
|
241
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
242
|
+
requirements:
|
|
243
|
+
- - ">="
|
|
244
|
+
- !ruby/object:Gem::Version
|
|
245
|
+
version: 3.3.0
|
|
246
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
247
|
+
requirements:
|
|
248
|
+
- - ">="
|
|
249
|
+
- !ruby/object:Gem::Version
|
|
250
|
+
version: '0'
|
|
251
|
+
requirements: []
|
|
252
|
+
rubygems_version: 4.0.20
|
|
253
|
+
specification_version: 4
|
|
254
|
+
summary: HTML input/output converters for Coridoc
|
|
255
|
+
test_files: []
|