diff --git a/docs/range.rst b/docs/arrays.rst similarity index 72% rename from docs/range.rst rename to docs/arrays.rst index 3abeebb..6c33fe1 100644 --- a/docs/range.rst +++ b/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. diff --git a/docs/conf.py b/docs/conf.py index 177f990..ba3c1a1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,6 +14,7 @@ import sys import os +import sphinx_rtd_theme # 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 @@ -92,6 +93,7 @@ exclude_patterns = ['_build'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' +highlight_language = 'ruby' # A list of ignored prefixes for module index sorting. #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 # 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 # further. For a list of options available for each theme, see the @@ -115,7 +117,7 @@ html_theme = 'default' #html_theme_options = {} # 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 # " v documentation". diff --git a/docs/dsl/background.rst b/docs/dsl/background.rst index a6721e0..aa58897 100644 --- a/docs/dsl/background.rst +++ b/docs/dsl/background.rst @@ -8,12 +8,14 @@ Support Arrays, see {file:README.md#Arrays_and_Singleton_Expansion Arrays and Si Options ^^^^^^^ 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 - [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 diff --git a/docs/dsl/index.rst b/docs/dsl/index.rst index b25d453..c9d08bd 100644 --- a/docs/dsl/index.rst +++ b/docs/dsl/index.rst @@ -1,5 +1,5 @@ DSL Reference -=========== +============= .. toctree:: :maxdepth: 1 diff --git a/docs/index.rst b/docs/index.rst index 00f0180..c6aabc0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,7 +10,7 @@ Contents: learning parameters - range + arrays units colors dsl/index.rst @@ -19,5 +19,4 @@ Indices and tables ================== * :ref:`genindex` -* :ref:`modindex` * :ref:`search` diff --git a/docs/parameters.rst b/docs/parameters.rst index 515fd57..15ff4d7 100644 --- a/docs/parameters.rst +++ b/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. +.. highlight:: none + 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)