Skip to content

Commit

Permalink
Address issue #16 use markdown and not gist embeds for code blocks
Browse files Browse the repository at this point in the history
I've added a Markefile so that documentation can be maintained in
seperate markdown files and the rendered html included
into the various templates as required
  • Loading branch information
chrisdev committed May 24, 2012
1 parent 935d925 commit 47f3ccf
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 13 deletions.
25 changes: 25 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Makefile for site content
#
BUILDDIR = _build
INSTALLDIR= ../foundation_theme_site/templates/includes
MD_SRCS=$(shell find . -name "*.md")
MD_TARGETS=$(MD_SRCS:.md=.html)
.PHONY: help clean html install

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make the HTML include files"
@echo " clean deletes all html files "
@echo " install copy the htmls to includes "


clean:
rm *.html

$(MD_TARGETS): %.html: %.md
markdown_py -x codehilite $< -f $@

html: $(MD_TARGETS)

install:
cp *.html $(INSTALLDIR)
62 changes: 62 additions & 0 deletions foundation_theme_site/static/css/code_style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.codehilite .hll { background-color: #ffffcc }
.codehilite { background: #ffffff; }
.codehilite .c { color: #808080 } /* Comment */
.codehilite .err { color: #F00000; background-color: #F0A0A0 } /* Error */
.codehilite .k { color: #008000; font-weight: bold } /* Keyword */
.codehilite .o { color: #303030 } /* Operator */
.codehilite .cm { color: #808080 } /* Comment.Multiline */
.codehilite .cp { color: #507090 } /* Comment.Preproc */
.codehilite .c1 { color: #808080 } /* Comment.Single */
.codehilite .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
.codehilite .gd { color: #A00000 } /* Generic.Deleted */
.codehilite .ge { font-style: italic } /* Generic.Emph */
.codehilite .gr { color: #FF0000 } /* Generic.Error */
.codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.codehilite .gi { color: #00A000 } /* Generic.Inserted */
.codehilite .go { color: #808080 } /* Generic.Output */
.codehilite .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.codehilite .gs { font-weight: bold } /* Generic.Strong */
.codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.codehilite .gt { color: #0040D0 } /* Generic.Traceback */
.codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.codehilite .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.codehilite .kp { color: #003080; font-weight: bold } /* Keyword.Pseudo */
.codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.codehilite .kt { color: #303090; font-weight: bold } /* Keyword.Type */
.codehilite .m { color: #6000E0; font-weight: bold } /* Literal.Number */
.codehilite .s { background-color: #fff0f0 } /* Literal.String */
.codehilite .na { color: #0000C0 } /* Name.Attribute */
.codehilite .nb { color: #007020 } /* Name.Builtin */
.codehilite .nc { color: #B00060; font-weight: bold } /* Name.Class */
.codehilite .no { color: #003060; font-weight: bold } /* Name.Constant */
.codehilite .nd { color: #505050; font-weight: bold } /* Name.Decorator */
.codehilite .ni { color: #800000; font-weight: bold } /* Name.Entity */
.codehilite .ne { color: #F00000; font-weight: bold } /* Name.Exception */
.codehilite .nf { color: #0060B0; font-weight: bold } /* Name.Function */
.codehilite .nl { color: #907000; font-weight: bold } /* Name.Label */
.codehilite .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.codehilite .nt { color: #007000 } /* Name.Tag */
.codehilite .nv { color: #906030 } /* Name.Variable */
.codehilite .ow { color: #000000; font-weight: bold } /* Operator.Word */
.codehilite .w { color: #bbbbbb } /* Text.Whitespace */
.codehilite .mf { color: #6000E0; font-weight: bold } /* Literal.Number.Float */
.codehilite .mh { color: #005080; font-weight: bold } /* Literal.Number.Hex */
.codehilite .mi { color: #0000D0; font-weight: bold } /* Literal.Number.Integer */
.codehilite .mo { color: #4000E0; font-weight: bold } /* Literal.Number.Oct */
.codehilite .sb { background-color: #fff0f0 } /* Literal.String.Backtick */
.codehilite .sc { color: #0040D0 } /* Literal.String.Char */
.codehilite .sd { color: #D04020 } /* Literal.String.Doc */
.codehilite .s2 { background-color: #fff0f0 } /* Literal.String.Double */
.codehilite .se { color: #606060; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
.codehilite .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
.codehilite .si { background-color: #e0e0e0 } /* Literal.String.Interpol */
.codehilite .sx { color: #D02000; background-color: #fff0f0 } /* Literal.String.Other */
.codehilite .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
.codehilite .s1 { background-color: #fff0f0 } /* Literal.String.Single */
.codehilite .ss { color: #A06000 } /* Literal.String.Symbol */
.codehilite .bp { color: #007020 } /* Name.Builtin.Pseudo */
.codehilite .vc { color: #306090 } /* Name.Variable.Class */
.codehilite .vg { color: #d07000; font-weight: bold } /* Name.Variable.Global */
.codehilite .vi { color: #3030B0 } /* Name.Variable.Instance */
.codehilite .il { color: #0000D0; font-weight: bold } /* Literal.Number.Integer.Long */
35 changes: 35 additions & 0 deletions foundation_theme_site/templates/includes/dropdown.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<h1>Drop-down Menu</h1>
<p>Pinax theme foundation provides a top menu bar we have done all of the work for you allowing you to focus on the more important part of the design.
This allows you to create visually appealing drop-downs that are easy to edit and update, and that work across a multitude of
browsers, including Internet Explorer. Better still, for code-wary designers, no JavaScript is required! (Actually, some
JavaScript is needed, but we already wrote it for you.)</p>
<p>Location of the Menu
To create a drop-down menu the code must be placed within the top-bar and attached div classes. Out of the box Pinax Theme Foundation
comes with one drop-down menu within the top-bar and attached div classes. To add another drop-down menu place the code below within the top-bar and attached div classes.
Creating the menu
The first step is to create the menu structure itself. This is done by using an unordered list as the main menu bar, and each drop-down-menu appearing
as a list within its parent list item. Sound complicated? It’s actually very straightforward: </p>
<p>The above code shows the drop-down menu code for "design patterns". It should be noted that the design pattern was added
as a list item that contained a list of links. All that is required to define a dropdown menu in the topbar is to make
a list item tag with css class "has-dropdown" and a unordered list tag with css class "dropdown"</p>
<div class="codehilite"><pre><span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;top-bar&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;attached&quot;</span><span class="nt">&gt;</span>
...
<span class="nt">&lt;ul</span> <span class="na">class=</span><span class="s">&quot;right&quot;</span><span class="nt">&gt;</span>
...
<span class="nt">&lt;li</span> <span class="na">class=</span><span class="s">&quot;has-dropdown&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&quot;http://apps.raisedeyebrow.com/Design_Patterns/&quot;</span> <span class="na">target=</span><span class="s">&quot;_blank&quot;</span><span class="nt">&gt;</span>Design Patterns<span class="nt">&lt;/a&gt;</span>
<span class="nt">&lt;ul</span> <span class="na">class=</span><span class="s">&quot;dropdown&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;li&gt;&lt;a</span> <span class="na">href=</span><span class="s">&quot;/gallery_design/&quot;</span><span class="nt">&gt;&lt;span</span> <span class="na">class=</span><span class="s">&quot;glyph general&quot;</span><span class="nt">&gt;</span>a<span class="nt">&lt;/span&gt;</span>Gallery Design<span class="nt">&lt;/a&gt;&lt;/li&gt;</span>
<span class="nt">&lt;li&gt;&lt;a</span> <span class="na">href=</span><span class="s">&quot;/featured_shuffle/&quot;</span><span class="nt">&gt;&lt;span</span> <span class="na">class=</span><span class="s">&quot;glyph general&quot;</span><span class="nt">&gt;</span>b<span class="nt">&lt;/span&gt;</span>Featured Shuffle<span class="nt">&lt;/a&gt;&lt;/li&gt;</span>
<span class="nt">&lt;li&gt;&lt;a</span> <span class="na">href=</span><span class="s">&quot;/featured_items/&quot;</span><span class="nt">&gt;&lt;span</span> <span class="na">class=</span><span class="s">&quot;glyph general&quot;</span><span class="nt">&gt;</span>i<span class="nt">&lt;/span&gt;</span>Featured Items<span class="nt">&lt;/a&gt;&lt;/li&gt;</span>
<span class="nt">&lt;li&gt;&lt;a</span> <span class="na">href=</span><span class="s">&quot;/column_flip/&quot;</span><span class="nt">&gt;&lt;span</span> <span class="na">class=</span><span class="s">&quot;glyph general&quot;</span><span class="nt">&gt;</span>c<span class="nt">&lt;/span&gt;</span>Column Flip<span class="nt">&lt;/a&gt;&lt;/li&gt;</span>
<span class="nt">&lt;li&gt;&lt;a</span> <span class="na">href=</span><span class="s">&quot;/mondrian/&quot;</span><span class="nt">&gt;&lt;span</span> <span class="na">class=</span><span class="s">&quot;glyph general&quot;</span><span class="nt">&gt;</span>d<span class="nt">&lt;/span&gt;</span>Mondrian<span class="nt">&lt;/a&gt;&lt;/li&gt;</span>
<span class="nt">&lt;/ul&gt;</span>
<span class="nt">&lt;/li&gt;</span>
...
<span class="nt">&lt;/ul&gt;</span>
...
<span class="nt">&lt;/div&gt;</span>
<span class="nt">&lt;/div&gt;</span>
</pre></div>
6 changes: 6 additions & 0 deletions foundation_theme_site/templates/includes/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h1>This is a test of the make file</h1>
<ul>
<li>test1</li>
<li>test2</li>
<li>funky3</li>
</ul>
40 changes: 27 additions & 13 deletions foundation_theme_site/templates/menu_howto.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,38 @@
{% block body %}

<h1>Drop-down Menu</h1>

<p>Anyone who has created drop-down menus will be familiar with the large quantities of scripting such menus typically require.
But, in this Pinax theme foundation we have done all of the work for you allowing you to focus on the more important part of the design.
<p>Pinax theme foundation provides a top menu bar we have done all of the work for you allowing you to focus on the more important part of the design.
This allows you to create visually appealing drop-downs that are easy to edit and update, and that work across a multitude of
browsers, including Internet Explorer. Better still, for code-wary designers, no JavaScript is required! (Actually, some
JavaScript is needed, but we already wrote it for you.)</p>

<h5> Location of the Menu</h5>
<p>Location of the Menu
To create a drop-down menu the code must be placed within the top-bar and attached div classes. Out of the box Pinax Theme Foundation
comes with one drop-down menu within the top-bar and attached div classes. To add another drop-down menu place the code below within the top-bar and attached div classes.
<h5>Creating the menu</h5>
<p>The first step is to create the menu structure itself. This is done by using an unordered list as the main menu bar, and each drop-down-menu appearing
Creating the menu
The first step is to create the menu structure itself. This is done by using an unordered list as the main menu bar, and each drop-down-menu appearing
as a list within its parent list item. Sound complicated? It’s actually very straightforward: </p>

<script src="https://gist.github.com/2654124.js"> </script>

The above code shows the drop-down menu code for "design patterns". It should be noted that the design pattern was added
<p>The above code shows the drop-down menu code for "design patterns". It should be noted that the design pattern was added
as a list item that contained a list of links. All that is required to define a dropdown menu in the topbar is to make
a list item tag with css class "has-dropdown" and a unordered list tag with css class "dropdown"

a list item tag with css class "has-dropdown" and a unordered list tag with css class "dropdown"</p>
<div class="codehilite"><pre><span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;top-bar&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;attached&quot;</span><span class="nt">&gt;</span>
...
<span class="nt">&lt;ul</span> <span class="na">class=</span><span class="s">&quot;right&quot;</span><span class="nt">&gt;</span>
...
<span class="nt">&lt;li</span> <span class="na">class=</span><span class="s">&quot;has-dropdown&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&quot;http://apps.raisedeyebrow.com/Design_Patterns/&quot;</span> <span class="na">target=</span><span class="s">&quot;_blank&quot;</span><span class="nt">&gt;</span>Design Patterns<span class="nt">&lt;/a&gt;</span>
<span class="nt">&lt;ul</span> <span class="na">class=</span><span class="s">&quot;dropdown&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;li&gt;&lt;a</span> <span class="na">href=</span><span class="s">&quot;/gallery_design/&quot;</span><span class="nt">&gt;&lt;span</span> <span class="na">class=</span><span class="s">&quot;glyph general&quot;</span><span class="nt">&gt;</span>a<span class="nt">&lt;/span&gt;</span>Gallery Design<span class="nt">&lt;/a&gt;&lt;/li&gt;</span>
<span class="nt">&lt;li&gt;&lt;a</span> <span class="na">href=</span><span class="s">&quot;/featured_shuffle/&quot;</span><span class="nt">&gt;&lt;span</span> <span class="na">class=</span><span class="s">&quot;glyph general&quot;</span><span class="nt">&gt;</span>b<span class="nt">&lt;/span&gt;</span>Featured Shuffle<span class="nt">&lt;/a&gt;&lt;/li&gt;</span>
<span class="nt">&lt;li&gt;&lt;a</span> <span class="na">href=</span><span class="s">&quot;/featured_items/&quot;</span><span class="nt">&gt;&lt;span</span> <span class="na">class=</span><span class="s">&quot;glyph general&quot;</span><span class="nt">&gt;</span>i<span class="nt">&lt;/span&gt;</span>Featured Items<span class="nt">&lt;/a&gt;&lt;/li&gt;</span>
<span class="nt">&lt;li&gt;&lt;a</span> <span class="na">href=</span><span class="s">&quot;/column_flip/&quot;</span><span class="nt">&gt;&lt;span</span> <span class="na">class=</span><span class="s">&quot;glyph general&quot;</span><span class="nt">&gt;</span>c<span class="nt">&lt;/span&gt;</span>Column Flip<span class="nt">&lt;/a&gt;&lt;/li&gt;</span>
<span class="nt">&lt;li&gt;&lt;a</span> <span class="na">href=</span><span class="s">&quot;/mondrian/&quot;</span><span class="nt">&gt;&lt;span</span> <span class="na">class=</span><span class="s">&quot;glyph general&quot;</span><span class="nt">&gt;</span>d<span class="nt">&lt;/span&gt;</span>Mondrian<span class="nt">&lt;/a&gt;&lt;/li&gt;</span>
<span class="nt">&lt;/ul&gt;</span>
<span class="nt">&lt;/li&gt;</span>
...
<span class="nt">&lt;/ul&gt;</span>
...
<span class="nt">&lt;/div&gt;</span>
<span class="nt">&lt;/div&gt;</span>
</pre></div>
{% endblock %}
1 change: 1 addition & 0 deletions foundation_theme_site/templates/site_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{% block extra_style %}
<link rel="stylesheet" href="{{ STATIC_URL }}css/designs.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/site_styles.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/code_style.css">
{% endblock %}

{% block topbar_base %}
Expand Down

0 comments on commit 47f3ccf

Please sign in to comment.