Sha256: 1813dc3b2b8f6ccf152e322e7dec42ec68eb0ee05bb33c67e39291e7f29ee93a

Contents?: true

Size: 1005 Bytes

Versions: 4

Compression:

Stored size: 1005 Bytes

Contents


require 'asciidoctor'
require 'asciidoctor/extensions'
require 'asciidoctor/latex/core_ext/colored_string'

#
module Asciidoctor::LaTeX

  class InjectHTML < Asciidoctor::Extensions::Postprocessor

    def process document, output
      output = output.gsub('</head>', $click_insertion)
    end

  end

  $click_insertion = <<EOF

<style>
  .click .title { color: blue; }'
</style>


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script>

  $(document).ready(function(){
    $('.openblock.click').click( function()  { $(this).find('.content').slideToggle('200');
      $.reloadMathJax() }  )
    $('.openblock.click').find('.content').hide()
  });

  $(document).ready(function(){
    $('.listingblock.click').click( function()  { $(this).find('.content').slideToggle('200') }  )
    $('.listingblock.click').find('.content').hide()
  });


  $(document).ready(ready);
  $(document).on('page:load', ready);
</script>

</head>

EOF

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
asciidoctor-latex-1.5.0.3.dev lib/asciidoctor/latex/inject_html.rb
asciidoctor-latex-1.5.0.2.dev lib/asciidoctor/latex/inject_html.rb
asciidoctor-latex-1.5.0.1.dev lib/asciidoctor/latex/inject_html.rb
asciidoctor-latex-1.5.0.dev lib/asciidoctor/latex/inject_html.rb