Class: Elisp::DocStringParser::HTMLURL

Inherits:
Object
  • Object
show all
Defined in:
lib/elisp/doc_string_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ HTMLURL

Returns a new instance of HTMLURL.



143
144
145
# File 'lib/elisp/doc_string_parser.rb', line 143

def initialize(content)
  @content = content
end

Instance Method Details

#htmlObject



147
148
149
150
151
152
# File 'lib/elisp/doc_string_parser.rb', line 147

def html
  url = @content.to_s
  ref = CGI.escape(url)
  label = CGI.escape_html(url)
  %(<a class="pure-url" href="#{ref}">#{label}</a>)
end

#pandoc_json_objectObject



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/elisp/doc_string_parser.rb', line 154

def pandoc_json_object
  {
    "t": "Link",
    "c": [
      ["", ["uri"], []],
      [
        {
          "t": "Str",
          "c": @content,
        }
      ],
      [
        @content,
        "",
      ],
    ],
  }
end