enabled yaml highlighting globally, made specific emphasis for blocks in playbooks_blocks docs

pull/11857/head
Brian Coca 9 years ago
parent 83ca5fb919
commit 479c4a4be9

@ -55,7 +55,7 @@ master_doc = 'index'
# General substitutions. # General substitutions.
project = 'Ansible Documentation' project = 'Ansible Documentation'
copyright = "2013 Ansible, Inc" copyright = "2013-2015 Ansible, Inc"
# The default replacements for |version| and |release|, also used in various # The default replacements for |version| and |release|, also used in various
# other places throughout the built documents. # other places throughout the built documents.
@ -100,6 +100,8 @@ exclude_patterns = ['modules']
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx' pygments_style = 'sphinx'
highlight_language = 'YAML'
# Options for HTML output # Options for HTML output
# ----------------------- # -----------------------

@ -7,11 +7,12 @@ at the block level, which also makes it much easier to set data or directives co
to the tasks. to the tasks.
Example:: .. code-block:: YAML
:emphasize-lines: 2
:caption: Block example
tasks: tasks:
- block: - block:
- yum: name={{ item }} state=installed - yum: name={{ item }} state=installed
with_items: with_items:
- httpd - httpd
@ -25,6 +26,7 @@ Example::
become: true become: true
become_user: root become_user: root
In the example above the 3 tasks will be executed only when the block's when condition is met and enables In the example above the 3 tasks will be executed only when the block's when condition is met and enables
privilege escalation for all the enclosed tasks. privilege escalation for all the enclosed tasks.
@ -35,7 +37,11 @@ Error Handling
`````````````` ``````````````
About Blocks About Blocks
Blocks also introduce the ability to handle errors in a way similar to exceptions in most programming languages.:: Blocks also introduce the ability to handle errors in a way similar to exceptions in most programming languages.
.. code-block:: YAML
:emphasize-lines: 2,6,10
:caption: Block error handling example
tasks: tasks:
- block: - block:

Loading…
Cancel
Save