Skip to content

Commit da690fd

Browse files
authored
fix: update paragon build command options (#37)
1 parent 380a6fc commit da690fd

File tree

2 files changed

+13
-65
lines changed

2 files changed

+13
-65
lines changed

plugins/tutor-contrib-paragon/README.rst

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -102,36 +102,21 @@ Invoke the build process via Tutor:
102102
103103
tutor local do paragon-build-tokens [OPTIONS]
104104
105-
Available options:
106-
107-
- ``--source-tokens-only``
108-
Include only source design tokens in the build.
109-
110-
- ``--output-token-references``
111-
Include references for tokens with aliases to other tokens in the build output.
112-
113-
- ``--themes <theme1,theme2>``
114-
Comma-separated list of theme names to compile. Defaults to the list defined in ``PARAGON_ENABLED_THEMES`` if not provided.
115-
116-
- ``-v, --verbose``
117-
Enable verbose logging.
105+
For more information about available options, refer to the `Paragon CLI documentation <https://github.com/openedx/paragon/?tab=readme-ov-file#paragon-cli>`__.
118106

119107
Examples
120108
--------
121109

122110
.. code-block:: bash
123111
124-
# Compile all themes listed in PARAGON_ENABLED_THEMES
125-
tutor local do paragon-build-tokens
126-
127-
# Compile only specific themes
128-
tutor local do paragon-build-tokens --themes theme-1,theme-2
112+
# Compile all themes listed in PARAGON_ENABLED_THEMES
113+
tutor local do paragon-build-tokens
129114
130-
# Compile with full debug logs
131-
tutor local do paragon-build-tokens --verbose
115+
# Compile only specific themes
116+
tutor local do paragon-build-tokens --themes theme-1,theme-2
132117
133-
# Compile only source tokens for a single theme
134-
tutor local do paragon-build-tokens --themes theme-1 --source-tokens-only
118+
# Pass any other Paragon CLI options as needed
119+
tutor local do paragon-build-tokens --paragon-option value
135120
136121
Output
137122
------

plugins/tutor-contrib-paragon/tutorparagon/commands.py

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,13 @@
99
import click
1010

1111

12-
@click.command()
13-
@click.option(
14-
"--source-tokens-only",
15-
is_flag=True,
16-
default=False,
17-
help="Include only source design tokens in the build.",
12+
@click.command(
13+
context_settings=dict(ignore_unknown_options=True, allow_extra_args=True)
1814
)
19-
@click.option(
20-
"--output-token-references",
21-
is_flag=True,
22-
default=False,
23-
help="Include references for tokens with aliases to other tokens in the build output.",
24-
)
25-
@click.option("--themes", help="Comma-separated list of themes to build.")
26-
@click.option(
27-
"-v", "--verbose", is_flag=True, default=False, help="Enable verbose logging."
28-
)
29-
def paragon_build_tokens(
30-
source_tokens_only: bool,
31-
output_token_references: bool,
32-
themes: str,
33-
verbose: bool,
34-
) -> list[tuple[str, str]]:
15+
@click.pass_context
16+
def paragon_build_tokens(ctx: click.Context) -> list[tuple[str, str]]:
3517
"""
3618
Build theme token files using Paragon.
37-
38-
Args:
39-
source_tokens_only (bool): Only source design tokens.
40-
output_token_references (bool): Output token references.
41-
themes (str): Comma-separated list of themes.
42-
verbose (bool): Verbose logging.
43-
44-
Returns:
45-
list[tuple[str, str]]: List of commands to run.
19+
Accepts and forwards all options/arguments to paragon-builder.
4620
"""
47-
args = []
48-
if source_tokens_only:
49-
args.append("--source-tokens-only")
50-
if output_token_references:
51-
args.append("--output-token-references")
52-
if themes:
53-
args.append("--themes")
54-
args.append(themes)
55-
if verbose:
56-
args.append("--verbose")
57-
58-
return [("paragon-builder", " ".join(args))]
21+
return [("paragon-builder", " ".join(ctx.args))]

0 commit comments

Comments
 (0)