Class: Homebrew::Manpages::Converter::Kramdown Private
- Inherits:
-
Kramdown::Converter::Kramdown
- Object
- Kramdown::Converter::Kramdown
- Homebrew::Manpages::Converter::Kramdown
- 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
- #convert_a(element, options) ⇒ String private
- #convert_variable(element, _options) ⇒ String private
- #initialize(root, options) ⇒ void constructor private
Constructor Details
#initialize(root, options) ⇒ void
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.
12 13 14 |
# File 'manpages/converter/kramdown.rb', line 12 def initialize(root, ) super(root, .merge(line_width: 80)) end |
Instance Method Details
#convert_a(element, options) ⇒ String
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.
22 23 24 25 26 27 28 29 30 |
# File 'manpages/converter/kramdown.rb', line 22 def convert_a(element, ) text = inner(element, ) 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) ⇒ String
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, ) "*`#{element.value}`*" end |