Sha256: 855e2a28a475ab9f29789345ca37e0b3db4e0aa857c4dd7625e0402484faefec

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

- nowrap = (option? 'nowrap') || !(document.attr? 'prewrap')
- if @style == 'source'
  - syntax_hl = document.syntax_highlighter
  - lang = attr :language
  - if syntax_hl
    - doc_attrs = document.attributes
    - css_mode = (doc_attrs[%(#{syntax_hl.name}-css)] || :class).to_sym
    - style = doc_attrs[%(#{syntax_hl.name}-style)]
    - opts = syntax_hl.highlight? ? { css_mode: css_mode, style: style } : {}
    - opts[:nowrap] = nowrap
  - else
    - pre_open = %(<pre class="highlight#{nowrap ? ' nowrap' : ''}"><code#{lang ? %[ class="language-#{lang}" data-lang="#{lang}"] : ''}>)
    - pre_close = '</code></pre>'
- else
  - pre_open = %(<pre#{nowrap ? ' class="nowrap"' : ''}>)
  - pre_close = '</pre>'
- id_attribute = id ? %( id="#{id}") : ''
- title_element = title? ? %(<div class="title">#{captioned_title}</div>\n) : ''
=%(<div#{id_attribute} class="listingblock#{(role = self.role) ? " #{role}" : ''}">#{title_element}<div class="content">#{syntax_hl ? (syntax_hl.format self, lang, opts) : pre_open + (content || '') + pre_close}</div></div>)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
asciidoctor-revealjs-4.0.1 templates/listing.html.slim
asciidoctor-revealjs-4.0.0 templates/listing.html.slim