aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-05-30 09:27:42 -0400
committerXavier Claessens <xclaesse@gmail.com>2023-08-02 13:35:29 -0400
commitcec3edc08a6cd6a89761c49292ba6a3bace8b3c1 (patch)
treeca8f4504ead8fe875ef582299b2cbb9f07d85688 /docs
parent465ad6d261e2733c60c3a066eebabee72f14346a (diff)
downloadmeson-cec3edc08a6cd6a89761c49292ba6a3bace8b3c1.zip
meson-cec3edc08a6cd6a89761c49292ba6a3bace8b3c1.tar.gz
meson-cec3edc08a6cd6a89761c49292ba6a3bace8b3c1.tar.bz2
Unify message(), format() and fstring formatting
Share a common function to convert objects to display strings for consistency. While at it, also add support for formatting user options.
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/snippets/string_format.md10
-rw-r--r--docs/yaml/elementary/str.yml4
2 files changed, 14 insertions, 0 deletions
diff --git a/docs/markdown/snippets/string_format.md b/docs/markdown/snippets/string_format.md
new file mode 100644
index 0000000..fa33617
--- /dev/null
+++ b/docs/markdown/snippets/string_format.md
@@ -0,0 +1,10 @@
+## Unified message(), str.format() and f-string formatting
+
+They now all support the same set of values: strings, integers, bools, options,
+dictionaries and lists thereof.
+
+- Feature options (i.e. enabled, disabled, auto) were not previously supported
+ by any of those functions.
+- Lists and dictionaries were not previously supported by f-string.
+- str.format() allowed any type and often resulted in printing the internal
+ representation which is now deprecated.
diff --git a/docs/yaml/elementary/str.yml b/docs/yaml/elementary/str.yml
index 7748121..83ab3dd 100644
--- a/docs/yaml/elementary/str.yml
+++ b/docs/yaml/elementary/str.yml
@@ -14,6 +14,10 @@ methods:
See [the Meson syntax entry](Syntax.md#string-formatting) for more
information.
+
+ *Since 1.3.0* values other than strings, integers, bools, options,
+ dictionaries and lists thereof are deprecated. They were previously printing
+ the internal representation of the raw Python object.
example: |
```meson
template = 'string: @0@, number: @1@, bool: @2@'