diff --git a/.gitignore b/.gitignore index 0ae7b1b572..19812a2b07 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ _site .sass-cache build +.firebaserc # Dart ignores. .packages diff --git a/_includes/prev-next-nav.html b/_includes/prev-next-nav.html new file mode 100644 index 0000000000..61b000c1ed --- /dev/null +++ b/_includes/prev-next-nav.html @@ -0,0 +1,20 @@ +
+
+ + +
+{% if page.prev-page %} + {{ page.prev-page-title }} +{% endif %} +
+ + +
+{% if page.next-page %} +{{ page.next-page-title }} +{% endif %} +
+

 

+ +
+
diff --git a/_layouts/tutorial.html b/_layouts/tutorial.html new file mode 100644 index 0000000000..6195919246 --- /dev/null +++ b/_layouts/tutorial.html @@ -0,0 +1,15 @@ +--- +layout: page +--- + +{% if page.points %} +
+

What's the point?

+ +
+{% endif %} +{{ content }} diff --git a/_plugins/prettify.rb b/_plugins/prettify.rb new file mode 100644 index 0000000000..df9dfa33b2 --- /dev/null +++ b/_plugins/prettify.rb @@ -0,0 +1,58 @@ +# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +require 'cgi' + +module Prettify + + # Wraps code with tags for Prettify. + # + # Example usage: + # + # {% prettify dart %} + # // dart code here + # {% endprettify %} + # + # The language name can be ommitted if it is not known. + class Tag < Liquid::Block + + Syntax = /\s*(\w+)\s*/o + + def initialize(tag_name, markup, tokens) + super + if markup =~ Syntax + @lang = $1 + end + end + + def render(context) + # out = '
')
+      contents.gsub!('[[/strike]]', '')
+
+      contents.gsub!('[[highlight]]', '')
+      contents.gsub!('[[/highlight]]', '')
+
+      contents.gsub!('[[note]]', '')
+      contents.gsub!('[[/note]]', '')
+
+      contents.gsub!('[[red]]', '')
+      contents.gsub!('[[/red]]', '')
+
+      out += contents + "
" + end + + end +end + +Liquid::Template.register_tag('prettify', Prettify::Tag) diff --git a/_sass/_customstyles.scss b/_sass/_customstyles.scss index dd8040b7c4..890a0b5183 100644 --- a/_sass/_customstyles.scss +++ b/_sass/_customstyles.scss @@ -789,6 +789,12 @@ pre, table code { pre { margin: 25px 0px; + /* Added from dartlang to enable highlighting in code blocks. */ + /* site-www/src/_assets/stylesheets/main.css */ + .highlight { + background: #fffde7 !important; + padding: 2px; + } } #json-box-container pre { @@ -1032,4 +1038,4 @@ a code { table th code { color: white; -} \ No newline at end of file +}