public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Gabriel Volpe <volpegabriel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: [EPUB] - Avoid horizontal scrollbar when code lines overflow?
Date: Thu, 17 Oct 2019 11:10:06 -0500	[thread overview]
Message-ID: <CAJReL37QpX0Shh6rbu7huDEucOGvB=HQSbfdeJaKW1981FCRrQ@mail.gmail.com> (raw)
In-Reply-To: <CADAJKhAf9_yqjT6ayEDpz7UEB_tmXLRUSoK6WiEYPUDgcEG9ww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 10137 bytes --]

Thanks for looking into it!

It might be hard-coded, I don't see any reference to `.sourceCode` here:
https://github.com/jgm/pandoc/blob/master/data/epub.css

On Thu, 17 Oct 2019 at 11:04, BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> I'll have to look into the default epub template. Probably Pandoc's
> default rule is hard-coded in such a way that it overrides the CSS you add
> with `--css`. Possibly you will have to use a custom template.
>
> Meanwhile try changing ` white-space: pre-wrap;` into ` white-space:
> pre-wrap !important;`
>
> Den tors 17 okt. 2019 17:19Gabriel Volpe <volpegabriel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>
>> Thank you very much, that worked!
>>
>> Now I need to figure out how to override it directly in the CSS before
>> generating the EPUB with Pandoc :D
>>
>> I have this in my custom CSS that I pass to Pandoc as an argument of --css
>>
>> code.sourceCode {
>>   white-space: pre-wrap;
>>   position: relative;
>> }
>>
>> But the generated EPUB doesn't seem to pick it up, any ideas?
>>
>> On Thu, 17 Oct 2019 at 10:04, BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>>> I'm not at a computer at the moment but I think that if you change `pre`
>>> into `pre-wrap` on line 13 you will be good.
>>>
>>> Den tors 17 okt. 2019 14:41Gabriel Volpe <volpegabriel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
>>>
>>>> It seems to be caused by the CSS supplied by Pandoc.
>>>>
>>>> I found this SO Thread
>>>> <https://stackoverflow.com/questions/57812345/line-break-symbol-automatically-added-inside-a-code-environment-when-a-line-is>
>>>> about it but none of the suggested solutions worked for me.
>>>>
>>>> Here's one single small HTML page taken from the Pandoc generated EPUB
>>>> file that has the relevant `sourceCode` CSS.
>>>>
>>>> https://pastebin.com/DPczzLar
>>>>
>>>> Thanks for helping!
>>>> Gabriel.
>>>>
>>>> On Thu, 17 Oct 2019 at 03:19, BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>>
>>>>> Do you think it is caused by some CSS which is supplied by Pandoc or
>>>>> do you add any CSS of your own? If the latter would you mind sending the
>>>>> CSS so we can have a look at it? (Off list is OK but be warned that my CSS
>>>>> knowledge is a bit stale. It is probably nothing complicated though.)
>>>>>
>>>>> Den tors 17 okt. 2019 03:17Gabriel Volpe <volpegabriel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>> skrev:
>>>>>
>>>>>> It is definitely CSS related but I'm just really dumb when it comes
>>>>>> to manipulate CSS, would appreciate any help.
>>>>>>
>>>>>> On Wed, Oct 16, 2019, 18:25 Gabriel Volpe <volpegabriel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>> wrote:
>>>>>>
>>>>>>> I have converted the Pandoc generated EPUB to EPUB once again using
>>>>>>> Calibre and it renders properly. When I resize the screen there's no
>>>>>>> scrollbar.
>>>>>>>
>>>>>>> On Wed, 16 Oct 2019 at 18:20, Gabriel Volpe <volpegabriel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> It might be. I'm not really sure, to be honest.
>>>>>>>>
>>>>>>>> On Wed, 16 Oct 2019 at 18:18, BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>>>>>>
>>>>>>>>> Isn't that an issue with the way your epub reader displays things
>>>>>>>>> rather than with Pandoc?
>>>>>>>>>
>>>>>>>>> Den ons 16 okt. 2019 23:41Gabriel Volpe <volpegabriel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>>>>> skrev:
>>>>>>>>>
>>>>>>>>>> Hi, is there any way to avoid having horizontal scrollbars in
>>>>>>>>>> code highlightings? I would prefer the text to be rendered in different
>>>>>>>>>> lines instead like MOBI does it.
>>>>>>>>>>
>>>>>>>>>> [image: scrollbar.png]
>>>>>>>>>>
>>>>>>>>>> I couldn't find anything related information in Pandoc's manual.
>>>>>>>>>> While searching on Google, I stumbled upon this blog post
>>>>>>>>>> <https://cmichel.io/how-to-create-beautiful-epub-programming-ebooks/>
>>>>>>>>>> which advices to convert first to HTML and then use Calibre to convert to
>>>>>>>>>> EPUB but I've tried it and I didn't like it.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> Gabriel.
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>> Google Groups "pandoc-discuss" group.
>>>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>>>> send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>>>>>>> To view this discussion on the web visit
>>>>>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/93a42423-c2c0-4350-b59c-42722cc2dd2e%40googlegroups.com
>>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/93a42423-c2c0-4350-b59c-42722cc2dd2e%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>>> .
>>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> You received this message because you are subscribed to a topic in
>>>>>>>>> the Google Groups "pandoc-discuss" group.
>>>>>>>>> To unsubscribe from this topic, visit
>>>>>>>>> https://groups.google.com/d/topic/pandoc-discuss/LSJ4WHOki-k/unsubscribe
>>>>>>>>> .
>>>>>>>>> To unsubscribe from this group and all its topics, send an email
>>>>>>>>> to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>>>>>> To view this discussion on the web visit
>>>>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhDTGLozWoY3KnJNEQ%3DQFSrsRt07JoKHprf-hm6rehCzpQ%40mail.gmail.com
>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhDTGLozWoY3KnJNEQ%3DQFSrsRt07JoKHprf-hm6rehCzpQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>>> .
>>>>>>>>>
>>>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "pandoc-discuss" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/CAJReL34Kv%2Bhj8yZeajmGLoLdXonSYs0jtx8RRAU3x98wXucYwA%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CAJReL34Kv%2Bhj8yZeajmGLoLdXonSYs0jtx8RRAU3x98wXucYwA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to a topic in the
>>>>> Google Groups "pandoc-discuss" group.
>>>>> To unsubscribe from this topic, visit
>>>>> https://groups.google.com/d/topic/pandoc-discuss/LSJ4WHOki-k/unsubscribe
>>>>> .
>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>> pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBz_QZwY%3DtADQLVm_HdUSicEo8g10BPHu2esVKi7Fb7AQ%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBz_QZwY%3DtADQLVm_HdUSicEo8g10BPHu2esVKi7Fb7AQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "pandoc-discuss" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/pandoc-discuss/CAJReL34fkofrhE2xys-z%3DLS1NGOg65zO7ydpvOeq7qeqd-BquA%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CAJReL34fkofrhE2xys-z%3DLS1NGOg65zO7ydpvOeq7qeqd-BquA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "pandoc-discuss" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/pandoc-discuss/LSJ4WHOki-k/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBLfROtLxFbqQMAHeTTNNf972XVY%2BUKiPcBR8HW7KiiLA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBLfROtLxFbqQMAHeTTNNf972XVY%2BUKiPcBR8HW7KiiLA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "pandoc-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pandoc-discuss/CAJReL34K8E9UuBg5iQJhDRhev__S0LFwFBi5LTdd5j231JRiWw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/CAJReL34K8E9UuBg5iQJhDRhev__S0LFwFBi5LTdd5j231JRiWw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "pandoc-discuss" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/pandoc-discuss/LSJ4WHOki-k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAf9_yqjT6ayEDpz7UEB_tmXLRUSoK6WiEYPUDgcEG9ww%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAf9_yqjT6ayEDpz7UEB_tmXLRUSoK6WiEYPUDgcEG9ww%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAJReL37QpX0Shh6rbu7huDEucOGvB%3DHQSbfdeJaKW1981FCRrQ%40mail.gmail.com.

