summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-02-18 11:14:10 -0800
committerGitHub <noreply@github.com>2021-02-18 20:14:10 +0100
commit8162c47b0f2b5970a876dc9cc1ed434bc5e6e789 (patch)
tree1921cde34bece360e7dab10dac24bff64f8a6eab /doc
parentcd274a5ac90edec6edccb5b8772bd34b4d1cd993 (diff)
downloadNim-8162c47b0f2b5970a876dc9cc1ed434bc5e6e789.tar.gz
nep1: triple quote literals should start with newline (#17065)
Diffstat (limited to 'doc')
-rw-r--r--doc/nep1.rst21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/nep1.rst b/doc/nep1.rst
index 052837b90..c0ae16706 100644
--- a/doc/nep1.rst
+++ b/doc/nep1.rst
@@ -281,5 +281,26 @@ Conventions for multi-line statements and expressions
     startProcess(nimExecutable, currentDirectory, compilerArguments
                  environment, processOptions)
 
+Miscellaneous
+-------------
+
 - Use `a..b` instead of `a .. b`, except when `b` contains an operator, for example `a .. -3`.
   Likewise with `a..<b`, `a..^b` and other operators starting with `..`.
+
+- Prefer triple quote literals to start with a newline; it's semantically identical
+  (it's a feature of triple quote literals) but clearer because it aligns with the next line:
+
+  use this:
+
+  .. code-block:: nim
+    let a = """
+    foo
+    bar
+    """
+
+  instead of:
+
+  .. code-block:: nim
+    let a = """foo
+    bar
+    """