public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* long urls in biblio, how to break
@ 2022-02-07 20:06 Antonio Piccolboni
       [not found] ` <73c2f227-7945-4410-bccf-e264ea5a8b03n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Antonio Piccolboni @ 2022-02-07 20:06 UTC (permalink / raw)
  To: pandoc-discuss


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

Hi, 
I am writing a document in markdown with the bibliography in biblatex, with 
a target of generating epub, html and pdf. I have many bibliographical 
entries containing long urls that display poorly in epub because they are 
not broken over several lines with sufficient flexibility, for instance at 
"/" or other separators. I thought of inserting <wbr> or zero width spaces 
with a filter, but they all display verbatim in epub. Suggestions? Thanks


Antonio

-- 
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/73c2f227-7945-4410-bccf-e264ea5a8b03n%40googlegroups.com.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long urls in biblio, how to break
       [not found] ` <73c2f227-7945-4410-bccf-e264ea5a8b03n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-02-07 20:39   ` Paulo Ney de Souza
  2022-02-07 21:16   ` John MacFarlane
  1 sibling, 0 replies; 6+ messages in thread
From: Paulo Ney de Souza @ 2022-02-07 20:39 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 2582 bytes --]

Your problem is not really with Pandoc, but a much more basic one --
URL's are not made to be displayed.

The reasons are many:

First of all, they can be as long as necessary; and it is not uncommon to
see URLs that encode sessions and are many lines long -- what is the use of
displaying such a beast?

Many of them are also of NO use to someone else -- they are tied to a
session and can be used only under specific circumstances.

Even if your URL is small -- let's say under 40 characters. Who is going to
read that thing on an ePub file and type it elsewhere -- without committing
a single mistake?

URLs are one of the underpinnings of the Web. They are supposed to be used
to create links in other parts of your text, like, for example, in the
title of your bibliographical entry. And for that specific purpose, they
can be as long as you wish.

Displaying an URL in print (or ePub) is equivalent to walking around
showing your underwear. It is not what is made for.

Paulo Ney





On Mon, Feb 7, 2022 at 12:07 PM Antonio Piccolboni <piccolbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:

> Hi,
> I am writing a document in markdown with the bibliography in biblatex,
> with a target of generating epub, html and pdf. I have many bibliographical
> entries containing long urls that display poorly in epub because they are
> not broken over several lines with sufficient flexibility, for instance at
> "/" or other separators. I thought of inserting <wbr> or zero width spaces
> with a filter, but they all display verbatim in epub. Suggestions? Thanks
>
>
> Antonio
>
> --
> 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/73c2f227-7945-4410-bccf-e264ea5a8b03n%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/73c2f227-7945-4410-bccf-e264ea5a8b03n%40googlegroups.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/CAFVhNZP17AKD8rq4VH693f9%2B%3DgJu%2B6drCgrGJNaRNC4nVvpkYg%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 3596 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long urls in biblio, how to break
       [not found] ` <73c2f227-7945-4410-bccf-e264ea5a8b03n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  2022-02-07 20:39   ` Paulo Ney de Souza
@ 2022-02-07 21:16   ` John MacFarlane
       [not found]     ` <yh480k5ypqnzr6.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
  1 sibling, 1 reply; 6+ messages in thread
From: John MacFarlane @ 2022-02-07 21:16 UTC (permalink / raw)
  To: Antonio Piccolboni, pandoc-discuss


Take a look at the native output.  If these links have some
distinguishing feature like a `uri` class, then you could try
adding the CSS

.uri { word-break: break-all; }

More here:
https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/

If the links don't have a distinguishing feature (I suppose it
would have been added by citeproc), then you could use a Lua
filter to identify links to URLs and add the uri class.

