From f780ea927c32cf0fc72ab0e3f3fda1d4df644b29 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Sat, 8 Oct 2011 00:27:46 -0400 Subject: Redo appearance of top-level docs and pages. This is a fairly significant set of changes, aimed at improving the overall usability of the documentation. Add source/_templates/indexcontent.html, which is a Jinja template used to generate index.html. This mimics the Python docs' style of having a short, styled table as main index interface. We're doing this because people keep missing the board hardware pages that are below the fold. Hopefully this will make them (and other important pages) easier to find. The new file source/_static/index-style.css controls the presentation of the generated index.html. Move the contents of source/index.rst to source/contents.rst, and increase the toctree depths to 2. This increase has the ancillary benefit that secondary headers within the current page are displayed in the sidebar, which should aid navigation within the page. contents.rst is meant to be a contents in full, where users who know what they're looking for can go. The "Table of Contents" link on the sidebar points here. Add a new source/_static/leaflabs-docs.css. It's currently unused, but is the place where people should put CSS that wants to override the defaults. Modify source/_templates/layout.html to include aforementioned leaflabs-docs.css. Also tweak the behavior of the rootrellink block, which provides the breadcrumbs in page headers and footers. Change the titles of various top-level docs so they can be referenced from the toctrees in contents.rst directly. Having two names (one in the contents, one at the top of the page) has got to be confusing people. Make an exception for FAQ so that it appears in one line on the sidebar. Adjust conf.py to reflect all of these changes. Also: - Fix "Lucidia" -> "Lucida" typo - Get rid of intersphinx_mapping (we don't use it, and including it makes it impossible to build the docs offline). - Remove the logo from sidebar; it's big and ugly and serves no purpose. Signed-off-by: Marti Bolivar --- README | 7 ++- source/_static/index-style.css | 15 +++++ source/_static/leaflabs-docs.css | 1 + source/_templates/indexcontent.html | 112 ++++++++++++++++++++++++++++++++++++ source/_templates/layout.html | 10 +++- source/arm-gcc.rst | 4 +- source/conf.py | 12 ++-- source/contents.rst | 68 ++++++++++++++++++++++ source/ide.rst | 4 +- source/index.rst | 78 ------------------------- source/language.rst | 6 +- 11 files changed, 222 insertions(+), 95 deletions(-) create mode 100644 source/_static/index-style.css create mode 100644 source/_static/leaflabs-docs.css create mode 100644 source/_templates/indexcontent.html create mode 100644 source/contents.rst delete mode 100644 source/index.rst diff --git a/README b/README index 4cdf66f..f3839cd 100644 --- a/README +++ b/README @@ -110,9 +110,10 @@ Just point your web browser at the file build/html/index.html -It corresponds to the Sphinx file - - source/index.rst +For the most poart, the file build/html/foo.html is built from +source/foo.rst. (The index is an exception, because we needed to +hand-hack the HTML to get the "Contents at a Glance" section to look +nice). Read more about Sphinx and use the existing docs source as an example when writing yours. The directory tmpl/ contains template ReST files diff --git a/source/_static/index-style.css b/source/_static/index-style.css new file mode 100644 index 0000000..a0ef75c --- /dev/null +++ b/source/_static/index-style.css @@ -0,0 +1,15 @@ +/* Contents style */ + +.contents-table { + font-size: large; +} + +.contents-table ul, .contents-table li { + display: inline; +} + +.contents-table ul { + list-style-type: none; + margin: 0em; + padding-left: 0px; +} diff --git a/source/_static/leaflabs-docs.css b/source/_static/leaflabs-docs.css new file mode 100644 index 0000000..18f5bcc --- /dev/null +++ b/source/_static/leaflabs-docs.css @@ -0,0 +1 @@ +/* Any custom CSS you want applied goes here */ diff --git a/source/_templates/indexcontent.html b/source/_templates/indexcontent.html new file mode 100644 index 0000000..49e72b7 --- /dev/null +++ b/source/_templates/indexcontent.html @@ -0,0 +1,112 @@ +{# This file generates the top-level index.html file. We are very + obviously stealing from the Python docs's style ;). +#} + + +{% extends "layout.html" %} + + +{% set css_files = css_files + ["_static/index-style.css"] %} + + +{% set content_sep = "·" %} + + +{% block body %} +

Index

+ +Welcome! This is the documentation for the LeafLabs Maple boards, +version {{ release }}. + +

Read This First

+ +

Just getting started? Try the Quickstart. Having problems? Check +out Troubleshooting and +the FAQ. Can't find what you want +here? Look on the LeafLabs +wiki. +

+ +

Contents at a Glance

+ + + + + + + + + + +

Getting Started

+ +

Boards

+ +

Programming

+ +

Peripherals

+ +
+ +{% endblock %} diff --git a/source/_templates/layout.html b/source/_templates/layout.html index 4d92d33..2fd81ce 100644 --- a/source/_templates/layout.html +++ b/source/_templates/layout.html @@ -1,5 +1,11 @@ {% extends "!layout.html" %} + +{% set css_files = css_files + ["_static/leaflabs-docs.css"] %} + {% block rootrellink %} -
  • LeafLabs |
  • - {{ super() }} +
  • + + leaflabs.com + ·
  • +
  • {{ shorttitle }}{{ reldelim1 }}
  • {% endblock %} diff --git a/source/arm-gcc.rst b/source/arm-gcc.rst index 1d55d07..30667a2 100644 --- a/source/arm-gcc.rst +++ b/source/arm-gcc.rst @@ -1,8 +1,8 @@ .. _arm-gcc: -GCC for Maple -============= +GCC and libc +============ This document provides notes on using ``arm-none-eabi-gcc``, the `CodeSourcery `_ version of the GNU `GCC diff --git a/source/conf.py b/source/conf.py index 1e18f25..5b8f2d8 100644 --- a/source/conf.py +++ b/source/conf.py @@ -45,7 +45,7 @@ source_suffix = '.rst' #source_encoding = 'utf-8-sig' # The master toctree document. -master_doc = 'index' +master_doc = 'contents' # General information about the project. project = u'Maple' @@ -135,7 +135,7 @@ html_theme_options = { ## Font 'headfont' : 'Georgia', - 'bodyfont' : 'Lucidia' + 'bodyfont' : 'Lucida' } # Add any paths that contain custom themes here, relative to this directory. @@ -150,7 +150,7 @@ html_short_title = 'Index' # The name of an image file (relative to this directory) to place at the top # of the sidebar. -html_logo = '_static/img/round_logo_60x60.png' +# html_logo = '_static/img/round_logo_60x60.png' # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 @@ -177,7 +177,9 @@ html_sidebars = { # Additional templates that should be rendered to pages, maps page names to # template names. -#html_additional_pages = {} +html_additional_pages = { + 'index': 'indexcontent.html' +} # If false, no module index is generated. #html_domain_indices = True @@ -259,7 +261,7 @@ man_pages = [ # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'http://docs.python.org/': None} +#intersphinx_mapping = {'http://docs.python.org/': None} # -- Options for breathe integration ------------------------------------------ diff --git a/source/contents.rst b/source/contents.rst new file mode 100644 index 0000000..63aebee --- /dev/null +++ b/source/contents.rst @@ -0,0 +1,68 @@ +.. _index: + +Contents in Full +================ + +.. _index-usage: + +**Getting Started** + +.. toctree:: + :maxdepth: 2 + + maple-quickstart + maple-ide-install + ide + unix-toolchain + +.. _index-maple-programming: + +**Programming** + +.. toctree:: + :maxdepth: 2 + + language + libraries + arduino-compatibility + libmaple + bootloader + troubleshooting + FAQ + arm-gcc + language-index + +.. _index-hardware: + +**Peripherals** + +.. toctree:: + :maxdepth: 2 + + adc + external-interrupts + fsmc + gpio + i2c + jtag + pwm + spi + timers + systick + usb + usart + +.. _index-boards: + +**Boards** + +.. toctree:: + :maxdepth: 2 + + hardware/maple.rst + hardware/maple-ret6.rst + hardware/maple-mini.rst + hardware/maple-native-beta.rst + +.. TODO [Maple Native] write/include upon finished Native release +.. hardware/maple-native.rst diff --git a/source/ide.rst b/source/ide.rst index 6e36e47..e6d49fc 100644 --- a/source/ide.rst +++ b/source/ide.rst @@ -1,7 +1,7 @@ .. _ide: -Maple IDE -========= +Using Maple IDE +=============== This page documents the basic functionality of the Maple IDE. Specifically, it describes the operation of the buttons on the main diff --git a/source/index.rst b/source/index.rst deleted file mode 100644 index e8f0277..0000000 --- a/source/index.rst +++ /dev/null @@ -1,78 +0,0 @@ -.. _index: - -LeafLabs Documentation Index -============================ - -Welcome to the LeafLabs documentation! - -If you're setting up a board for the first time, try the -:ref:`quickstart `. If you're having problems, -check out the :ref:`troubleshooting ` and :ref:`FAQ -` pages. - -If you can't find what you're looking for here, try the `LeafLabs wiki -`_. - -.. _index-usage: - -**Usage Guides:** - -.. toctree:: - :maxdepth: 1 - - Quickstart - IDE Installation - IDE Usage - Command-Line Toolchain - -.. _index-maple-programming: - -**Maple Programming:** - -.. toctree:: - :maxdepth: 1 - - Language - Libraries - Arduino Compatibility - libmaple - Bootloader - Troubleshooting - FAQ - GCC and libc for Maple - Language Index - -.. _index-hardware: - -**Hardware Peripherals:** - -.. toctree:: - :maxdepth: 1 - - adc - external-interrupts - fsmc - gpio - i2c - jtag - pwm - spi - timers - systick - usb - usart - -.. _index-boards: - -**Board Hardware Documentation:** - -.. toctree:: - :maxdepth: 1 - - hardware/maple.rst - hardware/maple-ret6.rst - hardware/maple-mini.rst - hardware/maple-native-beta.rst - -.. TODO [Maple Native] write/include upon finished Native release -.. hardware/maple-native.rst diff --git a/source/language.rst b/source/language.rst index 1a8ef30..20827cc 100644 --- a/source/language.rst +++ b/source/language.rst @@ -2,9 +2,9 @@ .. _language: -========================== - Maple Language Reference -========================== +==================== + Language Reference +==================== The Maple can be programmed in the `Wiring `_ language, which is the same -- cgit v1.2.3