Skip to content
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

Make public improved API interface for Node.js #260

Merged
merged 9 commits into from
Jul 24, 2020
Merged

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Jul 19, 2020

The undocumented Marp CLI's API interface, that is used in Marp for VS Code, is hard to use by several reason:

  • It does never respond whenever there is not added --no-stdin argument manually, and it is not documented too.
  • CLIError has not thrown because it would be catched to display error into users. Developer has to rely to the exit code 0 or 1 that has limited informations.

By these reasons, Marp for VS Code often shows helpless error Marp CLI throwed unexpected error with exit code 1. By googling Marp for VS Code that message shows as related search keyword. 😭

So I've improved API interface, to throw any kind of errors that includes CLIError. In addition, some CLIErrors have discriminable exit code.

The default stdin option will change from running which interface, CLI (=true) or API (=false).

ToDo

  • Add tests for API interface

@yhatt yhatt changed the title Improve API interface Make public improved API interface for Node.js Jul 24, 2020
@yhatt yhatt merged commit 89e1e91 into master Jul 24, 2020
@yhatt yhatt deleted the improve-api-interface branch July 24, 2020 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant