Commits

Steve Losh committed e051cdc

Moar.

Comments (0)

Files changed (5)

bookmarkdown/bookmarkdown

     with open(target, 'w') as f:
         f.write(out)
 
+def _build_index_file():
+    source = 'introduction.markdown'
+
+    if not os.path.exists(source):
+        return
+
+    with open(source, 'r') as f:
+        content = markdown.markdown(f.read())
+
+    out = env.get_template('splash.html').render(content=content)
+    target = join('build', 'html', 'index.html')
+
+    with open(target, 'w') as f:
+        f.write(out)
+
 
 def _copy_static():
     import bookmarkdown as ugly_hack
 
     _copy_static()
 
+    _build_index_file()
     _build_html_file('acknowledgements', 'single')
     _build_html_file('license', 'single')
     _build_html_file('preface', 'single')

bookmarkdown/static/styles/style.less

 html {
     overflow-y: scroll;
 }
+html, body {
+    font: normal 16px/22px 'Palatino', 'Georgia', sans-serif;
+}
 
 header {
     margin-top: 30px;
+    margin-bottom: 30px;
     text-align: center;
 }
 footer {
+    margin-top: 30px;
     text-align: center;
     font-style: italic;
 }
+
+body.splash {
+    .toc {
+        margin-top: 30px;
+    }
+}

bookmarkdown/templates/base.html

         <script type="text/javascript" src="/static/scripts/less.js"></script>
     </head>
 
-    <body>
+    <body class="{% block class %}{% endblock %}">
         <div class="container">
             <header class="sixteen columns">
                 <h1>Book Title</h1>
             </header>
 
-            <section class="content">
-                {% block content %}{% endblock %}
-            </section>
+            {% block content_full %}
+                <section class="content">
+                    {% block content %}{% endblock %}
+                </section>
+            {% endblock %}
 
             <footer class="sixteen columns">
+                Made by <a href="{{ author_url }}">{{ author }} Jimmy the Cat</a>.
+
+                <a href="/license.html">License</a>.
+
+                <br/>
+
                 Built with
                 <a href="http://bitbucket.org/sjl/bookmarkdown/">Bookmarkdown</a>.
             </footer>

bookmarkdown/templates/splash.html

+{% extends "base.html" %}
+
+{% block class %}splash{% endblock %}
+
+{% block content_full %}
+    <section class="content twelve columns offset-by-two">
+        {{ content }}
+
+        <section class="toc">
+            <h2>Table of Contents</h2>
+
+            <ol>
+                <li><a href="/acknowledgements.html">Acknowledgements</a></li>
+                <li><a href="/preface.html">Preface</a></li>
+            </ol>
+        </section>
+    </section>
+{% endblock %}

sample/introduction.markdown

+This book is noms.