diff --git a/docs/api/build/artifact/index.html b/docs/api/build/artifact/index.html index f42e9388..64215f77 100644 --- a/docs/api/build/artifact/index.html +++ b/docs/api/build/artifact/index.html @@ -196,7 +196,7 @@ instances.
The most important function of an artifact is open which can open the artifact for reading or writing. If the build goes well, Lektor will commit those changes and persist them.
-ctx = get_ctx()
+Example
ctx = get_ctx()
@ctx.sub_artifact('artifact.txt')
def build_stylesheet(artifact):
with artifact.open('w') as f:
diff --git a/docs/api/build/artifact/open/index.html b/docs/api/build/artifact/open/index.html
index 57e4fda4..b851bc45 100644
--- a/docs/api/build/artifact/open/index.html
+++ b/docs/api/build/artifact/open/index.html
@@ -196,7 +196,7 @@ automatically is created. This can be disabled or enabled with the
If the artifact is opened for writing, a copy will be created and only
committed when the entire build process goes through smoothly and the
changes are committed by the builder.
-Example
ctx = get_ctx()
+Example
ctx = get_ctx()
@ctx.sub_artifact('artifact.txt')
def build_stylesheet(artifact):
with artifact.open('w') as f:
diff --git a/docs/api/build/artifact/render-template-into/index.html b/docs/api/build/artifact/render-template-into/index.html
index 45eec558..346d88c9 100644
--- a/docs/api/build/artifact/render-template-into/index.html
+++ b/docs/api/build/artifact/render-template-into/index.html
@@ -194,7 +194,7 @@ catch the error and render it into the template with a failure marker. This
can be changed with the fail
parameter. This is similar to the behavior of
the render_template method of the
environment.
-Example
class MyBuildProgram(BuildProgram):
+Example
class MyBuildProgram(BuildProgram):
...
def build_artifact(self, artifact):
diff --git a/docs/api/build/artifact/replace-with-file/index.html b/docs/api/build/artifact/replace-with-file/index.html
index be117e38..f505dd58 100644
--- a/docs/api/build/artifact/replace-with-file/index.html
+++ b/docs/api/build/artifact/replace-with-file/index.html
@@ -193,7 +193,7 @@
on commit. This is useful when you are dealing with external applications
that create temporaries. By default the file is moved as this is what's
common with temporaries but this can be changed into a copy with copy=True
.
-Example
ctx = get_ctx()
+Example
ctx = get_ctx()
@ctx.sub_artifact('artifact.txt')
def build_stylesheet(artifact):
temporary_file = invoke_external_program()
diff --git a/docs/api/build/context/changed-base-url/index.html b/docs/api/build/context/changed-base-url/index.html
index 6fc274eb..38830f3f 100644
--- a/docs/api/build/context/changed-base-url/index.html
+++ b/docs/api/build/context/changed-base-url/index.html
@@ -199,7 +199,7 @@
but in some cases this can lead to issues when plugins attempt more complex
operations. In these cases the base URL can temporarily be overridden
with this method.
-Example
with get_ctx().changed_base_url('/downloads/'):
+Example
with get_ctx().changed_base_url('/downloads/'):
url = url_to('/')
diff --git a/docs/api/build/context/gather-dependencies/index.html b/docs/api/build/context/gather-dependencies/index.html
index 9448eaff..ca97352e 100644
--- a/docs/api/build/context/gather-dependencies/index.html
+++ b/docs/api/build/context/gather-dependencies/index.html
@@ -200,7 +200,7 @@ automatically track dependencies. However in some cases it might be
useful for a plugin to know exactly which dependencies are recorded.
In this case this method can be used as a context manager. Whenever Lektor
encounters a dependency it will invoke the passed function.
-Example
deps = set()
+Example
deps = set()
with get_ctx().gather_dependencies(deps.add):
items = pad.query('/path/to/some/pages').all()
print('The dependencies are: %s' % deps)
diff --git a/docs/api/build/context/index.html b/docs/api/build/context/index.html
index 03185450..3c044dad 100644
--- a/docs/api/build/context/index.html
+++ b/docs/api/build/context/index.html
@@ -200,7 +200,7 @@ will look at the context to decide on further operations to perform.
The current context can be discovered by calling the get_ctx
function which will return it. If there is no artifact build ongoing then
the return value will be None
.
-Basic Example
from lektor.context import get_ctx
+Basic Example
from lektor.context import get_ctx
ctx = get_ctx()
print('The current source is %s' % ctx.source)
diff --git a/docs/api/build/context/locale/index.html b/docs/api/build/context/locale/index.html
index 05da10a3..5e3653bb 100644
--- a/docs/api/build/context/locale/index.html
+++ b/docs/api/build/context/locale/index.html
@@ -200,7 +200,7 @@ term for language and territory) the context provides this information. It's
automatically resolved based on configuration from the current alt.
This is primarily useful for plugins that want to change their behavior based
on the current requested language.
-Example
print get_ctx().locale
+Example
print get_ctx().locale
diff --git a/docs/api/build/context/pad/index.html b/docs/api/build/context/pad/index.html
index d288b38c..dd2422df 100644
--- a/docs/api/build/context/pad/index.html
+++ b/docs/api/build/context/pad/index.html
@@ -197,7 +197,7 @@
To access the current pad from the context, this attribute can be used. It
refers to the active Pad.
-Example
from lektor.context import get_ctx
+Example
from lektor.context import get_ctx
ctx = get_ctx()
for child in ctx.pad.root.children:
diff --git a/docs/api/build/context/record-dependency/index.html b/docs/api/build/context/record-dependency/index.html
index 12abe2d5..d36a8f34 100644
--- a/docs/api/build/context/record-dependency/index.html
+++ b/docs/api/build/context/record-dependency/index.html
@@ -208,7 +208,7 @@ to record this as a dependency.
is possible to dependend to things outside of it, but the automatic watch
system of the builder will not track files there so they will not show up
unless a manual build is instructed.
-Example
import os
+Example
import os
from lektor.pluginsystem import Plugin
class IncludeFilePlugin(Plugin):
diff --git a/docs/api/build/context/record/index.html b/docs/api/build/context/record/index.html
index 155d309d..cdcd1313 100644
--- a/docs/api/build/context/record/index.html
+++ b/docs/api/build/context/record/index.html
@@ -198,7 +198,7 @@
This works almost exactly like the source property but the
difference is that it is None
if the source object is not a
Record.
-Example
from lektor.context import get_ctx
+Example
from lektor.context import get_ctx
ctx = get_ctx()
print ctx.record.record_label
diff --git a/docs/api/build/context/source/index.html b/docs/api/build/context/source/index.html
index defa721f..1b91b961 100644
--- a/docs/api/build/context/source/index.html
+++ b/docs/api/build/context/source/index.html
@@ -199,7 +199,7 @@
created from Source Objects, it's typically possible
to refer back to it. Note that there are situations in which artifacts are
created but no source is available. In this case the value will be None
.
-Example
from lektor.context import get_ctx
+Example
from lektor.context import get_ctx
ctx = get_ctx()
print ctx.source.source_filename
diff --git a/docs/api/build/context/sub-artifact/index.html b/docs/api/build/context/sub-artifact/index.html
index db579613..faaa52fd 100644
--- a/docs/api/build/context/sub-artifact/index.html
+++ b/docs/api/build/context/sub-artifact/index.html
@@ -213,7 +213,7 @@ artifact is already considered up to date.
provided it can identify the configuration that the artifact was created
from. If the hash changes the artifact will be rebuilt. Such a hash
can for instance be generated with get_structure_hash.
-Example
import os
+Example
import os
from lektor.pluginsystem import Plugin
class IncludeFilePlugin(Plugin):
@@ -229,7 +229,7 @@ can for instance be generated with self.env.jinja_env.globals['get_demo_css'] = get_css
Inside a template it can be used like this:
-<link rel=stylesheet href="{{ get_demo_css()|url }}">
+<link rel=stylesheet href="{{ get_demo_css()|url }}">
diff --git a/docs/api/build/get-ctx/index.html b/docs/api/build/get-ctx/index.html
index a2734514..54f1e788 100644
--- a/docs/api/build/get-ctx/index.html
+++ b/docs/api/build/get-ctx/index.html
@@ -174,7 +174,7 @@ if not. This means that if plugins only call that method in places where
they know a build is access it's not necessary to check if the context is
available.
For more information: Context.
-Example
from lektor.context import get_ctx
+Example
from lektor.context import get_ctx
ctx = get_ctx()
diff --git a/docs/api/build/program/iter-child-sources/index.html b/docs/api/build/program/iter-child-sources/index.html
index 87b29e16..a06340d6 100644
--- a/docs/api/build/program/iter-child-sources/index.html
+++ b/docs/api/build/program/iter-child-sources/index.html
@@ -189,7 +189,7 @@
Optionally a builder can yield further sources that are then picked up by the
builder and processed normally. This is how the recursive build process in
Lektor is implemented for normal records.
-Example
def iter_child_sources(self):
+Example
def iter_child_sources(self):
for child in self.sources.children:
yield child
diff --git a/docs/api/databags/index.html b/docs/api/databags/index.html
index 843fa99f..8f31951c 100644
--- a/docs/api/databags/index.html
+++ b/docs/api/databags/index.html
@@ -197,11 +197,11 @@ which can for instance be used with the
Example Databag
This is a basic example of a data bag that contains configuration values
for google maps. It's stored in databags/gmaps.ini
:
-key = 1233456ABCDEFG
+key = 1233456ABCDEFG
api_url = https://www.google.com/maps/embed/v1/
This can then be usde to good effect in templates:
-{% macro render_map(location, width=600, height=450) %}
+{% macro render_map(location, width=600, height=450) %}
<iframe
width="{{ width }}" height="{{ height }}"
frameborder="0" style="border:0"
diff --git a/docs/api/databags/lookup/index.html b/docs/api/databags/lookup/index.html
index 3789d78a..77404b7f 100644
--- a/docs/api/databags/lookup/index.html
+++ b/docs/api/databags/lookup/index.html
@@ -167,7 +167,7 @@
Python code. Within templates you can also use the bag function which is easier to call.
The key is in dotted notation. For more information about this refer
to the main databags documentation.
-Example
def translate(pad, alt, key):
+Example
def translate(pad, alt, key):
return pad.databags.lookup('i18n.%s.%s' % (alt, key), key)
diff --git a/docs/api/db/expression/and/index.html b/docs/api/db/expression/and/index.html
index 3050678e..3fab34b2 100644
--- a/docs/api/db/expression/and/index.html
+++ b/docs/api/db/expression/and/index.html
@@ -237,7 +237,7 @@
expression on the right are true. This is one of the few operators that
differs between Python and templates. In templates you have to use the
and
method whereas in Python have to use the &
operator.
-Template Example
<h3>3 Star or Higher</h3>
+Template Example
<h3>3 Star or Higher</h3>
<ul>
{% for item in this.children.filter(
(F.type == 'hotel').and(F.stars >= 3)) %}
@@ -245,7 +245,7 @@ differs between Python and templates. In templates you have to use the
{% endfor %}
</ul>
-Python Example
def get_hotels(page):
+Python Example
def get_hotels(page):
return page.children.filter(
(F.type == 'hotel') & (F.stars >= 3))
diff --git a/docs/api/db/expression/contains/index.html b/docs/api/db/expression/contains/index.html
index 8904763d..14c63982 100644
--- a/docs/api/db/expression/contains/index.html
+++ b/docs/api/db/expression/contains/index.html
@@ -234,7 +234,7 @@
This expression evaluates to true if an item is contained within a field.
This works with fields that are lists in nature or strings. For instance a string can be
contained in another string or a item can be contained within a list.
-Template Example
<h3>Projects Tagged 'amazing'</h3>
+Template Example
<h3>Projects Tagged 'amazing'</h3>
<ul>
{% for item in this.children.filter(F.tags.contains('amazing')) %}
<li>{{ item.name }}</li>
diff --git a/docs/api/db/expression/endswith-cs/index.html b/docs/api/db/expression/endswith-cs/index.html
index 886882b4..72b1d28e 100644
--- a/docs/api/db/expression/endswith-cs/index.html
+++ b/docs/api/db/expression/endswith-cs/index.html
@@ -235,7 +235,7 @@
on the left side ends with the string on the right side. This method
operates in a case-sensitive manner. For the case-insensitive method
see endswith.
-Example
<ul>
+Example
<ul>
{% for item in this.children.filter(F.name.endswith_cs('House')) %}
<li>{{ item.name }}</li>
{% endfor %}
diff --git a/docs/api/db/expression/endswith/index.html b/docs/api/db/expression/endswith/index.html
index ba504039..93726945 100644
--- a/docs/api/db/expression/endswith/index.html
+++ b/docs/api/db/expression/endswith/index.html
@@ -235,7 +235,7 @@
on the left side ends with the string on the right side. This method
operates in a case-insensitive manner. For the case-sensitive method
see endswith_cs.
-Example
<ul>
+Example
<ul>
{% for item in this.children.filter(F.name.endswith('house')) %}
<li>{{ item.name }}</li>
{% endfor %}
diff --git a/docs/api/db/expression/eq/index.html b/docs/api/db/expression/eq/index.html
index af1c8454..3bc4b5bc 100644
--- a/docs/api/db/expression/eq/index.html
+++ b/docs/api/db/expression/eq/index.html
@@ -233,7 +233,7 @@
This checks if the left side of the expression matches the right side.
Typically it compares if a value matches a specific value exactly:
-Example
<h2>Our Houses</h2>
+Example
<h2>Our Houses</h2>
<ul>
{% for project in this.children.filter(F.type == 'house') %}
<li>{{ project.name }}</li>
diff --git a/docs/api/db/expression/ge/index.html b/docs/api/db/expression/ge/index.html
index c985ba78..099573bd 100644
--- a/docs/api/db/expression/ge/index.html
+++ b/docs/api/db/expression/ge/index.html
@@ -233,7 +233,7 @@
This evaluates to true if the left side compares larger than the right side
or equal to it. This behavior works best with integers or floats.
-Template Example
<h3>3 or more Stars</h3>
+Template Example
<h3>3 or more Stars</h3>
<ul>
{% for item in this.children.filter(F.stars >= 3) %}
<li>{{ item.name }}: {{ item.stars }} stars</li>
diff --git a/docs/api/db/expression/gt/index.html b/docs/api/db/expression/gt/index.html
index a7668300..f9ec8940 100644
--- a/docs/api/db/expression/gt/index.html
+++ b/docs/api/db/expression/gt/index.html
@@ -234,7 +234,7 @@
This evaluates to true if the left side compares larger than the right side.
This behavior works best with integers
or floats.
-Template Example
<h3>Well Rated Items</h3>
+Template Example
<h3>Well Rated Items</h3>
<ul>
{% for item in this.children.filter(F.stars > 3) %}
<li>{{ item.name }}: {{ item.stars }} stars</li>
diff --git a/docs/api/db/expression/index.html b/docs/api/db/expression/index.html
index 1ba39935..eb08883a 100644
--- a/docs/api/db/expression/index.html
+++ b/docs/api/db/expression/index.html
@@ -235,7 +235,7 @@ of it can create more expressive expressions. F.name
literally jus
that a field by that name exists and is set to a value.
The query syntax is mostly the same in Python as well as in the Jinja 2
templates, the main difference are and and or.
-Example
>>> p.children.filter((F.name == 'foo') | (F.name == 'bar')).all()
+Example
>>> p.children.filter((F.name == 'foo') | (F.name == 'bar')).all()
[<Page model=u'page' id=u'bar'>, <Page model=u'page' id=u'foo'>]
diff --git a/docs/api/db/expression/le/index.html b/docs/api/db/expression/le/index.html
index 95f84ed7..65d049f7 100644
--- a/docs/api/db/expression/le/index.html
+++ b/docs/api/db/expression/le/index.html
@@ -233,7 +233,7 @@
This evaluates to true if the left side compares smaller than the right side
or equal to it. This behavior works best with integers or floats.
-Template Example
<h3>Projects From Before Including 2000</h3>
+Template Example
<h3>Projects From Before Including 2000</h3>
<ul>
{% for item in this.children.filter(F.year <= 2000) %}
<li>{{ item.name }} ({{ item.year }})</li>
diff --git a/docs/api/db/expression/lt/index.html b/docs/api/db/expression/lt/index.html
index 56b00b72..089630e5 100644
--- a/docs/api/db/expression/lt/index.html
+++ b/docs/api/db/expression/lt/index.html
@@ -233,7 +233,7 @@
This evaluates to true if the left side compares smaller than the right side
or equal to it. This behavior works best with integers or floats.
-Template Example
<h3>Projects From Before 2000</h3>
+Template Example
<h3>Projects From Before 2000</h3>
<ul>
{% for item in this.children.filter(F.year < 2000) %}
<li>{{ item.name }} ({{ item.year }})</li>
diff --git a/docs/api/db/expression/ne/index.html b/docs/api/db/expression/ne/index.html
index 00172ceb..1603705d 100644
--- a/docs/api/db/expression/ne/index.html
+++ b/docs/api/db/expression/ne/index.html
@@ -233,7 +233,7 @@
This checks if the left side of the expression does not match the right side
by doing an exact comparison:
-Example
<h2>Everything Other Than Houses</h2>
+Example
<h2>Everything Other Than Houses</h2>
<ul>
{% for project in this.children.filter(F.type != 'house') %}
<li>{{ project.name }}</li>
diff --git a/docs/api/db/expression/or/index.html b/docs/api/db/expression/or/index.html
index 9387584c..cae7dcff 100644
--- a/docs/api/db/expression/or/index.html
+++ b/docs/api/db/expression/or/index.html
@@ -237,7 +237,7 @@
expression on the right are true. This is one of the few operators that
differs between Python and templates. In templates you have to use the
or
method whereas in Python have to use the |
operator.
-Template Example
<h3>Hotels or Apartments</h3>
+Template Example
<h3>Hotels or Apartments</h3>
<ul>
{% for item in this.children.filter(
(F.type == 'hotel').or(F.type == 'apartment')) %}
@@ -245,7 +245,7 @@ differs between Python and templates. In templates you have to use the
{% endfor %}
</ul>
-Python Example
def get_hotels_or_apartments(page):
+Python Example
def get_hotels_or_apartments(page):
return page.children.filter(
(F.type == 'hotel') | (F.type == 'apartment'))
diff --git a/docs/api/db/expression/startswith-cs/index.html b/docs/api/db/expression/startswith-cs/index.html
index 7d78405c..fbc4831a 100644
--- a/docs/api/db/expression/startswith-cs/index.html
+++ b/docs/api/db/expression/startswith-cs/index.html
@@ -235,7 +235,7 @@
on the left side starts with the string on the right side. This method
operates in a case-sensitive manner. For the case-insensitive method
see startswith.
-Example
<h1>A</h1>
+Example
<h1>A</h1>
<ul>
{% for item in this.children.filter(F.name.startswith_cs('A')) %}
<li>{{ item.name }}</li>
diff --git a/docs/api/db/expression/startswith/index.html b/docs/api/db/expression/startswith/index.html
index 7415f048..1e4f6f25 100644
--- a/docs/api/db/expression/startswith/index.html
+++ b/docs/api/db/expression/startswith/index.html
@@ -235,7 +235,7 @@
on the left side starts with the string on the right side. This method
operates in a case-insensitive manner. For the case-sensitive method
see startswith_cs.
-Example
<h1>A</h1>
+Example
<h1>A</h1>
<ul>
{% for item in this.children.filter(F.name.startswith('a')) %}
<li>{{ item.name }}</li>
diff --git a/docs/api/db/f/index.html b/docs/api/db/f/index.html
index 817acd0f..db64a7bc 100644
--- a/docs/api/db/f/index.html
+++ b/docs/api/db/f/index.html
@@ -195,7 +195,7 @@ field of an arbitrary record. This can be achieved with the F
obje
attribute of it refers to a field in the record. To make this clearer, have a
look at the example below.
Accessing an attributes creates an Expression.
-Example
<ul>
+Example
<ul>
{% for item in this.children.filter(F.status == 'published') %}
<li>{{ item.title }}</li>
{% endfor %}
diff --git a/docs/api/db/get-alts/index.html b/docs/api/db/get-alts/index.html
index 929c4735..97fc6aaa 100644
--- a/docs/api/db/get-alts/index.html
+++ b/docs/api/db/get-alts/index.html
@@ -197,7 +197,7 @@ value is an empty list.
This returns only the list of alt short IDs. Access to the configured name
of the alt within the project config is not available. Databags should be
used to provide alts with a humand readable title.
-Example
<p>Other languages:
+Example
<p>Other languages:
<ul>
{% for alt in get_alts(this) %}
<li><a href="{{ '.'|url(alt=alt) }}">{{ alt|title }}</a></li>
diff --git a/docs/api/db/obj/alt/index.html b/docs/api/db/obj/alt/index.html
index c48c34ce..112ca6ea 100644
--- a/docs/api/db/obj/alt/index.html
+++ b/docs/api/db/obj/alt/index.html
@@ -230,7 +230,7 @@
For most source records there will be an associated alt. This attribute points to it. If the content
is not associated with an alt this can be None
.
-Example
<!-- generated from alt {{ this.alt }} -->
+Example
<!-- generated from alt {{ this.alt }} -->
diff --git a/docs/api/db/obj/index.html b/docs/api/db/obj/index.html
index c160b3d1..c5c36235 100644
--- a/docs/api/db/obj/index.html
+++ b/docs/api/db/obj/index.html
@@ -248,7 +248,7 @@ in the path. The part after the at sign is called the “virtual path”.
the record's path + @source
. So if the record was /hello
then the
path would be /hello@source
. The true base record it belongs to can be
referenced from the record property.
-from lektor.sourceobj import VirtualSourceObject
+from lektor.sourceobj import VirtualSourceObject
from lektor.utils import build_url
class Source(VirtualSourceObject):
diff --git a/docs/api/db/obj/is-child-of/index.html b/docs/api/db/obj/is-child-of/index.html
index 12ae5e00..39176a9d 100644
--- a/docs/api/db/obj/is-child-of/index.html
+++ b/docs/api/db/obj/is-child-of/index.html
@@ -233,7 +233,7 @@ page or not. The default behavior is to consider a page to be a child of
itself as this is more convenient in most situations but this can be
changed with the strict
parameter. This method is particularly useful
when building a navigation.
-Example
<a href="{{ '/projects'|url }}"{% if this.is_child_of('/projects')
+Example
<a href="{{ '/projects'|url }}"{% if this.is_child_of('/projects')
%} class="active"{% endif %}>Projects</a>
diff --git a/docs/api/db/obj/is-discoverable/index.html b/docs/api/db/obj/is-discoverable/index.html
index 3a0c1c6c..84da61c8 100644
--- a/docs/api/db/obj/is-discoverable/index.html
+++ b/docs/api/db/obj/is-discoverable/index.html
@@ -241,7 +241,7 @@ to implement drafts of blog posts or similar things.
This property is implemented on the level of source objects to make it
possible to use this API in all cases. The default implementation of
source objects will always return true
for discoverability checks.
-Example
{% set downloads = site.get('/downloads') %}
+Example
{% set downloads = site.get('/downloads') %}
{% if downloads.is_discoverable %}
<p><a href="{{ downloads|url }}">Go to downloads</a>
{% endif %}
diff --git a/docs/api/db/obj/is-hidden/index.html b/docs/api/db/obj/is-hidden/index.html
index e2dc0b9a..582f92bd 100644
--- a/docs/api/db/obj/is-hidden/index.html
+++ b/docs/api/db/obj/is-hidden/index.html
@@ -238,7 +238,7 @@ instance hidden pages can be used to store configuration values.
This property is implemented on the level of source objects to make it
possible to use this API in all cases though the default implementation for
source objects is that they are always visible.
-Example
{% set downloads = site.get('/downloads') %}
+Example
{% set downloads = site.get('/downloads') %}
{% if downloads.is_hidden %}
<p>Downloads are currently unavailable
{% endif %}
diff --git a/docs/api/db/obj/is-visible/index.html b/docs/api/db/obj/is-visible/index.html
index 6dbdd679..1610ae62 100644
--- a/docs/api/db/obj/is-visible/index.html
+++ b/docs/api/db/obj/is-visible/index.html
@@ -229,7 +229,7 @@
This is exactly the opposite of is_hidden.
-Example
{% set downloads = site.get('/downloads') %}
+Example
{% set downloads = site.get('/downloads') %}
{% if downloads.is_visible %}
<p><a href="{{ downloads|url }}">go to downloads</a>
{% endif %}
diff --git a/docs/api/db/obj/parent/index.html b/docs/api/db/obj/parent/index.html
index a33ec2f9..fc9acef7 100644
--- a/docs/api/db/obj/parent/index.html
+++ b/docs/api/db/obj/parent/index.html
@@ -232,7 +232,7 @@
this property. It's not a requirement that this property is implemented but
most will have it. In particular it's useful for virtual source objects
where this property can be used to discover the associated parent object.
-Example
<p>My parent is: {{ this.parent.path }}
+Example
<p>My parent is: {{ this.parent.path }}
diff --git a/docs/api/db/obj/record/index.html b/docs/api/db/obj/record/index.html
index d060c5ea..2591ccd4 100644
--- a/docs/api/db/obj/record/index.html
+++ b/docs/api/db/obj/record/index.html
@@ -239,7 +239,7 @@ for virtual sources this refers back to the record that was associated with
the virtual source. Most of the time this matches parent
but for nested
source objects it's useful to be able to refer back to the base in all cases
without having to walk up the parents.
-Example
{% if this != this.record %}
+Example
{% if this != this.record %}
<a href="{{ this.record|url }}">go back to overview</a>
{% endif %}
diff --git a/docs/api/db/obj/source-filename/index.html b/docs/api/db/obj/source-filename/index.html
index 75681ecf..8b15bb18 100644
--- a/docs/api/db/obj/source-filename/index.html
+++ b/docs/api/db/obj/source-filename/index.html
@@ -232,7 +232,7 @@
instance if this is an asset it will be the path to it, if it is a record
it will be the path to the lektor contents file. The path is relative
to the project folder.
-Example
<p>
+Example
<p>
Generated from {{ this.source_filename }}
</p>
diff --git a/docs/api/db/obj/url-to/index.html b/docs/api/db/obj/url-to/index.html
index 117f17d9..d960ec3e 100644
--- a/docs/api/db/obj/url-to/index.html
+++ b/docs/api/db/obj/url-to/index.html
@@ -239,7 +239,7 @@ domain part to the URL (if configured). The default behavior is to use the
configured URL style (which is relative
) unless absolute or external were
explicitly provided. For more information read about this in the
Project Configuration.
-Example
{% set downloads = site.get('/downloads') %}
+Example
{% set downloads = site.get('/downloads') %}
Path from downloads to here: {{ downloads.url_to(this) }}
diff --git a/docs/api/db/pad/get-root/index.html b/docs/api/db/pad/get-root/index.html
index dc759cbe..003ec243 100644
--- a/docs/api/db/pad/get-root/index.html
+++ b/docs/api/db/pad/get-root/index.html
@@ -214,7 +214,7 @@
Alternatives. This method can be used
to target the root page of a specific one. If no alt is provided, then the
primary alt is loaded.
-Example
{% set root = site.get_root(alt='de') %}
+Example
{% set root = site.get_root(alt='de') %}
<a href="{{ root|url }}">Go to German Page</a>
diff --git a/docs/api/db/pad/get/index.html b/docs/api/db/pad/get/index.html
index ef467071..201adc80 100644
--- a/docs/api/db/pad/get/index.html
+++ b/docs/api/db/pad/get/index.html
@@ -222,17 +222,17 @@ want to select a specific page for pagination, then you need to pass
page_num
with a valid page number or you use the virtual path (@1
for the
first page for instance).
Examples
This is a simple example that shows how to use the method in a template:
-{% set root = site.get('/') %}
+{% set root = site.get('/') %}
<title>{{ this.title }} | {{ root.title }}</title>
Here another example that loads the current page but in another language:
-{% set other_lang = site.get(this._path, alt='ru') %}
+{% set other_lang = site.get(this._path, alt='ru') %}
<p>This page in Russian: {{ other_lang.title }}
Virtual Paths
This method can also be used to look up virtual paths. For instance to fetch a specific version of a
pagination you can use a virtual path instead of using the page_num
parameter:
->>> pad.get('/blog@3')
+>>> pad.get('/blog@3')
<Page model=u'blog' path='/blog' page_num=3>
diff --git a/docs/api/db/pad/index.html b/docs/api/db/pad/index.html
index e37e5c91..7ac0dd8e 100644
--- a/docs/api/db/pad/index.html
+++ b/docs/api/db/pad/index.html
@@ -227,12 +227,12 @@ command line scripts.
Template Usage
A ready-configured pad is always available under the site
name which
allows you to easily discover other pages. Here is a basic example of
how to do this through the get method:
-{% set root = site.get('/') %}
+{% set root = site.get('/') %}
<title>{{ this.title }} | {{ root.title }}</title>
Plugin Usage
Within plugins it's typically not a good idea to construct a new Pad.
Instead you can get access to the current pad from the active context:
-from lektor.context import get_ctx
+from lektor.context import get_ctx
ctx = get_ctx()
if ctx is not None:
@@ -244,7 +244,7 @@ instance.
Manual Pad Creation
If you want to work with the database from a script, you can create a
pad from the Environment with the help of
the new_pad method:
-from lektor.project import Project
+from lektor.project import Project
project = Project.discover()
env = project.make_env()
diff --git a/docs/api/db/pad/query/index.html b/docs/api/db/pad/query/index.html
index c7a0b3ed..6bf3ac6a 100644
--- a/docs/api/db/pad/query/index.html
+++ b/docs/api/db/pad/query/index.html
@@ -214,7 +214,7 @@
Lektor. It creates a query at a specific path and alt. This is an
alternative to accessing the children of the root record
and will also include hidden pages.
-Example
<ul>
+Example
<ul>
{% for project in site.query('/projects') %}
<li>{{ project.name }}: {{ project.year }}</li>
{% endfor %}
diff --git a/docs/api/db/pad/resolve-url-path/index.html b/docs/api/db/pad/resolve-url-path/index.html
index 3e6f23d9..f9448b84 100644
--- a/docs/api/db/pad/resolve-url-path/index.html
+++ b/docs/api/db/pad/resolve-url-path/index.html
@@ -218,7 +218,7 @@ happening in Lektor.
want to resolve to records you can pass include_assets=False
and only
records will be included.
Examples
Shows an example of how to resolve paths into assets:
->>> pad.resolve_url_path('/docs/api')
+>>> pad.resolve_url_path('/docs/api')
<Page model=u'doc-page' path=u'/docs/api'>
>>> pad.resolve_url_path('/header.jpg')
<Image model='none' path=u'/header.jpg'>
diff --git a/docs/api/db/pad/root/index.html b/docs/api/db/pad/root/index.html
index 52052754..9f8b1552 100644
--- a/docs/api/db/pad/root/index.html
+++ b/docs/api/db/pad/root/index.html
@@ -212,7 +212,7 @@
This works exactly like get_root but always returns
the primary alternative and is implemented as a property.
-Example
<a href="{{ site.root|url }}">Go to Index</a>
+Example
<a href="{{ site.root|url }}">Go to Index</a>
diff --git a/docs/api/db/query/all/index.html b/docs/api/db/query/all/index.html
index b612b2d6..75f165d8 100644
--- a/docs/api/db/query/all/index.html
+++ b/docs/api/db/query/all/index.html
@@ -235,7 +235,7 @@
the query as a list. In many cases just iterating over the query achieve
the same result, but if you want an actual list this method comes in
handy.
-Example
{% items = site.query('/projects').include_hidden(false).all() %}
+Example
{% items = site.query('/projects').include_hidden(false).all() %}
{% if items %}
<ul>
{% for item in items %}
diff --git a/docs/api/db/query/count/index.html b/docs/api/db/query/count/index.html
index 51ab1efd..8c4eac8f 100644
--- a/docs/api/db/query/count/index.html
+++ b/docs/api/db/query/count/index.html
@@ -232,7 +232,7 @@
This is a simple way to count the total number of items a query matches.
-Example
{% set project_count = site.query('/projects').count() %}
+Example
{% set project_count = site.query('/projects').count() %}
<p>We built {{ project_count }} projects.
diff --git a/docs/api/db/query/distinct/index.html b/docs/api/db/query/distinct/index.html
index 2a73ca59..aa80438c 100644
--- a/docs/api/db/query/distinct/index.html
+++ b/docs/api/db/query/distinct/index.html
@@ -236,14 +236,14 @@
Returns a set
with all values for field_name
of all
Records in this query.
Example
If your blog posts have a field called tags
:
-# blog-post.ini
+# blog-post.ini
[field.tags]
name = Tags
type = strings
You can display all your blog posts' tags with:
-{% set tags = site.query('/blog').distinct('tags') %}
+{% set tags = site.query('/blog').distinct('tags') %}
{% if tags %}
<ul>
{% for tag in tags|sort %}
diff --git a/docs/api/db/query/filter/index.html b/docs/api/db/query/filter/index.html
index b85e2c08..56db244a 100644
--- a/docs/api/db/query/filter/index.html
+++ b/docs/api/db/query/filter/index.html
@@ -237,7 +237,7 @@ which allows you to perform comparisons with values that fields have.
Multiple filter calls can be chained as an alternative to using an and
expression.
Example
Here a basic example of how to filter something in a template:
-<ul>
+<ul>
{% for item in this.children.filter(F.status == 'published') %}
<li>{{ item.title }}</li>
{% endfor %}
diff --git a/docs/api/db/query/first/index.html b/docs/api/db/query/first/index.html
index b5030498..27edb7de 100644
--- a/docs/api/db/query/first/index.html
+++ b/docs/api/db/query/first/index.html
@@ -233,7 +233,7 @@
This method returns the first Record that matches the
query. If no such record can be produced, None
is returned.
-Example
{% set first_visible = this.children.first() %}
+Example
{% set first_visible = this.children.first() %}
{% if first_visible %}
<h2>Explore More ...</h2>
<p>{{ first_visible.title }}
diff --git a/docs/api/db/query/get/index.html b/docs/api/db/query/get/index.html
index 867153e0..3317f8ef 100644
--- a/docs/api/db/query/get/index.html
+++ b/docs/api/db/query/get/index.html
@@ -235,7 +235,7 @@
the get method of the pad but respects the currently
applied filtering. If page_num
is provided it overrides the currently
requested page number from the query for pagination.
-Example
{% set p1 = this.children.get('project-1') %}
+Example
{% set p1 = this.children.get('project-1') %}
<h2>{{ p1.name }}</h2>
<p>Our favorite!
diff --git a/docs/api/db/query/include-hidden/index.html b/docs/api/db/query/include-hidden/index.html
index 84c16739..f3f35cec 100644
--- a/docs/api/db/query/include-hidden/index.html
+++ b/docs/api/db/query/include-hidden/index.html
@@ -239,7 +239,7 @@ method of the pad.
The parameter can be set to True
to include hidden or False
to exclude
hidden records.
Example
Here a basic example of how to filter something in a template:
-<ul>
+<ul>
{% for item in this.children.include_hidden(true) %}
<li>{{ item.title }}{% if item.is_hidden %} (hidden){% endif %}</li>
{% endfor %}
diff --git a/docs/api/db/query/include-undiscoverable/index.html b/docs/api/db/query/include-undiscoverable/index.html
index d6e2bec9..6e5a985a 100644
--- a/docs/api/db/query/include-undiscoverable/index.html
+++ b/docs/api/db/query/include-undiscoverable/index.html
@@ -240,7 +240,7 @@ include undiscoverable records by default.
If undiscoverable records should included this method needs to be used.
Set it to True
to include hidden or False
to exclude them (default).
Example
Here a basic example of how to filter something in a template:
-<ul>
+<ul>
{% for item in this.children.include_undiscoverable(true) %}
<li>{{ item.title }}</li>
{% endfor %}
diff --git a/docs/api/db/query/index.html b/docs/api/db/query/index.html
index 76d52418..d831dcdd 100644
--- a/docs/api/db/query/index.html
+++ b/docs/api/db/query/index.html
@@ -233,7 +233,7 @@ through either the Pad or through things like
Most operations on a query object return another one which will return a
more filtered result.
Example
Here a basic example of how to filter something in a template:
-<ul>
+<ul>
{% for item in this.children.filter(F.status == 'published') %}
<li>{{ item.title }}</li>
{% endfor %}
diff --git a/docs/api/db/query/limit/index.html b/docs/api/db/query/limit/index.html
index 192e892b..a2dc862e 100644
--- a/docs/api/db/query/limit/index.html
+++ b/docs/api/db/query/limit/index.html
@@ -233,7 +233,7 @@
The offset method can be used to limit the return value to a certain number
of matching records.
-Example
<h3>Our Top 3</h3>
+Example
<h3>Our Top 3</h3>
<ul>
{% for item in this.children.order_by('-rating').limit(3) %}
<li>{{ item.title }}</li>
diff --git a/docs/api/db/query/offset/index.html b/docs/api/db/query/offset/index.html
index 7ab787cd..ea9f01f1 100644
--- a/docs/api/db/query/offset/index.html
+++ b/docs/api/db/query/offset/index.html
@@ -235,7 +235,7 @@
this is not useful as pagination comes built-in, but it can be helpful in
some manual scenarios when working with data from the shell
.
This is typically combined with limit.
-Example
>>> pad.query('/projects').limit(5).offset(10).all()
+Example
>>> pad.query('/projects').limit(5).offset(10).all()
[...]
diff --git a/docs/api/db/query/order-by/index.html b/docs/api/db/query/order-by/index.html
index 7bb076e2..f07267e9 100644
--- a/docs/api/db/query/order-by/index.html
+++ b/docs/api/db/query/order-by/index.html
@@ -239,7 +239,7 @@ order is reversed.
If two records have the same value for a field, then the ordering is defined on
the next argument given. So if you order by ('year', 'name'
) it will first
order by year and within a year it will order by name.
-Example
<ul>
+Example
<ul>
{% for project in this.children.order_by('-year', 'name') %}
<li>{{ project.year }}: {{ project.name }}</li>
{% endif %}
diff --git a/docs/api/db/query/request-page/index.html b/docs/api/db/query/request-page/index.html
index 388f8fe6..31ec9158 100644
--- a/docs/api/db/query/request-page/index.html
+++ b/docs/api/db/query/request-page/index.html
@@ -238,7 +238,7 @@ this parameter it's possible to change this. The parameter is the number
of the page to access.
Truth be told: this method exists mostly for consistency and less because
there is a good reason to use it.
-Example
<ul>
+Example
<ul>
{% for child in this.children.request_page(1) %}
<li>
Items on the first page of {{ child.title }}:
diff --git a/docs/api/db/query/self/index.html b/docs/api/db/query/self/index.html
index 4e76cfc1..448684c1 100644
--- a/docs/api/db/query/self/index.html
+++ b/docs/api/db/query/self/index.html
@@ -234,7 +234,7 @@
Because a query object filters "downwards" there this is a way access the item
at the level of the query object. It's particularly useful for debugging
in the shell
:
-Example
>>> root = pad.root
+Example
>>> root = pad.root
>>> root.children.query.self == root
True
diff --git a/docs/api/db/record/attachments/index.html b/docs/api/db/record/attachments/index.html
index 0734da3c..4e1063f9 100644
--- a/docs/api/db/record/attachments/index.html
+++ b/docs/api/db/record/attachments/index.html
@@ -240,7 +240,7 @@
This returns a Query to all attachments of a page. This
query can be further filtered to access specific types of attachments if
needed.
-Example
<div class="images">
+Example
<div class="images">
{% for image in this.attachments.images %}
<img src="{{ image.thumbnail(240) }}">
{% endfor %}
diff --git a/docs/api/db/record/children/index.html b/docs/api/db/record/children/index.html
index 4e85982c..f6abeb5b 100644
--- a/docs/api/db/record/children/index.html
+++ b/docs/api/db/record/children/index.html
@@ -249,7 +249,7 @@ available.
What's important to know about children is that the default query will
exclude hidden children. This is different from creating a query object
via the query method of the pad.
-Example
<ul>
+Example
<ul>
{% for child in this.children %}
<li>{{ child.title }}</li>
{% endfor %}
diff --git a/docs/api/db/record/contents/index.html b/docs/api/db/record/contents/index.html
index 631930dc..0c51a98e 100644
--- a/docs/api/db/record/contents/index.html
+++ b/docs/api/db/record/contents/index.html
@@ -305,7 +305,7 @@ contents of that file:
Example
Here are some ideas of what you can do with it:
-<img src="{{ image.contents.as_data_url() }}" alt="">
+<img src="{{ image.contents.as_data_url() }}" alt="">
diff --git a/docs/api/db/record/exif/index.html b/docs/api/db/record/exif/index.html
index 27fec6a0..468058df 100644
--- a/docs/api/db/record/exif/index.html
+++ b/docs/api/db/record/exif/index.html
@@ -348,7 +348,7 @@ into a dictionary that can be dumped to JSON for instance.
-Example
{% if image.exif.location %}
+Example
{% if image.exif.location %}
<h2>Picture Location</h2>
<iframe width="600" height="450" frameborder="0" style="border:0"
src="https://www.google.com/maps/embed/v1/place?q={{
diff --git a/docs/api/db/record/format/index.html b/docs/api/db/record/format/index.html
index 119326ac..a9f787d1 100644
--- a/docs/api/db/record/format/index.html
+++ b/docs/api/db/record/format/index.html
@@ -239,7 +239,7 @@
This returns the format of the attachment as a string. This is currently
only implemented for attachments that are images.
-Example
{% for image in this.attachments.images %}
+Example
{% for image in this.attachments.images %}
<p>{{ image._id }}: {{ image.format }}
{% endfor %}
diff --git a/docs/api/db/record/get_siblings/index.html b/docs/api/db/record/get_siblings/index.html
index 7b731a5f..1accb42c 100644
--- a/docs/api/db/record/get_siblings/index.html
+++ b/docs/api/db/record/get_siblings/index.html
@@ -245,7 +245,7 @@ filter and order the children. Otherwise, the parent's standard configuration
for children is used.
See the pagination guide and the
page order guide.
-Example
{% set siblings = this.get_siblings() %}
+Example
{% set siblings = this.get_siblings() %}
{% if siblings.prev_page %}
<a href="{{ siblings.prev_page|url }}">previous</a>
diff --git a/docs/api/db/record/getitem/index.html b/docs/api/db/record/getitem/index.html
index e6353984..2ed04e13 100644
--- a/docs/api/db/record/getitem/index.html
+++ b/docs/api/db/record/getitem/index.html
@@ -243,7 +243,7 @@ is why you can typically access foo.bar
instead of foo['bar']
conflict with a record property exists.
All available fields can be accessed this way (model defined fields as well
as system fields which are prefixed by an underscore).
-Example
for child in this.children:
+Example
for child in this.children:
print('ID: %s' % child['_id'])
diff --git a/docs/api/db/record/has_next/index.html b/docs/api/db/record/has_next/index.html
index 2cc211a8..34cffc7c 100644
--- a/docs/api/db/record/has_next/index.html
+++ b/docs/api/db/record/has_next/index.html
@@ -243,7 +243,7 @@ filter and order the children. Otherwise, the parent's standard configuration
for children is used.
See the pagination guide and the
page order guide.
-Example
{% if this.has_next() %}
+Example