From 895dbe3435d8428161e45e1c11d61b50126b8ecb Mon Sep 17 00:00:00 2001 From: Daniel Jasper <djasper@google.com> Date: Wed, 7 Oct 2015 13:02:45 +0000 Subject: [PATCH] clang-format: Hopefully fix code blocks in docs. Otherwise I will have to install sphinx ;).. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249542 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ClangFormatStyleOptions.rst | 6 ++++++ docs/tools/dump_format_style.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/ClangFormatStyleOptions.rst b/docs/ClangFormatStyleOptions.rst index 7d31a5869ce..da5b3b5ebd4 100644 --- a/docs/ClangFormatStyleOptions.rst +++ b/docs/ClangFormatStyleOptions.rst @@ -157,6 +157,7 @@ the configuration (without a prefix: ``Auto``). brackets. This will result in formattings like .. code-block:: c++ + someLongFunction(argument1, argument2); @@ -167,6 +168,7 @@ the configuration (without a prefix: ``Auto``). will result in formattings like .. code-block:: c++ + int aaaa = 12; int b = 23; int ccc = 23; @@ -178,6 +180,7 @@ the configuration (without a prefix: ``Auto``). will result in formattings like .. code-block:: c++ + int aaaa = 12; float b = 23; std::string ccc = 23; @@ -394,12 +397,14 @@ the configuration (without a prefix: ``Auto``). These are expected to be macros of the form: .. code-block:: c++ + FOREACH(<variable-declaration>, ...) <loop-body> In the .clang-format configuration file, this can be configured like: .. code-block:: c++ + ForEachMacros: ['RANGES_FOR', 'FOREACH'] For example: BOOST_FOREACH. @@ -422,6 +427,7 @@ the configuration (without a prefix: ``Auto``). To configure this in the .clang-format file, use: .. code-block:: c++ + IncludeCategories: - Regex: '^"(llvm|llvm-c|clang|clang-c)/' Priority: 2 diff --git a/docs/tools/dump_format_style.py b/docs/tools/dump_format_style.py index 3c04171044e..54760529ea6 100755 --- a/docs/tools/dump_format_style.py +++ b/docs/tools/dump_format_style.py @@ -87,7 +87,7 @@ class EnumValue: def clean_comment_line(line): if line == '/// \\code': - return '\n.. code-block:: c++\n' + return '\n.. code-block:: c++\n\n' if line == '/// \\endcode': return '' return line[4:] + '\n' -- GitLab