"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/extras/langs-examples/_adoc/haml/block_listing.html.haml" (12 May 2020, 1867 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Haml (HTML Abstraction Markup Language) source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 -# "block_listing.html.haml"            v1.0.0 | 2019/03/01 | by Tristano Ajmone
    2 -# =============================================================================
    3 -#            Custom Haml template for Highlight syntax highlighter             
    4 -# =============================================================================
    5 -# Adds 'lang=<language>' to <pre> tag to allow using different CSS themes with
    6 -# each language. Example:
    7 -#
    8 -#    <pre class="highlight" lang="ruby">
    9 -#
   10 -# Without this tweak, you can't customize background color and borders on a
   11 -# per-language basis.
   12 -# -----------------------------------------------------------------------------
   13 %div{:id=>@id, :class=>['listingblock', role]}
   14   - if title?
   15     .title=captioned_title
   16   .content
   17     - nowrap = !(@document.attr? :prewrap) || (option? :nowrap)
   18     - if @style == 'source'
   19       - code_lang = attr :language, nil, false
   20       - code_class = ["language-#{code_lang}"] if code_lang
   21       - pre_class = ['highlight']
   22       - pre_lang = nil
   23       - case document.attr 'source-highlighter'
   24       - when 'highlight'
   25         - pre_lang = attr :language, nil, false
   26       - when 'coderay'
   27         - pre_class.unshift 'CodeRay'
   28         - code_class = nil
   29       - when 'pygments'
   30         - pre_class.unshift 'pygments'
   31         - code_class = nil
   32       - when 'highlightjs', 'highlight.js'
   33         - pre_class.unshift 'highlightjs'
   34       - when 'prettify'
   35         - pre_class.unshift 'prettyprint'
   36         - pre_class << 'linenums' if attr? :linenums
   37       - when 'html-pipeline'
   38         - pre_lang = code_lang
   39         - code_class = code_lang = pre_class = nil
   40         - nowrap = false
   41       - pre_class << 'nowrap' if nowrap
   42       %pre{:class=>pre_class, :lang=>pre_lang}
   43         %code{:class=>code_class, 'data-lang'=>code_lang}=content
   44     - else
   45       %pre{:class=>('nowrap' if nowrap)}=content