# HG changeset patch # User nick # Date 1354134313 0 # Node ID 982aeacba4c698456b49ea9c73bc98851276c288 # Parent afa692f64fbfbc785e0a096831aeb9aec89173ed Finally added toc after speaking to Apache devs diff -r afa692f64fbf -r 982aeacba4c6 _layouts/default.html --- a/_layouts/default.html Sat Nov 24 11:46:53 2012 +0000 +++ b/_layouts/default.html Wed Nov 28 20:25:13 2012 +0000 @@ -54,7 +54,7 @@

{{ page.title }}

- + {{ content | toc }} {{ content }}
diff -r afa692f64fbf -r 982aeacba4c6 _plugins/TocFilter.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/_plugins/TocFilter.rb Wed Nov 28 20:25:13 2012 +0000 @@ -0,0 +1,17 @@ +module TocFilter + def toc(input) + output = "
    " + input.scan(/<(h2)(?:>|\s+(.*?)>)([^<]*)<\/\1\s*>/mi).each do |entry| + id = (entry[1][/^id=(['"])(.*)\1$/, 2] rescue nil) + title = entry[2].gsub(/<(\w*).*?>(.*?)<\/\1\s*>/m, '\2').strip + if id + output << %{
  1. #{title}
  2. } + else + output << %{
  3. #{title}
  4. } + end + end + output << '
' + output + end +end +Liquid::Template.register_filter(TocFilter) \ No newline at end of file diff -r afa692f64fbf -r 982aeacba4c6 contact.textile --- a/contact.textile Sat Nov 24 11:46:53 2012 +0000 +++ b/contact.textile Wed Nov 28 20:25:13 2012 +0000 @@ -14,8 +14,6 @@ This will ensure that your message is sent to all members of the BioAid team. We will soon establish a more formal data collection procedure. -h2(#people). People - table{border:1px solid black}. |!{width: 100px;}images/port_nc.jpg!|*Nick Clark* BioAid mobile and lab-scale app development. Algorithm development and engineering.|