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 option to exclude pages #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JosuaMeier
Copy link

Would be nice to have the option to exclude pages from output file.

@aporan
Copy link
Contributor

aporan commented Jul 8, 2020

@JosuaMeier hiya, another fellow plugin user here. Although adding it here would be nice, but i figured out the same result by using patterns in vuepress config:

  patterns: process.env.EXPORT_PDF === 'True' ? ['**/*.md', '**/*.vue', '!**/openapi.md', "!*/index.md", "!index.md"] :  ['**/*.md', '**/*.vue'],

@JosuaMeier
Copy link
Author

@aporan Thx for your response.

If I use the your pattern snippet, its not working. process.env.EXPORT_PDF is undefined. Where do I have to provide this variable.
If it is as easy as you mentioned, I would surely prefer your solution.

Sorry, I am very new on the VuePress topic. (1 day) 🙈

@aporan
Copy link
Contributor

aporan commented Jul 8, 2020 via email

@JosuaMeier
Copy link
Author

@aporan Yeah, works perfectly. No need for this pull request. Thank you.

@JosuaMeier JosuaMeier closed this Jul 8, 2020
@Igloczek
Copy link
Contributor

Igloczek commented Jul 8, 2020

Hi, thanks for this contribution!
I'll open this PR to keep in mind to add this feature, because I need it too.
Currently, since I'm building sidebar links programmatically, I'm filtering pages here, so including it into the plugin itself will be nicer.

@Igloczek Igloczek reopened this Jul 8, 2020
@markmcdowell
Copy link

FYI, I didn't really want to have to create an env. variable so i did this instead:

patterns: process.argv.includes("export") ? ["**/api/**/*.md", '**/*.vue'] : ['**/*.md', '**/*.vue']

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.

4 participants