-
-
Notifications
You must be signed in to change notification settings - Fork 4
Improved CLI parsing and added support for extra Typst arguments #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
In any case, thank you for this great plugin! One thing I want to check with you is that to support extra args that contain a This could cause issues if a user uses the I could first split the arguments and only do the replacement in the entry following See: typst_pyimage/typst_pyimage/__main__.py Line 41 in 9c7c64b
|
patrick-kidger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit aside this looks awesome to me! Thank you for contributing this.
Do you want to bump the version number in pyproject.toml as well? Then we can do a new release with this functionality.
I think the current implementation seems good enough for now! If use-cases emerge for needing something else then we can tweak things then. |
|
@patrick-kidger Since we are introducing breaking changes to the CLI commands (moving from |
Breaking changes to the CLI commands. Moving from `typst_pyimage compile/watch` to `typst_pyimage --compile/--watch`.
|
I just got a notification about this -- sorry, it looks like I missed your updates to this one! Since you mention it, why change from e.g. (Either way I think the |
No worries, life happens! You are right, I found a way to make things cleaner with subcommands. Let me know what you think. |
|
I think it looks good! I have no comments -- if you can fix the pre-commit failures (probably just a matter of |
Should be good to go! Thanks! |
|
Wonderful stuff! Merged. Thank you for your efforts -- and for your patience! -- on this one :D |
No worries! Thank you for your great package! |
Context
I use a typst template which is stored somewhere on my computer. I therefore need to update the typst root with the
--rootargument when I compile or watch a typst file. I needed a way to pass extra arguments to typst through the python package.Solution
I updated/improved the parsing of the CLI arguments.
argparsepython packageChanges
The way to execute commands was changed a bit. The README has been updated accordingly. Here is the new CLI: