def template
@template ||= @eruby.new "<%#encoding:UTF-8%><!DOCTYPE html>\n<html<%= !(attr? 'nolang') ? %( lang=\"\\\#{attr 'lang', 'en'}\") : nil %>>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=<%= attr :encoding %>\">\n<meta name=\"generator\" content=\"Asciidoctor <%= attr 'asciidoctor-version' %>\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><%\nif attr? :description %>\n<meta name=\"description\" content=\"<%= attr :description %>\"><%\nend\nif attr? :keywords %>\n<meta name=\"keywords\" content=\"<%= attr :keywords %>\"><%\nend %>\n<title><%= doctitle %></title><%\nif DEFAULT_STYLESHEET_KEYS.include?(attr 'stylesheet')\nif @safe >= SafeMode::SECURE || (attr? 'linkcss') %>\n<link rel=\"stylesheet\" href=\"<%= normalize_web_path(DEFAULT_STYLESHEET_NAME, (attr :stylesdir, '')) %>\"><%\nelse %>\n<style>\n<%= ::Asciidoctor::HTML5.default_asciidoctor_stylesheet %>\n</style><%\nend\nelsif attr? :stylesheet\nif attr? 'linkcss' %>\n<link rel=\"stylesheet\" href=\"<%= normalize_web_path((attr :stylesheet), (attr :stylesdir, '')) %>\"><%\nelse %>\n<style>\n<%= read_asset normalize_system_path((attr :stylesheet), (attr :stylesdir, '')), true %>\n</style><%\nend\nend\nif attr? 'icons', 'font'\nif !(attr 'iconfont-remote', '').nil? %>\n<link rel=\"stylesheet\" href=\"<%= attr 'iconfont-cdn', 'http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.1.0/css' %>/<%= attr 'iconfont-name', 'font-awesome' %>.min.css\"><%\nelse %>\n<link rel=\"stylesheet\" href=\"<%= normalize_web_path(%(\\\#{attr 'iconfont-name', 'font-awesome'}.css), (attr 'stylesdir', '')) %>\"><%\nend\nend\ncase attr 'source-highlighter'\nwhen 'coderay'\nif (attr 'coderay-css', 'class') == 'class' %>\n<style>\n<%= ::Asciidoctor::HTML5.default_coderay_stylesheet %>\n</style><%\nend\nwhen 'highlightjs', 'highlight.js' %>\n<link rel=\"stylesheet\" href=\"<%= attr :highlightjsdir, 'http://cdnjs.cloudflare.com/ajax/libs/highlight.js/7.3' %>/styles/<%= attr 'highlightjs-theme', 'default' %>.min.css\">\n<script src=\"<%= attr :highlightjsdir, 'http://cdnjs.cloudflare.com/ajax/libs/highlight.js/7.3' %>/highlight.min.js\"></script>\n<script>hljs.initHighlightingOnLoad()</script><%\nwhen 'prettify' %>\n<link rel=\"stylesheet\" href=\"<%= attr 'prettifydir', 'http://cdnjs.cloudflare.com/ajax/libs/prettify/r298' %>/<%= attr 'prettify-theme', 'prettify' %>.min.css\">\n<script src=\"<%= attr 'prettifydir', 'http://cdnjs.cloudflare.com/ajax/libs/prettify/r298' %>/prettify.min.js\"></script>\n<script>document.addEventListener('DOMContentLoaded', prettyPrint)</script><%\nend %><%= (docinfo_content = docinfo).empty? ? nil : %(\n\\\#{docinfo_content}) %>\n</head>\n<body\#{id} class=\"<%= doctype %><%= (attr? 'toc-class') && (attr? 'toc') && (attr? 'toc-placement', 'auto') ? %( \\\#{attr 'toc-class'}) : nil %>\"<%= (attr? 'max-width') ? %( style=\"max-width: \\\#{attr 'max-width'};\") : nil %>><%\nunless noheader %>\n<div id=\"header\"><%\nif has_header?\nunless notitle %>\n<h1><%= @header.title %></h1><%\nend %><%\nif attr? :author %>\n<span id=\"author\"><%= attr :author %></span><br><%\nif attr? :email %>\n<span id=\"email\"><%= sub_macros(attr :email) %></span><br><%\nend\nend\nif attr? :revnumber %>\n<span id=\"revnumber\">version <%= attr :revnumber %><%= (attr? :revdate) ? ',' : '' %></span><%\nend\nif attr? :revdate %>\n<span id=\"revdate\"><%= attr :revdate %></span><%\nend\nif attr? :revremark %>\n<br><span id=\"revremark\"><%= attr :revremark %></span><%\nend\nend\nif (attr? :toc) && (attr? 'toc-placement', 'auto') %>\n<div id=\"toc\" class=\"<%= attr 'toc-class', 'toc' %>\">\n<div id=\"toctitle\"><%= attr 'toc-title' %></div>\n<%= template.class.outline(self, (attr :toclevels, 2).to_i) %>\n</div><%\nend %>\n</div><%\nend %>\n<div id=\"content\">\n<%= content %>\n</div><%\nunless !footnotes? || (attr? :nofootnotes) %>\n<div id=\"footnotes\">\n<hr><%\nfootnotes.each do |fn| %>\n<div class=\"footnote\" id=\"_footnote_<%= fn.index %>\">\n<a href=\"#_footnoteref_<%= fn.index %>\"><%= fn.index %></a>. <%= fn.text %>\n</div><%\nend %>\n</div><%\nend %>\n<div id=\"footer\">\n<div id=\"footer-text\"><%\nif attr? :revnumber %>\nVersion <%= attr :revnumber %><br><%\nend %>\nLast updated <%= attr :docdatetime %>\n</div>\n</div>\n</body>\n</html>\n"
end