Class: Elisp::Code
- Inherits:
-
Object
- Object
- Elisp::Code
- Defined in:
- lib/elisp.rb
Instance Method Summary collapse
- #<<(content) ⇒ Object
- #html ⇒ Object
-
#initialize(content) ⇒ Code
constructor
A new instance of Code.
- #pandoc_json_object ⇒ Object
Constructor Details
#initialize(content) ⇒ Code
Returns a new instance of Code.
142 143 144 |
# File 'lib/elisp.rb', line 142 def initialize(content) @content = content end |
Instance Method Details
#<<(content) ⇒ Object
146 147 148 |
# File 'lib/elisp.rb', line 146 def <<(content) @content << "\n#{content}" end |
#html ⇒ Object
150 151 152 153 |
# File 'lib/elisp.rb', line 150 def html content = CGI.escape_html(@content) %(<pre class="code"><code>#{content}</code></pre>) end |
#pandoc_json_object ⇒ Object
155 156 157 158 159 160 161 162 163 |
# File 'lib/elisp.rb', line 155 def pandoc_json_object { "t": "CodeBlock", "c": [ ["", ["emacs-lisp"], []], @content, ], } end |