Antonio Piccolboni <piccolbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hi, 
> I am writing a document in markdown with the bibliography in biblatex, with 
> a target of generating epub, html and pdf. I have many bibliographical 
> entries containing long urls that display poorly in epub because they are 
> not broken over several lines with sufficient flexibility, for instance at 
> "/" or other separators. I thought of inserting <wbr> or zero width spaces 
> with a filter, but they all display verbatim in epub. Suggestions? Thanks
>
>
> Antonio
>
> -- 
> 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/73c2f227-7945-4410-bccf-e264ea5a8b03n%40googlegroups.com.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long urls in biblio, how to break
       [not found]     ` <yh480k5ypqnzr6.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2022-02-07 21:24       ` Antonio Piccolboni
       [not found]         ` <0085d270-5152-4a4d-96f3-872750ff5343n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Antonio Piccolboni @ 2022-02-07 21:24 UTC (permalink / raw)
  To: pandoc-discuss


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

Thanks, this is one typical entry in the epub output (which is an archive 
format which contains several xhtml files)

<div id="ref-openai-triton" class="csl-entry" role="doc-biblioentry">

AI, Open. 2021. <span>“Introducing Triton: Open-Source GPU Programming for 
Neural Networks.”</span> 2021. <a 
href="https://web.archive.org/web/20220112220248/https://openai.com/blog/triton/">https://web.archive.org/web/20220112220248/https://openai.com/blog/triton/</a>.

</div>
My guess is that your idea won't work quite literally but a variant thereof 
could do it, I will experiment with it, thanks.


Antonio
On Monday, February 7, 2022 at 1:17:38 PM UTC-8 John MacFarlane wrote:

>
> Take a look at the native output. If these links have some
> distinguishing feature like a `uri` class, then you could try
> adding the CSS
>
> .uri { word-break: break-all; }
>
> More here:
>
> https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/
>
> If the links don't have a distinguishing feature (I suppose it
> would have been added by citeproc), then you could use a Lua
> filter to identify links to URLs and add the uri class.
>
> Antonio Piccolboni <picc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > Hi, 
> > I am writing a document in markdown with the bibliography in biblatex, 
> with 
> > a target of generating epub, html and pdf. I have many bibliographical 
> > entries containing long urls that display poorly in epub because they 
> are 
> > not broken over several lines with sufficient flexibility, for instance 
> at 
> > "/" or other separators. I thought of inserting <wbr> or zero width 
> spaces 
> > with a filter, but they all display verbatim in epub. Suggestions? Thanks
> >
> >
> > Antonio
> >
> > -- 
> > 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/73c2f227-7945-4410-bccf-e264ea5a8b03n%40googlegroups.com
> .
>

-- 
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/0085d270-5152-4a4d-96f3-872750ff5343n%40googlegroups.com.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long urls in biblio, how to break
       [not found]         ` <0085d270-5152-4a4d-96f3-872750ff5343n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-02-07 21:49           ` Antonio Piccolboni
       [not found]             ` <824bc1d6-71c1-4c87-8004-ca2e23ee6b2fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Antonio Piccolboni @ 2022-02-07 21:49 UTC (permalink / raw)
  To: pandoc-discuss


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


Works in the browser,  but not in apple books, which ignores any number of 
css features that I have tried in the past.

On Monday, February 7, 2022 at 1:24:14 PM UTC-8 Antonio Piccolboni wrote:

> Thanks, this is one typical entry in the epub output (which is an archive 
> format which contains several xhtml files)
>
> <div id="ref-openai-triton" class="csl-entry" role="doc-biblioentry">
>
> AI, Open. 2021. <span>“Introducing Triton: Open-Source GPU Programming for 
> Neural Networks.”</span> 2021. <a href="
> https://web.archive.org/web/20220112220248/https://openai.com/blog/triton/
> ">
> https://web.archive.org/web/20220112220248/https://openai.com/blog/triton/
> </a>.
>
> </div>
> My guess is that your idea won't work quite literally but a variant 
> thereof could do it, I will experiment with it, thanks.
>
>
> Antonio
> On Monday, February 7, 2022 at 1:17:38 PM UTC-8 John MacFarlane wrote:
>
>>
>> Take a look at the native output. If these links have some 
>> distinguishing feature like a `uri` class, then you could try 
>> adding the CSS 
>>
>> .uri { word-break: break-all; } 
>>
>> More here: 
>>
>> https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/ 
>>
>> If the links don't have a distinguishing feature (I suppose it 
>> would have been added by citeproc), then you could use a Lua 
>> filter to identify links to URLs and add the uri class. 
>>
>> Antonio Piccolboni <picc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes: 
>>
>> > Hi, 
>> > I am writing a document in markdown with the bibliography in biblatex, 
>> with 
>> > a target of generating epub, html and pdf. I have many bibliographical 
>> > entries containing long urls that display poorly in epub because they 
>> are 
>> > not broken over several lines with sufficient flexibility, for instance 
>> at 
>> > "/" or other separators. I thought of inserting <wbr> or zero width 
>> spaces 
>> > with a filter, but they all display verbatim in epub. Suggestions? 
>> Thanks 
>> > 
>> > 
>> > Antonio 
>> > 
>> > -- 
>> > 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/pandoc-discuss/73c2f227-7945-4410-bccf-e264ea5a8b03n%40googlegroups.com. 
>>
>>
>

