0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00
wagtail/docs
Matt Westcott dbc4c9b28e Adds the include_block template tag (#2786)
Update render and render_basic methods on Block to take a context kwarg

Update TableBlock to support passing extra context to render

Implement render_as_block on BoundBlock, StreamValue and StructValue.

Collectively, these are the objects encountered during template rendering which typically render
a block template when output inside {{ ... }} tags. Implementing render_as_block allows us to do
the same thing, but passing a template context as well.

Implement include_block tag

Support extra context vars on include_block via 'with foo=bar'

Support 'only' flag on include_block tag, to omit the parent context

Update StreamField documentation to cover the include_block tag

Rewrite 'BoundBlocks and values' docs based on the include_block tag

Add tests for blocks with legacy render / render_basic methods

Any bits of StreamField infrastructure that attempt to call render or render_basic
on a block with a 'context' kwarg, should (for now) also work on blocks that don't
accept the context kwarg, but output a RemovedInWagtail18Warning.

Explicitly test whether render / render_basic will accept a 'context' kwarg

This avoids unexpected behaviour when the method legitimately accepts a context
kwarg, but happens to throw an unrelated TypeError - in this situation, the final
output (or error diagnostics) will behave as if the context was never passed,
making debugging difficult. See https://github.com/torchbox/wagtail/pull/2786#discussion_r69563984
2016-07-06 17:44:02 +03:00
..
_static/images promote rich text link handling to a major feature 2016-05-19 17:01:17 +01:00
advanced_topics Documented the settings variable for WAGTAIL_USAGE_COUNT_ENABLED (#2706) 2016-06-13 20:47:27 +01:00
contributing Document isort and 'make lint' in Python coding guidelines 2016-06-23 16:31:44 +01:00
editor_manual Correcting typo int The Dashboard doc 2016-02-16 15:51:57 -05:00
getting_started add note about Wagtail <=1.4 syntax for search_fields 2016-05-02 18:42:21 +01:00
reference mention edit_handler in this context (#2716) 2016-06-15 13:54:54 +01:00
releases Adds the include_block template tag (#2786) 2016-07-06 17:44:02 +03:00
topics Adds the include_block template tag (#2786) 2016-07-06 17:44:02 +03:00
autobuild.sh
conf.py Call django.setup() before making docs 2015-12-09 11:40:35 +00:00
index.rst Moved advanced image topics into advanced topics 2016-01-27 11:27:16 +00:00
logo.png reduced size of logo 2015-07-07 14:41:41 +01:00
Makefile Added spellcheker 2015-04-17 22:49:16 +01:00
README.md Eliminate reference to requirements-dev.txt 2016-02-05 15:48:01 +00:00
requirements.txt Build documentation with Django 1.8 fixes #1451 2015-06-29 09:11:21 +01:00
spelling_wordlist.txt Spellchecked editing api docs 2015-05-18 10:44:07 +01:00
support.rst

Wagtail docs

These are Sphinx docs, automatically built at http://docs.wagtail.io when the master branch is committed to Github. To build them locally, install Wagtail's development requirements (in the root Wagtail directory):

pip install -e .[testing,docs]

To build the documentation for browsing, from this directory run:

make html 

then open _build/html/index.html in a browser.

To rebuild automatically while editing the documentation, from this directory run:

sphinx-autobuild . _build

The online editor at http://rst.ninjs.org/ is a helpful tool for checking reStructuredText syntax.