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.



13
14
15
# File 'manpages/converter/kramdown.rb', line 13

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.



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

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(element, options)
  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.



17
18
19
# File 'manpages/converter/kramdown.rb', line 17

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