Sha256: b5a3c0398ff9e5ca4207911858ff54e5ce69fd03893f00fda981dfb8bd0ea07f

Contents?: true

Size: 613 Bytes

Versions: 18

Compression:

Stored size: 613 Bytes

Contents

# Define a filter for adding annotation links
Nanoc::Filter.define(:scholar_annotations) do |content, params|
  content = content.dup
  
  # Add Dokieli actions at the end of the <header>
  content.gsub! %r{\<\/header\>} do |match|
    <<-HTML
  <section class="actions">
    <h2 id="notifications-and-annotations">Notifications and annotations</h2>
    <ul>
      <li><a href="#{params[:notifications]}" rel="ldp:inbox">notification inbox</a></li>
      <li><a href="#{params[:annotations]}" rel="oa:annotationService">annotation service</a></li>
    </ul>
  </section>
</header>
    HTML
  end
  
  content
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
scholarmarkdown-3.2.1 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-3.2.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-3.1.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-3.0.1 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-3.0.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-2.11.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-2.10.1 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-2.10.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-2.9.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-2.8.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-2.7.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-2.6.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-2.5.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-2.4.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-2.3.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-2.2.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-2.1.0 lib/scholarmarkdown/filter/annotations.rb
scholarmarkdown-2.0.0 lib/scholarmarkdown/filter/annotations.rb