Skip to content

Commit 3cefc1e

Browse files
committedOct 12, 2016
Minor typo fixes in extending.txt
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent 3b25669 commit 3cefc1e

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed
 

‎docs/extending.txt

+14-8
Original file line numberDiff line numberDiff line change
@@ -642,16 +642,22 @@ handler function, ``site`` and ``data`` will be added to the keyword arguments.
642642

643643
Example:
644644

645-
The following shortcode::
645+
The following shortcode:
646+
647+
.. code:: text
646648

647649
{{% raw %}}{{% foo bar="baz" spam %}}{{% /raw %}}
648650

649651
With a template in ``shortcodes/foo.tmpl`` with this content (using Jinja2
650-
syntax in this example)::
652+
syntax in this example)
653+
654+
.. code:: jinja
651655

652656
<div class="{{ _args[0] if _args else 'ham' }}">{{ bar }}</div>
653657

654-
Will result in this output::
658+
Will result in this output
659+
660+
.. code:: html
655661

656662
<div class="spam">baz</div>
657663

@@ -661,8 +667,8 @@ State and Cache
661667

662668
Sometimes your plugins will need to cache things to speed up further actions. Here are the conventions for that:
663669

664-
* If it's a file, put it somewhere in ```self.site.config['CACHE_FOLDER']``` (defaults to ```cache/```.
665-
* If it's a value, use ```self.site.cache.set(key, value)``` to set it and ```self.site.cache.get(key)``` to get it.
670+
* If it's a file, put it somewhere in ``self.site.config['CACHE_FOLDER']`` (defaults to ``cache/``.
671+
* If it's a value, use ``self.site.cache.set(key, value)`` to set it and ``self.site.cache.get(key)`` to get it.
666672
The key should be a string, the value should be json-encodable (so, be careful with datetime objects)
667673

668674
The values and files you store there can **and will** be deleted sometimes by the user. They should always be
@@ -672,11 +678,11 @@ On the other hand, sometimes you want to save something that is **not** a throwa
672678
change the output, so the user should not delete them. We call that **state**. To save state:
673679

674680
* If it's a file, put it somewhere in the working directory. Try not to do that please.
675-
* If it's a value, use ```self.site.state.set(key, value)``` to set it and ```self.state.cache.get(key)``` to get it.
681+
* If it's a value, use ``self.site.state.set(key, value)`` to set it and ``self.state.cache.get(key)`` to get it.
676682
The key should be a string, the value should be json-encodable (so, be careful with datetime objects)
677683

678-
The ```cache``` and ```state``` objects are rather simplistic, and that's intentional. They have no default values: if
679-
the key is not there, you will get ```None``` and like it. They are meant to be both threadsafe, but hey, who can
684+
The ``cache`` and ``state`` objects are rather simplistic, and that's intentional. They have no default values: if
685+
the key is not there, you will get ``None`` and like it. They are meant to be both threadsafe, but hey, who can
680686
guarantee that sort of thing?
681687

682688
There are no sections, and no access protection, so let's not use it to store passwords and such. Use responsibly.

0 commit comments

Comments
 (0)
Please sign in to comment.