-- 
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/824bc1d6-71c1-4c87-8004-ca2e23ee6b2fn%40googlegroups.com.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: long urls in biblio, how to break
       [not found]             ` <824bc1d6-71c1-4c87-8004-ca2e23ee6b2fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-09-17  1:09               ` Antonio Piccolboni
  0 siblings, 0 replies; 6+ messages in thread
From: Antonio Piccolboni @ 2022-09-17  1:09 UTC (permalink / raw)
  To: pandoc-discuss


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

After taking a break and more experimenting this is what I am currently 
using

div.csl-entry a {word-break:break-all;}

which was indeed fairly close to John's suggestion.

This keeps the normal word break rules in the biblio, but breaks urls 
because the also happen to be links, and the only links.

Tested in two different Epub readers (Apple's books and calibre viewer). 
I am not sure what made me think Apple books was ignoring my css, it's been 
a while. Possible operator error or the fact that I am using a newer 
version now.
Thanks 


Antonio

On Monday, February 7, 2022 at 1:49:57 PM UTC-8 Antonio Piccolboni wrote:

>
> Works in the browser,  but not in apple books, which ignores any number of 
> css features that I have tried in the past.
>
> On Monday, February 7, 2022 at 1:24:14 PM UTC-8 Antonio Piccolboni wrote:
>
>> Thanks, this is one typical entry in the epub output (which is an archive 
>> format which contains several xhtml files)
>>
>> <div id="ref-openai-triton" class="csl-entry" role="doc-biblioentry">
>>
>> AI, Open. 2021. <span>“Introducing Triton: Open-Source GPU Programming 
>> for Neural Networks.”</span> 2021. <a href="
>> https://web.archive.org/web/20220112220248/https://openai.com/blog/triton/
>> ">
>> https://web.archive.org/web/20220112220248/https://openai.com/blog/triton/
>> </a>.
>>
>> </div>
>> My guess is that your idea won't work quite literally but a variant 
>> thereof could do it, I will experiment with it, thanks.
>>
>>
>> Antonio
>> On Monday, February 7, 2022 at 1:17:38 PM UTC-8 John MacFarlane wrote:
>>
>>>
>>> Take a look at the native output. If these links have some 
>>> distinguishing feature like a `uri` class, then you could try 
>>> adding the CSS 
>>>
>>> .uri { word-break: break-all; } 
>>>
>>> More here: 
>>>
>>> https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/ 
>>>
>>> If the links don't have a distinguishing feature (I suppose it 
>>> would have been added by citeproc), then you could use a Lua 
>>> filter to identify links to URLs and add the uri class. 
>>>
>>> Antonio Piccolboni <picc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes: 
>>>
>>> > Hi, 
>>> > I am writing a document in markdown with the bibliography in biblatex, 
>>> with 
>>> > a target of generating epub, html and pdf. I have many bibliographical 
>>> > entries containing long urls that display poorly in epub because they 
>>> are 
>>> > not broken over several lines with sufficient flexibility, for 
>>> instance at 
>>> > "/" or other separators. I thought of inserting <wbr> or zero width 
>>> spaces 
>>> > with a filter, but they all display verbatim in epub. Suggestions? 
>>> Thanks 
>>> > 
>>> > 
>>> > Antonio 
>>> > 
>>> > -- 
>>> > 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 
>>> > To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/pandoc-discuss/73c2f227-7945-4410-bccf-e264ea5a8b03n%40googlegroups.com. 
>>>
>>>
>>

-- 
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/ffacbfa2-a467-4482-813f-003618494783n%40googlegroups.com.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-17  1:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 20:06 long urls in biblio, how to break Antonio Piccolboni
     [not found] ` <73c2f227-7945-4410-bccf-e264ea5a8b03n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-02-07 20:39   ` Paulo Ney de Souza
2022-02-07 21:16   ` John MacFarlane
     [not found]     ` <yh480k5ypqnzr6.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2022-02-07 21:24       ` Antonio Piccolboni
     [not found]         ` <0085d270-5152-4a4d-96f3-872750ff5343n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-02-07 21:49           ` Antonio Piccolboni
     [not found]             ` <824bc1d6-71c1-4c87-8004-ca2e23ee6b2fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-09-17  1:09               ` Antonio Piccolboni

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).