Module: Jazzy::Markdown

Defined in:
lib/jazzy/jazzy_markdown.rb

Defined Under Namespace

Classes: JazzyCopyright, JazzyDeclarationHTML, JazzyHTML

Constant Summary collapse

REDCARPET_OPTIONS =
{
  autolink: true,
  fenced_code_blocks: true,
  no_intra_emphasis: true,
  quote: true,
  strikethrough: true,
  space_after_headers: false,
  tables: true,
  lax_spacing: true,
}.freeze

Class Method Summary collapse

Class Method Details



183
184
185
186
187
188
# File 'lib/jazzy/jazzy_markdown.rb', line 183

def self.copyright_markdown
  @copyright_markdown ||= Redcarpet::Markdown.new(
    JazzyCopyright,
    REDCARPET_OPTIONS,
  )
end

.markdownObject



159
160
161
# File 'lib/jazzy/jazzy_markdown.rb', line 159

def self.markdown
  @markdown ||= Redcarpet::Markdown.new(renderer, REDCARPET_OPTIONS)
end

.render(markdown_text) ⇒ Object



163
164
165
166
# File 'lib/jazzy/jazzy_markdown.rb', line 163

def self.render(markdown_text)
  renderer.reset
  markdown.render(markdown_text)
end


190
191
192
# File 'lib/jazzy/jazzy_markdown.rb', line 190

def self.render_copyright(markdown_text)
  copyright_markdown.render(markdown_text)
end

.rendered_parametersObject



172
173
174
# File 'lib/jazzy/jazzy_markdown.rb', line 172

def self.rendered_parameters
  renderer.parameters
end

.rendered_returnsObject



168
169
170
# File 'lib/jazzy/jazzy_markdown.rb', line 168

def self.rendered_returns
  renderer.returns
end

.rendererObject



155
156
157
# File 'lib/jazzy/jazzy_markdown.rb', line 155

def self.renderer
  @renderer ||= JazzyDeclarationHTML.new
end