[-- Attachment #1.2: Type: text/html, Size: 16169 bytes --]

[-- Attachment #2: scrollbar.png --]
[-- Type: image/png, Size: 186702 bytes --]

  parent reply	other threads:[~2019-10-17 16:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16 21:40 Gabriel Volpe
     [not found] ` <93a42423-c2c0-4350-b59c-42722cc2dd2e-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-10-16 23:10   ` BPJ
     [not found]     ` <CADAJKhDTGLozWoY3KnJNEQ=QFSrsRt07JoKHprf-hm6rehCzpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-16 23:20       ` Gabriel Volpe
     [not found]         ` <CAJReL36yu7O+=Fr3YJwhrWFp_4rY-sJqPZB1zq25Zvw_o2wZeg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-16 23:25           ` Gabriel Volpe
     [not found]             ` <CAJReL36m=JhQyBLUp2mXCLoJF7Fu9911f2erD9od8HXZhZa4jw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-17  1:16               ` Gabriel Volpe
     [not found]                 ` <CAJReL34Kv+hj8yZeajmGLoLdXonSYs0jtx8RRAU3x98wXucYwA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-17  8:19                   ` BPJ
     [not found]                     ` <CADAJKhBz_QZwY=tADQLVm_HdUSicEo8g10BPHu2esVKi7Fb7AQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-17 12:40                       ` Gabriel Volpe
     [not found]                         ` <CAJReL34fkofrhE2xys-z=LS1NGOg65zO7ydpvOeq7qeqd-BquA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-17 15:03                           ` BPJ
     [not found]                             ` <CADAJKhBLfROtLxFbqQMAHeTTNNf972XVY+UKiPcBR8HW7KiiLA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-17 15:18                               ` Gabriel Volpe
     [not found]                                 ` <CAJReL34K8E9UuBg5iQJhDRhev__S0LFwFBi5LTdd5j231JRiWw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-17 16:04                                   ` BPJ
     [not found]                                     ` <CADAJKhAf9_yqjT6ayEDpz7UEB_tmXLRUSoK6WiEYPUDgcEG9ww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-17 16:10                                       ` Gabriel Volpe [this message]
     [not found]                                         ` <CAJReL37QpX0Shh6rbu7huDEucOGvB=HQSbfdeJaKW1981FCRrQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-17 16:41                                           ` John MacFarlane
     [not found]                                             ` <yh480klftjiat4.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-10-17 16:46                                               ` Gabriel Volpe
     [not found]                                                 ` <CAJReL36_hH9eg=kc-dLzmQFh45CgCNy4bKKXm6Zz0Di4fTCQKA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-17 16:51                                                   ` Gabriel Volpe
2019-10-17 18:36                                               ` Benct Philip Jonsson
     [not found]                                                 ` <6c954294-0a89-f2d9-64ec-ba96aead243e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-10-17 18:54                                                   ` Gabriel Volpe
     [not found]                                                     ` <CAJReL36vJHDt-vd0SQsEfNhWUZLRJZzsxaWF58YsTK-kEoZ8XA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-17 20:00                                                       ` BPJ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJReL37QpX0Shh6rbu7huDEucOGvB=HQSbfdeJaKW1981FCRrQ@mail.gmail.com' \
    --to=volpegabriel-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).