diff options
author | Brian Coca <brian.coca+git@gmail.com> | 2015-08-04 19:09:06 -0400 |
---|---|---|
committer | Brian Coca <brian.coca+git@gmail.com> | 2015-08-04 19:13:09 -0400 |
commit | 479c4a4be9cbbf2576cef42de2dab26e3d524609 (patch) | |
tree | 30b5c4bec7610d41c8987e0edb834a4840c5a858 | |
parent | 83ca5fb9193ec7949baad3e6f628b696df5ba1fc (diff) | |
download | ansible-479c4a4be9cbbf2576cef42de2dab26e3d524609.tar.gz |
enabled yaml highlighting globally, made specific emphasis for blocks in playbooks_blocks docs
-rw-r--r-- | docsite/conf.py | 4 | ||||
-rw-r--r-- | docsite/rst/playbooks_blocks.rst | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/docsite/conf.py b/docsite/conf.py index 61c6de5c11..95bc1fb832 100644 --- a/docsite/conf.py +++ b/docsite/conf.py @@ -55,7 +55,7 @@ master_doc = 'index' # General substitutions. project = 'Ansible Documentation' -copyright = "2013 Ansible, Inc" +copyright = "2013-2015 Ansible, Inc" # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. @@ -100,6 +100,8 @@ exclude_patterns = ['modules'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' +highlight_language = 'YAML' + # Options for HTML output # ----------------------- diff --git a/docsite/rst/playbooks_blocks.rst b/docsite/rst/playbooks_blocks.rst index 563d3300e6..4d391c7618 100644 --- a/docsite/rst/playbooks_blocks.rst +++ b/docsite/rst/playbooks_blocks.rst @@ -7,11 +7,12 @@ at the block level, which also makes it much easier to set data or directives co to the tasks. -Example:: +.. code-block:: YAML + :emphasize-lines: 2 + :caption: Block example tasks: - block: - - yum: name={{ item }} state=installed with_items: - httpd @@ -25,6 +26,7 @@ Example:: become: true become_user: root + 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. @@ -35,7 +37,11 @@ Error Handling `````````````` 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: - block: |