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

How to get scrollable code boxes in generated PDFs, or at least remove line breaks from wrapped lines in code boxes? #115

Open
Binarus opened this issue Oct 29, 2022 · 0 comments

Comments

@Binarus
Copy link

Binarus commented Oct 29, 2022

I am completely new to mkdocs and its plugins. I am currently writing a documentation that contains code blocks with some very long lines. I am using the material theme. The code blocks are showing as expected on the HTML pages. That is, they have a horizontal scroll bar if they contain lines that are too long to fit into the page width. That horizontal scroll bar can be operated as usual.

Is it possible to have such (horizontally) scrollable code blocks in the generated PDF documents as well?

Currently, the code blocks in the PDF wrap long lines, which imposes two problems:

First, it is very worrying for persons who read the PDF, because in code blocks they can't see whether a new line actually is a new line or is the continuation of the line above.

Second, when copying a wrapped long line from a code block in the PDF, the copied text contains line breaks where the line has been wrapped. This makes people unable to use the copied text directly, e.g. to paste it into a terminal as a new command line, without having to alter it before.

If we can't have scrollable code blocks in the PDF (but I still hope we can), what do I need to do to at least remove the line breaks mentioned above?

Thank you very much in advance, and best regards,

Binarus

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

No branches or pull requests

1 participant