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

Can we make code blocks scrollable in the generated PDF file? #133

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

Can we make code blocks scrollable in the generated PDF file? #133

Binarus opened this issue Oct 28, 2022 · 0 comments

Comments

@Binarus
Copy link

Binarus commented Oct 28, 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.

What do I need to do to get such (horizontally) scrollable code blocks in the generated PDF documents as well? Is this possible at all?

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

First, it is very worrying for the reader, because we can't see whether a new line is the continuation of the line above or is really a new line.

Second, when copying a wrapped long line from the PDF, the copied text contains line breaks where the lines have been wrapped. This should not be the case. The user should be able to copy such lines from the PDF and to paste them somewhere without having to alter them.

If we can't have scrollable code blocks in the PDF (but I still hope we can), what do I need to do to 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