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

feat: add export options in frontmatter and to build args #841

Merged
merged 3 commits into from
Jan 25, 2023

Conversation

tonai
Copy link
Contributor

@tonai tonai commented Jan 23, 2023

Fixes #838

Add export args to build command.
We can then set export args when building with download: true.
Example:

slidev build --dark --with-clicks # both are export options

Also add export CLI args (except entry and theme) in frontmatter.
These options will be taken into account when running slidev export or slidev build (with download: true).
Example

exportOptions:
  dark: true
  withClicks: true

CLI options will take precedence over frontmatter options.

@tonai
Copy link
Contributor Author

tonai commented Jan 23, 2023

Needs doc update

@tonai
Copy link
Contributor Author

tonai commented Jan 23, 2023

Should we need to be able to set some exportOptions options in the theme frontmatter ?

@@ -14,6 +14,7 @@ export function resolveConfig(headmatter: any, themeMeta: SlidevThemeMeta = {},
remoteAssets: false,
monaco: 'dev',
download: false,
exportOptions: {} as ResolvedExportOptions,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
exportOptions: {} as ResolvedExportOptions,
export: {} as ResolvedExportOptions,

This would do I think

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright.
Updated.

@antfu antfu merged commit 3d40cfd into main Jan 25, 2023
@antfu antfu deleted the feat/export-options branch January 25, 2023 10:07
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.

Pass PDF export flags to SPA download
2 participants