Browse Source

Working out cross-reference conventions

dev
Andy Meneely 10 years ago
parent
commit
0b63af6ba3
  1. 12
      docs/arrays.rst
  2. 6
      docs/conf.py
  3. 8
      docs/dsl/background.rst
  4. 2
      docs/dsl/index.rst
  5. 3
      docs/index.rst
  6. 2
      docs/parameters.rst

12
docs/range.rst → docs/arrays.rst

@ -1,5 +1,13 @@
Specifying Ranges Squib Thinks in Arrays
================= ======================
.. _using_ranges:
Using ``range``
---------------
There's another way to limit a method to certain cards: the ``range`` parameter.
Most of Squib's DSL methods allow a `range` to be specified as a first parameter. This parameter is used to access an internal `Array` of `Squib::Cards`. This can be an actual Ruby range, or anything that implements `#each` (thus can be an `Enumerable`). Integers are also supported for changing one card only. Negatives work from the back of the deck. Most of Squib's DSL methods allow a `range` to be specified as a first parameter. This parameter is used to access an internal `Array` of `Squib::Cards`. This can be an actual Ruby range, or anything that implements `#each` (thus can be an `Enumerable`). Integers are also supported for changing one card only. Negatives work from the back of the deck.

6
docs/conf.py

@ -14,6 +14,7 @@
import sys import sys
import os import os
import sphinx_rtd_theme
# If extensions (or modules to document with autodoc) are in another directory, # If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the # add these directories to sys.path here. If the directory is relative to the
@ -92,6 +93,7 @@ exclude_patterns = ['_build']
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx' pygments_style = 'sphinx'
highlight_language = 'ruby'
# A list of ignored prefixes for module index sorting. # A list of ignored prefixes for module index sorting.
#modindex_common_prefix = [] #modindex_common_prefix = []
@ -107,7 +109,7 @@ todo_include_todos = False
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
html_theme = 'default' html_theme = 'sphinx_rtd_theme' # https://github.com/snide/sphinx_rtd_theme
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the # further. For a list of options available for each theme, see the
@ -115,7 +117,7 @@ html_theme = 'default'
#html_theme_options = {} #html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory. # Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = [] html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# The name for this set of Sphinx documents. If None, it defaults to # The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation". # "<project> v<release> documentation".

8
docs/dsl/background.rst

@ -8,12 +8,14 @@ Support Arrays, see {file:README.md#Arrays_and_Singleton_Expansion Arrays and Si
Options Options
^^^^^^^ ^^^^^^^
range range
default: *:all* default: ``:all``
the range of cards over which this will be rendered. See :doc:`range` the range of cards over which this will be rendered. See :ref:`using_ranges`
color color
[String] (:black) the color the font will render to. See {file:README.md#Specifying_Colors___Gradients Specifying Colors & Gradients}. default: ``:black`` . See :doc:`/colors`
the color to fill the background with.
Examples Examples

2
docs/dsl/index.rst

@ -1,5 +1,5 @@
DSL Reference DSL Reference
=========== =============
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1

3
docs/index.rst

@ -10,7 +10,7 @@ Contents:
learning learning
parameters parameters
range arrays
units units
colors colors
dsl/index.rst dsl/index.rst
@ -19,5 +19,4 @@ Indices and tables
================== ==================
* :ref:`genindex` * :ref:`genindex`
* :ref:`modindex`
* :ref:`search` * :ref:`search`

2
docs/parameters.rst

@ -5,6 +5,8 @@ Squib is all about sane defaults and shorthand specification. Arguments to DSL m
For example `x` and `y` default to 0 (i.e. the upper-left corner of the card). Any parameter that is specified in the command overrides any Squib defaults, `config.yml` settings, or layout rules. For example `x` and `y` default to 0 (i.e. the upper-left corner of the card). Any parameter that is specified in the command overrides any Squib defaults, `config.yml` settings, or layout rules.
.. highlight:: none
Note: you MUST use named parameters rather than positional parameters. For example: ``save :png`` will lead to an error like this:: Note: you MUST use named parameters rather than positional parameters. For example: ``save :png`` will lead to an error like this::
C:/Ruby200/lib/ruby/gems/2.0.0/gems/squib-0.0.3/lib/squib/api/save.rb:12:in `save': wrong number of arguments (2 for 0..1) (ArgumentError) C:/Ruby200/lib/ruby/gems/2.0.0/gems/squib-0.0.3/lib/squib/api/save.rb:12:in `save': wrong number of arguments (2 for 0..1) (ArgumentError)

Loading…
Cancel
Save