Class: Coradoc::Html::Spa
- Inherits:
-
ConverterBase
- Object
- ConverterBase
- Coradoc::Html::Spa
- Defined in:
- lib/coradoc/html/spa.rb
Overview
SPA (Single Page Application) HTML converter
Converts Coradoc::CoreModel::StructuralElement to a modern Vue.js + Tailwind CSS single-page application with glass morphism aesthetics.
Features:
-
Vue.js 3 reactive components
-
Tailwind CSS styling
-
Glass morphism design
-
Dark/light theme toggle
-
Reading progress indicator
-
Sticky TOC sidebar
-
Copy code buttons
-
Smooth animations
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary
Attributes inherited from ConverterBase
Class Method Summary collapse
-
.processor_execute(input, options = {}) ⇒ Hash
Output processor interface: execute the conversion.
-
.processor_id ⇒ Symbol
Output processor interface: unique identifier.
-
.processor_match?(filename) ⇒ Boolean
Output processor interface: check if this processor handles the file.
Instance Method Summary collapse
-
#convert ⇒ String
Convert document to SPA HTML.
Methods inherited from ConverterBase
convert, #converter_name, #initialize, #to_file, to_file
Constructor Details
This class inherits a constructor from Coradoc::Html::ConverterBase
Class Method Details
.processor_execute(input, options = {}) ⇒ Hash
Output processor interface: execute the conversion
300 301 302 303 304 305 306 |
# File 'lib/coradoc/html/spa.rb', line 300 def self.processor_execute(input, = {}) # Handle hash input from converter pipeline document = input.is_a?(Hash) ? (input[:document] || input.values.first) : input html = convert(document, ) # Return in format expected by converter (hash with filename => content) { nil => html } end |
.processor_id ⇒ Symbol
Output processor interface: unique identifier
283 284 285 |
# File 'lib/coradoc/html/spa.rb', line 283 def self.processor_id :html_spa end |
.processor_match?(filename) ⇒ Boolean
Output processor interface: check if this processor handles the file
291 292 293 |
# File 'lib/coradoc/html/spa.rb', line 291 def self.processor_match?(filename) filename.downcase.end_with?('.html', '.htm') end |
Instance Method Details
#convert ⇒ String
Convert document to SPA HTML
253 254 255 256 257 258 259 260 |
# File 'lib/coradoc/html/spa.rb', line 253 def convert # Build options hash for ModernRenderer = @config. # Use ModernRenderer to generate HTML renderer = Html::Theme::ModernRenderer.new(@document, ) renderer.render_html5 end |