class Solargraph::Pin::Documenting::DocSection
text, or applies backticks for code blocks.
A documentation formatter that either performs Markdown conversion for
def code?
def code? @code end
def concat text
-
(String)
-
Parameters:
-
text
(String
) --
def concat text @plaintext.concat text end
def initialize code
-
code
(Boolean
) -- True if this section is a code block
def initialize code @plaintext = String.new('') @code = code end
def to_code
-
(String)
-
def to_code "\n```ruby\n#{Documenting.normalize_indentation(@plaintext)}#{@plaintext.end_with?("\n") ? '' : "\n"}```\n\n" end
def to_markdown
-
(String)
-
def to_markdown ReverseMarkdown.convert Kramdown::Document.new(@plaintext, input: 'GFM').to_html end
def to_s
def to_s return to_code if code? to_markdown end