Class: Elisp::Desc

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

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Desc

Returns a new instance of Desc.



38
39
40
# File 'lib/elisp.rb', line 38

def initialize(content)
  @content = content
end

Instance Method Details

#htmlObject



42
43
44
45
# File 'lib/elisp.rb', line 42

def html
  content = CGI.escape_html(@content)
  %(<p class="description">#{content}</p>)
end

#pandoc_json_objectObject



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/elisp.rb', line 47

def pandoc_json_object
  {
    "t": "Div",
    "c": [
      ["", ["description"], []],
      [
        {
          "t": "Para",
          "c": [
            {
              "t": "Str",
              "c": @content,
            },
          ],
        },
      ],
    ],
  }
end