Class: MultipageHtml5CSS

Inherits:
Asciidoctor::Extensions::DocinfoProcessor
  • Object
show all
Defined in:
lib/asciidoctor-multipage.rb

Instance Method Summary collapse

Instance Method Details

#process(doc) ⇒ Object



630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
# File 'lib/asciidoctor-multipage.rb', line 630

def process doc
  # Disable this entirely if the multipage-disable-css attribute is set
  if doc.attr('multipage-disable-css')
    return
  end
  css = []
  # Style Table Of Contents entry for current page
  css << %(.toc-current{font-weight: bold;})
  # Style Table Of Contents entry for root page
  css << %(.toc-root{font-family: "Open Sans","DejaVu Sans",sans-serif;
                     font-size: 0.9em;})
  # Style navigation bar at bottom of each page
  css << %(#content{display: flex; flex-direction: column; flex: 1 1 auto;}
           .nav-footer{text-align: center; margin-top: auto;}
           .nav-footer > p > a {white-space: nowrap;})
  %(<style>#{css.join(' ')}</style>)
end