newline in pldoc (html server)

31 views
Skip to first unread message

nicos.ang...@gmail.com

unread,
Sep 12, 2017, 8:50:09 AM9/12/17
to SWI-Prolog

Dear Jan, all,

Is there a pldoc markup to produce a new line in html ?
Manual page: /pldoc/doc_for?object=section('packages/pldoc.html')
makes a reference, among others, to: [markdown]http://en.wikipedia.org/wiki/Markdown
where is reported that a double space at end of sentence produces <br>


Thanks in advance,

Nicos Angelopoulos
---
http://stoics.org.uk/~nicos

PS. currently interrogating the manual at sw-prolog.org raises a:

Error 503 first byte timeout



Jan Wielemaker

unread,
Sep 12, 2017, 1:53:53 PM9/12/17
to nicos.ang...@gmail.com, SWI-Prolog
Hi Nicos,

On 09/12/2017 02:50 PM, nicos.ang...@gmail.com wrote:
>
> Dear Jan, all,
>
> Is there a pldoc markup to produce a new line in html ?
> Manual page: /pldoc/doc_for?object=section('packages/pldoc.html')
> makes a reference, among others, to: [
> <http://localhost:3003/pldoc/[>markdown]http://en.wikipedia.org/wiki/Markdown
> where is reported that a double space at end of sentence produces <br>

I don't recall that is provided. In what context do you want it? I
have some doubt about a double space at the end of the line. Notably
Git sees spaces at the end of the line as `white space errors' and
thus editors code tend to delete those.

Cheers --- Jan

> Thanks in advance,
>
> Nicos Angelopoulos
> ---
> http://stoics.org.uk/~nicos
>
> PS. currently interrogating the manual at sw-prolog.org raises a:
>
>
> Error 503 first byte timeout

Can't reproduce that. There is a pending issue with searches that
produce many results. The search itself is far sub-second, but
doing all the HTML rendering for 1000+ results takes longer than
fastly is willing to wait.

Nicos Angelopoulos

unread,
Sep 12, 2017, 4:02:09 PM9/12/17
to Jan Wielemaker, SWI-Prolog

Hi Jan,

Thanks for the quick reply.

On Tue, 12 Sep 2017 19:53:49 +0200
Jan Wielemaker <J.Wiel...@vu.nl> wrote:

> Hi Nicos,
>
> > Is there a pldoc markup to produce a new line in html ?
> > Manual page: /pldoc/doc_for?object=section('packages/pldoc.html')
> > makes a reference, among others, to: [
> > <http://localhost:3003/pldoc/[>markdown]http://en.wikipedia.org/wiki/Markdown
> > where is reported that a double space at end of sentence produces <br>
>
> I don't recall that is provided. In what context do you want it? I
> have some doubt about a double space at the end of the line. Notably
> Git sees spaces at the end of the line as `white space errors' and
> thus editors code tend to delete those.
>

i don't care how it is provided. i just would like to have the facility.
i have the following opening, predicate documentation paragraph,

Replace a column in a Mtx. When there is no NewClmName (or when it is an unbound variable),
then the existing column name is used.
NewClmName can be atomic or a compound, when the latter it is called with =|NewClmName(ClmName,New)|=
where _New_ is used as the new column name. NewVal could be a list of values, (equal length as Cid's?);
a _|@(Goal)|_ term where _Goal_ will be maplist applied to Cid's elements to produce the new values; _Goal_ which ...



if i view this in a browser which usually has quite wide view, it all becomes long lines that
don't look very good. i would like to break the paragraph with newlines without creating a new paragraph.



say i would like a <br> after "is used.". Seems like a reasonable thing to want ?


> Cheers --- Jan
>
> > Thanks in advance,
> >
> > Nicos Angelopoulos
> > ---
> > http://stoics.org.uk/~nicos
> >
> > PS. currently interrogating the manual at sw-prolog.org raises a:
> >
> >
> > Error 503 first byte timeout
>
> Can't reproduce that. There is a pending issue with searches that
> produce many results. The search itself is far sub-second, but
> doing all the HTML rendering for 1000+ results takes longer than
> fastly is willing to wait.

i am sure it was either network or load-strain error
was working fine few minutes before i got a few of those (503 errors)


thanks

Nicos

Jan Wielemaker

unread,
Sep 13, 2017, 7:30:13 AM9/13/17
to Nicos Angelopoulos, SWI-Prolog
On 09/12/2017 10:02 PM, Nicos Angelopoulos wrote:
> i don't care how it is provided. i just would like to have the
> facility. i have the following opening, predicate documentation
> paragraph,
>
> Replace a column in a Mtx. When there is no NewClmName (or when it is
> an unbound variable), then the existing column name is used.
> NewClmName can be atomic or a compound, when the latter it is called
> with =|NewClmName(ClmName,New)|= where_New_ is used as the new
> column name. NewVal could be a list of values, (equal length as
> Cid's?); a _|@(Goal)|_ term where_Goal_ will be maplist applied to
> Cid's elements to produce the new values;_Goal_ which ...
>
> if i view this in a browser which usually has quite wide view, it all
> becomes long lines that don't look very good. i would like to break
> the paragraph with newlines without creating a new paragraph.
>
> say i would like a <br> after "is used.". Seems like a reasonable
> thing to want ?

It is a matter of taste ...

I had a look. We have `official' markdown which does two spaces. That
seems a bad idea. Not only would it require significant changes to
PlDoc's markdown parser as tokenizing and normalization happens very
early in the process. Of course everything is possible, but re-format
and space normalization in program editors tend to remove trailing
spaces. Then we have GFM (Github Flavoured Markdown), which uses a
normal line break. We cannot use that as source code typically already
uses line breaks in comments.

One option would be <br/> (Wikipedia), but that does suggest HTML support
which is not in Markdown and I do not want it there either. Doxygen does
support HTML. Possibly the best is to allow for <br>, but only at the end
of the physical line? I'll give that a try.

--- Jan



Nicos Angelopoulos

unread,
Sep 13, 2017, 5:28:20 PM9/13/17
to Jan Wielemaker, SWI-Prolog

hi Jan,


On Wed, 13 Sep 2017 13:29:37 +0200
Jan Wielemaker <J.Wiel...@vu.nl> wrote:

> > if i view this in a browser which usually has quite wide view, it all
> > becomes long lines that don't look very good. i would like to break
> > the paragraph with newlines without creating a new paragraph.
> >
> > say i would like a <br> after "is used.". Seems like a reasonable
> > thing to want ?
>
> It is a matter of taste ...
>

not if you don't have the option ...
but you are right, trying to do the formatting can be counter productive
in general though a way to put a new line seems ok to give to users

> I had a look. We have `official' markdown which does two spaces. That
> seems a bad idea. Not only would it require significant changes to
> PlDoc's markdown parser as tokenizing and normalization happens very
> early in the process. Of course everything is possible, but re-format
> and space normalization in program editors tend to remove trailing
> spaces. Then we have GFM (Github Flavoured Markdown), which uses a
> normal line break. We cannot use that as source code typically already
> uses line breaks in comments.
>
> One option would be <br/> (Wikipedia), but that does suggest HTML support
> which is not in Markdown and I do not want it there either. Doxygen does
> support HTML. Possibly the best is to allow for <br>, but only at the end
> of the physical line? I'll give that a try.
>
> --- Jan
>
>

>
thanks a lot for sorting this out
i am not familiar with any markdown conventions
this option seems perfectly fine to me

i just tested and it is working. so all is good

thanks again,


Nicos


Reply all
Reply to author
Forward
0 new messages