You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2021/05/16 09:35:16 UTC

[airflow] branch master updated: Better multiline string formatting for chart docs (#15881)

This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/master by this push:
     new 3e38814  Better multiline string formatting for chart docs (#15881)
3e38814 is described below

commit 3e38814ad30ec90ac3aada68cf16fb2d3af16338
Author: Jed Cunningham <66...@users.noreply.github.com>
AuthorDate: Sun May 16 03:35:03 2021 -0600

    Better multiline string formatting for chart docs (#15881)
    
    This will properly format multiline strings in the helm chart parameter
    docs.
---
 docs/conf.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/docs/conf.py b/docs/conf.py
index 25c1c64..29dcfd4 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -363,6 +363,12 @@ elif PACKAGE_NAME.startswith('apache-airflow-providers-'):
         extensions.append('sphinxcontrib.jinja')
 elif PACKAGE_NAME == 'helm-chart':
 
+    def _str_representer(dumper, data):
+        style = "|" if "\n" in data else None  # show as a block scalar if we have more than 1 line
+        return dumper.represent_scalar("tag:yaml.org,2002:str", data, style)
+
+    yaml.add_representer(str, _str_representer)
+
     def _format_default(value: Any) -> str:
         if value == "":
             return '""'