summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/configuration/options.md12
-rwxr-xr-xscripts/build_config_option_docs.py10
2 files changed, 12 insertions, 10 deletions
diff --git a/docs/configuration/options.md b/docs/configuration/options.md
index 530113fe..eee79f7b 100644
--- a/docs/configuration/options.md
+++ b/docs/configuration/options.md
@@ -200,9 +200,6 @@ sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'AIRFLOW', 'FIRSTPARTY', 'LOCALFOL
known_airflow = ['airflow']
```
-### Example cli usage
-``
-
## Multi Line Output
Multi line output (0-grid, 1-vertical, 2-hanging, 3-vert-hanging, 4-vert-grid, 5-vert-grid-grouped, 6-vert-grid-grouped-no-comma).
@@ -229,9 +226,6 @@ multi_line_output=3
multi_line_output = 3
```
-### Example cli usage
-``
-
## Forced Separate
**No Description**
@@ -845,6 +839,12 @@ Displays the currently installed version of isort.
- -V
- --version
+**Examples:**
+
+### Example cli usage
+
+`isort --version`
+
## Version Number
Returns just the current version number without the logo
diff --git a/scripts/build_config_option_docs.py b/scripts/build_config_option_docs.py
index 6a094b54..54db3491 100755
--- a/scripts/build_config_option_docs.py
+++ b/scripts/build_config_option_docs.py
@@ -67,12 +67,13 @@ class Example:
.lstrip()
)
- if self.cli == "":
+ if self.cli:
cli = dedent(self.cli).lstrip()
self.cli = (
dedent(
"""
### Example cli usage
+
`{cli}`
"""
)
@@ -80,11 +81,11 @@ class Example:
.lstrip()
)
+ sections = [s for s in [self.cfg, self.pyproject_toml, self.cli] if s]
+ sections_str = "\n".join(sections)
self.section_complete = f"""**Examples:**
-{self.cfg}
-{self.pyproject_toml}
-{self.cli}"""
+{sections_str}"""
else:
self.section_complete = ""
@@ -106,6 +107,7 @@ example_mapping = {
known_airflow = ['airflow']""",
),
"multi_line_output": Example(cfg="multi_line_output=3", pyproject_toml="multi_line_output = 3"),
+ "show_version": Example(cli="isort --version"),
}