-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add config option to disable print html, css, and icon #1169
Conversation
No issues. We are open to config changes |
Yea, seems fine. Just one minor thing, I kinda prefer to avoid double negatives (no-foo=false). Maybe make the option name "print-enabled" with a default of Also, I'm just curious, what's your motivation for this? |
Just one comment about this PR: I see that it completely disables the "print.css" - is this a good thing to do? To answer the motivation question, at least from my standpoint: First, I must say It is super great that this feature exists in the first place - I usually want it enabled. The general use case for disabling it, is to prevent the ease of copyright violation. Sometimes we use mdbook to build a static site, and like most other websites, we do not want to provide a "download the entire site as PDF" option. If you want to read it, you come here. A more particular use case I have (but with the same principle), is that I want to share a book that is normally only used internally, with someone external for a short period for review. The material is confidential, and should not be downloaded, only read. |
@ehuss I changed the config setting to be a subtable. I think this is better because we can add extra settings later if we want and it mirrors the way |
I would kinda prefer to avoid adding a new subtable, unless there is some expectation that there will actually be additional keys. If in the future we decide we need additional keys, we can always upgrade it to a subtable. I think a simple |
I don't need this anymore and I don't think I have time to continue working on this PR. Someone else is welcome to branch off this and open a new PR. |
Hi, can I know why this PR is closed without merging the feature of disable printing to master branch? |
I'll go ahead and merge. The implementation looks good, and I don't feel too strongly about whether or not the config is a separate table. I can imagine extra print options being added in the future. |
Thanks @ehuss for the quick response. I can now use the following to disable the print option. [output.html.print]
enable = false But, the print button at top-right is still visible, yeah I agree on clicking it returns 404, as |
@kalindkaria Oops, thanks for checking! I should have reviewed more closely, there is a |
Yes! @ehuss Thanks alot for adding this feature. |
This PR adds a new config option which allows you to disable all "print" support.
Resolves #1177