Class: Homebrew::Manpages::Converter::Kramdown Private

Inherits:
Kramdown::Converter::Kramdown
  • Object
show all
Defined in:
manpages/converter/kramdown.rb

Overview

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Converts our Kramdown-like input to pure Kramdown.

Instance Method Summary collapse

Constructor Details

#initialize(root, options) ⇒ Kramdown

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns a new instance of Kramdown.



11
12
13
# File 'manpages/converter/kramdown.rb', line 11

def initialize(root, options)
  super(root, options.merge(line_width: 80))
end

Instance Method Details

#convert_a(element, options) ⇒ Object

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



19
20
21
22
23
24
25
26
27
# File 'manpages/converter/kramdown.rb', line 19

def convert_a(element, options)
  text = inner(element, options)
  if element.attr["href"] == text
    # Don't duplicate the URL if the link text is the same as the URL.
    "<#{text}>"
  else
    super
  end
end

#convert_variable(element, _options) ⇒ Object

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



15
16
17
# File 'manpages/converter/kramdown.rb', line 15

def convert_variable(element, _options)
  "*`#{element.value}`*"
end