'
107 |
108 | # default format_spec
109 | assert str(Markup('{0:}').format(items['biu'])) == \
110 | 'Biu'
111 | assert str(Markup('{0:}').format(items['boom1'])) == \
112 | 'Boom'
113 |
114 | # invalid format_spec
115 | with raises(ValueError):
116 | str(Markup('{0:foo}').format(items['biu']))
117 |
118 |
119 | def test_html_representation_with_class(app):
120 | biu_with_class = Item(
121 | u'Biu', endpoint='biu.biu',
122 | html_attrs={'class': ['icon', 'icon-biu'], 'data-icon': 'biu'})
123 | boom_with_class = Item(
124 | u'Boom', endpoint='biu.boom', args={'num': 1},
125 | html_attrs={'class': ['icon', 'icon-boom'], 'data-icon': 'boom'})
126 |
127 | with app.test_client() as client:
128 | client.get('/biu/biu')
129 |
130 | assert str(Markup(biu_with_class)) == (
131 | 'Biu')
133 | assert str(Markup(boom_with_class)) == (
134 | 'Boom')
136 |
--------------------------------------------------------------------------------
/docs/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line.
5 | SPHINXOPTS =
6 | SPHINXBUILD = sphinx-build
7 | PAPER =
8 | BUILDDIR = _build
9 |
10 | # User-friendly check for sphinx-build
11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
13 | endif
14 |
15 | # Internal variables.
16 | PAPEROPT_a4 = -D latex_paper_size=a4
17 | PAPEROPT_letter = -D latex_paper_size=letter
18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
19 | # the i18n builder cannot share the environment and doctrees with the others
20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
21 |
22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
23 |
24 | help:
25 | @echo "Please use \`make ' where is one of"
26 | @echo " html to make standalone HTML files"
27 | @echo " dirhtml to make HTML files named index.html in directories"
28 | @echo " singlehtml to make a single large HTML file"
29 | @echo " pickle to make pickle files"
30 | @echo " json to make JSON files"
31 | @echo " htmlhelp to make HTML files and a HTML help project"
32 | @echo " qthelp to make HTML files and a qthelp project"
33 | @echo " devhelp to make HTML files and a Devhelp project"
34 | @echo " epub to make an epub"
35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
36 | @echo " latexpdf to make LaTeX files and run them through pdflatex"
37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
38 | @echo " text to make text files"
39 | @echo " man to make manual pages"
40 | @echo " texinfo to make Texinfo files"
41 | @echo " info to make Texinfo files and run them through makeinfo"
42 | @echo " gettext to make PO message catalogs"
43 | @echo " changes to make an overview of all changed/added/deprecated items"
44 | @echo " xml to make Docutils-native XML files"
45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes"
46 | @echo " linkcheck to check all external links for integrity"
47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)"
48 |
49 | clean:
50 | rm -rf $(BUILDDIR)/*
51 |
52 | html:
53 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
54 | @echo
55 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
56 |
57 | dirhtml:
58 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
59 | @echo
60 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
61 |
62 | singlehtml:
63 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
64 | @echo
65 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
66 |
67 | pickle:
68 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
69 | @echo
70 | @echo "Build finished; now you can process the pickle files."
71 |
72 | json:
73 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
74 | @echo
75 | @echo "Build finished; now you can process the JSON files."
76 |
77 | htmlhelp:
78 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
79 | @echo
80 | @echo "Build finished; now you can run HTML Help Workshop with the" \
81 | ".hhp project file in $(BUILDDIR)/htmlhelp."
82 |
83 | qthelp:
84 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
85 | @echo
86 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \
87 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
88 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/FlaskNavigation.qhcp"
89 | @echo "To view the help file:"
90 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/FlaskNavigation.qhc"
91 |
92 | devhelp:
93 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
94 | @echo
95 | @echo "Build finished."
96 | @echo "To view the help file:"
97 | @echo "# mkdir -p $$HOME/.local/share/devhelp/FlaskNavigation"
98 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/FlaskNavigation"
99 | @echo "# devhelp"
100 |
101 | epub:
102 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
103 | @echo
104 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
105 |
106 | latex:
107 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
108 | @echo
109 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
110 | @echo "Run \`make' in that directory to run these through (pdf)latex" \
111 | "(use \`make latexpdf' here to do that automatically)."
112 |
113 | latexpdf:
114 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
115 | @echo "Running LaTeX files through pdflatex..."
116 | $(MAKE) -C $(BUILDDIR)/latex all-pdf
117 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
118 |
119 | latexpdfja:
120 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
121 | @echo "Running LaTeX files through platex and dvipdfmx..."
122 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
123 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
124 |
125 | text:
126 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
127 | @echo
128 | @echo "Build finished. The text files are in $(BUILDDIR)/text."
129 |
130 | man:
131 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
132 | @echo
133 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
134 |
135 | texinfo:
136 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
137 | @echo
138 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
139 | @echo "Run \`make' in that directory to run these through makeinfo" \
140 | "(use \`make info' here to do that automatically)."
141 |
142 | info:
143 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
144 | @echo "Running Texinfo files through makeinfo..."
145 | make -C $(BUILDDIR)/texinfo info
146 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
147 |
148 | gettext:
149 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
150 | @echo
151 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
152 |
153 | changes:
154 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
155 | @echo
156 | @echo "The overview file is in $(BUILDDIR)/changes."
157 |
158 | linkcheck:
159 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
160 | @echo
161 | @echo "Link check complete; look for any errors in the above output " \
162 | "or in $(BUILDDIR)/linkcheck/output.txt."
163 |
164 | doctest:
165 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
166 | @echo "Testing of doctests in the sources finished, look at the " \
167 | "results in $(BUILDDIR)/doctest/output.txt."
168 |
169 | xml:
170 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
171 | @echo
172 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
173 |
174 | pseudoxml:
175 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
176 | @echo
177 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
178 |
--------------------------------------------------------------------------------
/flask_navigation/item.py:
--------------------------------------------------------------------------------
1 | import collections
2 |
3 | from flask import url_for, request, Markup
4 |
5 | from .utils import freeze_dict, join_html_attrs
6 |
7 |
8 | class Item(object):
9 | """The navigation item object.
10 |
11 | :param label: the display label of this navigation item.
12 | :param endpoint: the unique name of this navigation item.
13 | If this item point to a internal url, this parameter
14 | should be acceptable for ``url_for`` which will generate
15 | the target url.
16 | :param args: optional. If this parameter be provided, it will be passed to
17 | the ``url_for`` with ``endpoint`` together.
18 | Maybe this arguments need to be decided in the Flask app
19 | context, then this parameter could be a function to delay the
20 | execution.
21 | :param url: optional. If this parameter be provided, the target url of
22 | this navigation will be it. The ``endpoint`` and ``args`` will
23 | not been used to generate url.
24 | :param html_attrs: optional. This :class:`dict` will be used for
25 | representing html.
26 |
27 | The ``endpoint`` is the identity name of this navigation item. It will be
28 | unique in whole application. In mostly situation, it should be a endpoint
29 | name of a Flask view function.
30 | """
31 |
32 | def __init__(self, label, endpoint, args=None, url=None, html_attrs=None,
33 | items=None):
34 | self.label = label
35 | self.endpoint = endpoint
36 | self._args = args
37 | self._url = url
38 | self.html_attrs = {} if html_attrs is None else html_attrs
39 | self.items = ItemCollection(items or None)
40 |
41 | def __html__(self):
42 | attrs = dict(self.html_attrs)
43 |
44 | # adds ``active`` to class list
45 | html_class = attrs.get('class', [])
46 | if self.is_active:
47 | html_class.append('active')
48 |
49 | # joins class list
50 | attrs['class'] = ' '.join(html_class)
51 | if not attrs['class']:
52 | del attrs['class']
53 | attrs['href'] = self.url
54 | attrs_template, attrs_values = join_html_attrs(attrs)
55 |
56 | return Markup('{label}' % attrs_template).format(
57 | *attrs_values, label=self.label)
58 |
59 | def __html_format__(self, format_spec):
60 | if format_spec == 'li':
61 | li_attrs = Markup(' class="active"') if self.is_active else ''
62 | return Markup('
{1}
').format(li_attrs, self.__html__())
63 | elif format_spec:
64 | raise ValueError('Invalid format spec')
65 | return self.__html__()
66 |
67 | @property
68 | def args(self):
69 | """The arguments which will be passed to ``url_for``.
70 |
71 | :type: :class:`dict`
72 | """
73 | if self._args is None:
74 | return {}
75 | if callable(self._args):
76 | return dict(self._args())
77 | return dict(self._args)
78 |
79 | @property
80 | def url(self):
81 | """The final url of this navigation item.
82 |
83 | By default, the value is generated by the :attr:`self.endpoint` and
84 | :attr:`self.args`.
85 |
86 | .. note::
87 |
88 | The :attr:`url` property require the app context without a provided
89 | config value :const:`SERVER_NAME`, because of :func:`flask.url_for`.
90 |
91 | :type: :class:`str`
92 | """
93 | if self.is_internal:
94 | return url_for(self.endpoint, **self.args)
95 | return self._url
96 |
97 | @property
98 | def is_active(self):
99 | """``True`` if the item should be presented as active, and ``False``
100 | always if the request context is not bound.
101 | """
102 | return bool(request and self.is_current)
103 |
104 | @property
105 | def is_internal(self):
106 | """``True`` if the target url is internal of current app."""
107 | return self._url is None
108 |
109 | @property
110 | def is_current(self):
111 | """``True`` if current request has same endpoint with the item.
112 |
113 | The property should be used in a bound request context, or the
114 | :class:`RuntimeError` may be raised.
115 | """
116 | if not self.is_internal:
117 | return False # always false for external url
118 | has_same_endpoint = (request.endpoint == self.endpoint)
119 | has_same_args = (request.view_args == self.args)
120 | return has_same_endpoint and has_same_args # matches the endpoint
121 |
122 | @property
123 | def ident(self):
124 | """The identity of this item.
125 |
126 | :type: :class:`~flask.ext.navigation.Navigation.ItemReference`
127 | """
128 | return ItemReference(self.endpoint, self.args)
129 |
130 |
131 | class ItemCollection(collections.MutableSequence,
132 | collections.Iterable):
133 | """The collection of navigation items.
134 |
135 | This collection is a mutable sequence. All items have order index, and
136 | could be found by its endpoint name. e.g.::
137 |
138 | c = ItemCollection()
139 | c.append(Item(endpoint='doge'))
140 |
141 | print(c['doge']) # output: Item(endpoint='doge')
142 | print(c[0]) # output: Item(endpoint='doge')
143 | print(c) # output: ItemCollection([Item(endpoint='doge')])
144 | print(len(c)) # output: 1
145 |
146 | c.append(Item(endpoint='lumpy', args={'num': 4}))
147 |
148 | print(c[1]) # output: Item(endpoint='lumpy', args={'num': 4})
149 | assert c['lumpy', {'num': 4}] is c[1]
150 | """
151 |
152 | def __init__(self, iterable=None):
153 | #: the item collection
154 | self._items = []
155 | #: the mapping collection of endpoint -> item
156 | self._items_mapping = {}
157 | #: initial extending
158 | self.extend(iterable or [])
159 |
160 | def __repr__(self):
161 | return 'ItemCollection(%r)' % self._items
162 |
163 | def __getitem__(self, index):
164 | if isinstance(index, int):
165 | return self._items[index]
166 |
167 | if isinstance(index, tuple):
168 | endpoint, args = index
169 | else:
170 | endpoint, args = index, {}
171 | ident = ItemReference(endpoint, args)
172 | return self._items_mapping[ident]
173 |
174 | def __setitem__(self, index, item):
175 | # remove the old reference
176 | old_item = self._items[index]
177 | del self._items_mapping[old_item.ident]
178 |
179 | self._items[index] = item
180 | self._items_mapping[item.ident] = item
181 |
182 | def __delitem__(self, index):
183 | item = self[index]
184 | del self._items[index]
185 | del self._items_mapping[item.ident]
186 |
187 | def __len__(self):
188 | return len(self._items)
189 |
190 | def __iter__(self):
191 | return iter(self._items)
192 |
193 | def insert(self, index, item):
194 | self._items.insert(index, item)
195 | self._items_mapping[item.ident] = item
196 |
197 |
198 | class ItemReference(collections.namedtuple('ItemReference', 'endpoint args')):
199 | """The identity tuple of navigation item.
200 |
201 | :param endpoint: the endpoint of view function.
202 | :type endpoint: ``str``
203 | :param args: the arguments of view function.
204 | :type args: ``dict``
205 | """
206 |
207 | def __new__(cls, endpoint, args=()):
208 | if isinstance(args, dict):
209 | args = freeze_dict(args)
210 | return super(cls, ItemReference).__new__(cls, endpoint, args)
211 |
--------------------------------------------------------------------------------
/docs/conf.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #
3 | # Flask Navigation documentation build configuration file, created by
4 | # sphinx-quickstart on Mon Apr 14 01:10:02 2014.
5 | #
6 | # This file is execfile()d with the current directory set to its
7 | # containing dir.
8 | #
9 | # Note that not all possible configuration values are present in this
10 | # autogenerated file.
11 | #
12 | # All configuration values have a default; values that are commented out
13 | # serve to show the default.
14 |
15 | # -- General configuration ------------------------------------------------
16 |
17 | # If your documentation needs a minimal Sphinx version, state it here.
18 | #needs_sphinx = '1.0'
19 |
20 | # Add any Sphinx extension module names here, as strings. They can be
21 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
22 | # ones.
23 | extensions = [
24 | 'sphinx.ext.autodoc',
25 | 'sphinx.ext.intersphinx',
26 | ]
27 |
28 | # Add any paths that contain templates here, relative to this directory.
29 | templates_path = ['_templates']
30 |
31 | # The suffix of source filenames.
32 | source_suffix = '.rst'
33 |
34 | # The encoding of source files.
35 | #source_encoding = 'utf-8-sig'
36 |
37 | # The master toctree document.
38 | master_doc = 'index'
39 |
40 | # General information about the project.
41 | project = u'Flask Navigation'
42 | copyright = u'2014, Jiangge Zhang'
43 |
44 | # The version info for the project you're documenting, acts as replacement for
45 | # |version| and |release|, also used in various other places throughout the
46 | # built documents.
47 | #
48 | # The short X.Y version.
49 | version = '0.2.0'
50 | # The full version, including alpha/beta/rc tags.
51 | release = '0.2.0'
52 |
53 | # The language for content autogenerated by Sphinx. Refer to documentation
54 | # for a list of supported languages.
55 | #language = None
56 |
57 | # There are two options for replacing |today|: either, you set today to some
58 | # non-false value, then it is used:
59 | #today = ''
60 | # Else, today_fmt is used as the format for a strftime call.
61 | #today_fmt = '%B %d, %Y'
62 |
63 | # List of patterns, relative to source directory, that match files and
64 | # directories to ignore when looking for source files.
65 | exclude_patterns = ['_build']
66 |
67 | # The reST default role (used for this markup: `text`) to use for all
68 | # documents.
69 | #default_role = None
70 |
71 | # If true, '()' will be appended to :func: etc. cross-reference text.
72 | #add_function_parentheses = True
73 |
74 | # If true, the current module name will be prepended to all description
75 | # unit titles (such as .. function::).
76 | #add_module_names = True
77 |
78 | # If true, sectionauthor and moduleauthor directives will be shown in the
79 | # output. They are ignored by default.
80 | #show_authors = False
81 |
82 | # The name of the Pygments (syntax highlighting) style to use.
83 | #pygments_style = 'sphinx'
84 |
85 | # A list of ignored prefixes for module index sorting.
86 | #modindex_common_prefix = []
87 |
88 | # If true, keep warnings as "system message" paragraphs in the built documents.
89 | #keep_warnings = False
90 |
91 |
92 | # -- Options for HTML output ----------------------------------------------
93 |
94 | # The theme to use for HTML and HTML Help pages. See the documentation for
95 | # a list of builtin themes.
96 | html_theme = 'kr_small'
97 |
98 | # Theme options are theme-specific and customize the look and feel of a theme
99 | # further. For a list of options available for each theme, see the
100 | # documentation.
101 | html_theme_options = {
102 | 'github_fork': 'tonyseek/flask-navigation',
103 | 'github_fork_ribbon': 'http://aral.github.com/fork-me-on-github-retina-ribbons/right-grey@2x.png',
104 | 'index_logo': 'index-logo@2x.png',
105 | 'index_logo_width': '340px',
106 | 'index_logo_height': '50px',
107 | }
108 |
109 | # Add any paths that contain custom themes here, relative to this directory.
110 | #html_theme_path = []
111 |
112 | # The name for this set of Sphinx documents. If None, it defaults to
113 | # " v documentation".
114 | #html_title = None
115 |
116 | # A shorter title for the navigation bar. Default is the same as html_title.
117 | #html_short_title = None
118 |
119 | # The name of an image file (relative to this directory) to place at the top
120 | # of the sidebar.
121 | #html_logo = None
122 |
123 | # The name of an image file (within the static path) to use as favicon of the
124 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
125 | # pixels large.
126 | #html_favicon = None
127 |
128 | # Add any paths that contain custom static files (such as style sheets) here,
129 | # relative to this directory. They are copied after the builtin static files,
130 | # so a file named "default.css" will overwrite the builtin "default.css".
131 | html_static_path = ['_static']
132 |
133 | # Add any extra paths that contain custom files (such as robots.txt or
134 | # .htaccess) here, relative to this directory. These files are copied
135 | # directly to the root of the documentation.
136 | #html_extra_path = []
137 |
138 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
139 | # using the given strftime format.
140 | #html_last_updated_fmt = '%b %d, %Y'
141 |
142 | # If true, SmartyPants will be used to convert quotes and dashes to
143 | # typographically correct entities.
144 | #html_use_smartypants = True
145 |
146 | # Custom sidebar templates, maps document names to template names.
147 | #html_sidebars = {}
148 |
149 | # Additional templates that should be rendered to pages, maps page names to
150 | # template names.
151 | #html_additional_pages = {}
152 |
153 | # If false, no module index is generated.
154 | #html_domain_indices = True
155 |
156 | # If false, no index is generated.
157 | #html_use_index = True
158 |
159 | # If true, the index is split into individual pages for each letter.
160 | #html_split_index = False
161 |
162 | # If true, links to the reST sources are added to the pages.
163 | #html_show_sourcelink = True
164 |
165 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
166 | #html_show_sphinx = True
167 |
168 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
169 | #html_show_copyright = True
170 |
171 | # If true, an OpenSearch description file will be output, and all pages will
172 | # contain a tag referring to it. The value of this option must be the
173 | # base URL from which the finished HTML is served.
174 | #html_use_opensearch = ''
175 |
176 | # This is the file name suffix for HTML files (e.g. ".xhtml").
177 | #html_file_suffix = None
178 |
179 | # Output file base name for HTML help builder.
180 | htmlhelp_basename = 'FlaskNavigationdoc'
181 |
182 |
183 | # -- Options for LaTeX output ---------------------------------------------
184 |
185 | latex_elements = {
186 | # The paper size ('letterpaper' or 'a4paper').
187 | #'papersize': 'letterpaper',
188 |
189 | # The font size ('10pt', '11pt' or '12pt').
190 | #'pointsize': '10pt',
191 |
192 | # Additional stuff for the LaTeX preamble.
193 | #'preamble': '',
194 | }
195 |
196 | # Grouping the document tree into LaTeX files. List of tuples
197 | # (source start file, target name, title,
198 | # author, documentclass [howto, manual, or own class]).
199 | latex_documents = [
200 | ('index', 'FlaskNavigation.tex', u'Flask Navigation Documentation',
201 | u'Jiangge Zhang', 'manual'),
202 | ]
203 |
204 | # The name of an image file (relative to this directory) to place at the top of
205 | # the title page.
206 | #latex_logo = None
207 |
208 | # For "manual" documents, if this is true, then toplevel headings are parts,
209 | # not chapters.
210 | #latex_use_parts = False
211 |
212 | # If true, show page references after internal links.
213 | #latex_show_pagerefs = False
214 |
215 | # If true, show URL addresses after external links.
216 | #latex_show_urls = False
217 |
218 | # Documents to append as an appendix to all manuals.
219 | #latex_appendices = []
220 |
221 | # If false, no module index is generated.
222 | #latex_domain_indices = True
223 |
224 |
225 | # -- Options for manual page output ---------------------------------------
226 |
227 | # One entry per manual page. List of tuples
228 | # (source start file, name, description, authors, manual section).
229 | man_pages = [
230 | ('index', 'flasknavigation', u'Flask Navigation Documentation',
231 | [u'Jiangge Zhang'], 1)
232 | ]
233 |
234 | # If true, show URL addresses after external links.
235 | #man_show_urls = False
236 |
237 |
238 | # -- Options for Texinfo output -------------------------------------------
239 |
240 | # Grouping the document tree into Texinfo files. List of tuples
241 | # (source start file, target name, title, author,
242 | # dir menu entry, description, category)
243 | texinfo_documents = [
244 | ('index', 'FlaskNavigation', u'Flask Navigation Documentation',
245 | u'Jiangge Zhang', 'FlaskNavigation', 'One line description of project.',
246 | 'Miscellaneous'),
247 | ]
248 |
249 | # Documents to append as an appendix to all manuals.
250 | #texinfo_appendices = []
251 |
252 | # If false, no module index is generated.
253 | #texinfo_domain_indices = True
254 |
255 | # How to display URL addresses: 'footnote', 'no', or 'inline'.
256 | #texinfo_show_urls = 'footnote'
257 |
258 | # If true, do not generate a @detailmenu in the "Top" node's menu.
259 | #texinfo_no_detailmenu = False
260 |
261 |
262 | # -- Options for Epub output ----------------------------------------------
263 |
264 | # Bibliographic Dublin Core info.
265 | epub_title = u'Flask Navigation'
266 | epub_author = u'Jiangge Zhang'
267 | epub_publisher = u'Jiangge Zhang'
268 | epub_copyright = u'2014, Jiangge Zhang'
269 |
270 | # The basename for the epub file. It defaults to the project name.
271 | #epub_basename = u'Flask Navigation'
272 |
273 | # The HTML theme for the epub output. Since the default themes are not optimized
274 | # for small screen space, using the same theme for HTML and epub output is
275 | # usually not wise. This defaults to 'epub', a theme designed to save visual
276 | # space.
277 | #epub_theme = 'epub'
278 |
279 | # The language of the text. It defaults to the language option
280 | # or en if the language is not set.
281 | #epub_language = ''
282 |
283 | # The scheme of the identifier. Typical schemes are ISBN or URL.
284 | #epub_scheme = ''
285 |
286 | # The unique identifier of the text. This can be a ISBN number
287 | # or the project homepage.
288 | #epub_identifier = ''
289 |
290 | # A unique identification for the text.
291 | #epub_uid = ''
292 |
293 | # A tuple containing the cover image and cover page html template filenames.
294 | #epub_cover = ()
295 |
296 | # A sequence of (type, uri, title) tuples for the guide element of content.opf.
297 | #epub_guide = ()
298 |
299 | # HTML files that should be inserted before the pages created by sphinx.
300 | # The format is a list of tuples containing the path and title.
301 | #epub_pre_files = []
302 |
303 | # HTML files shat should be inserted after the pages created by sphinx.
304 | # The format is a list of tuples containing the path and title.
305 | #epub_post_files = []
306 |
307 | # A list of files that should not be packed into the epub file.
308 | epub_exclude_files = ['search.html']
309 |
310 | # The depth of the table of contents in toc.ncx.
311 | #epub_tocdepth = 3
312 |
313 | # Allow duplicate toc entries.
314 | #epub_tocdup = True
315 |
316 | # Choose between 'default' and 'includehidden'.
317 | #epub_tocscope = 'default'
318 |
319 | # Fix unsupported image types using the PIL.
320 | #epub_fix_images = False
321 |
322 | # Scale large images.
323 | #epub_max_image_width = 0
324 |
325 | # How to display URL addresses: 'footnote', 'no', or 'inline'.
326 | #epub_show_urls = 'inline'
327 |
328 | # If false, no index is generated.
329 | #epub_use_index = True
330 |
331 |
332 | # Example configuration for intersphinx: refer to the Python standard library.
333 | intersphinx_mapping = {
334 | 'http://docs.python.org/': None,
335 | 'http://flask.pocoo.org/docs/': None,
336 | }
337 |
--------------------------------------------------------------------------------