Re: [racket-users] [racket users] Pollen tag question

2020-10-30 Thread Matthew Butterick


> On Oct 30, 2020, at 1:46 PM, Kevin Forchione  wrote:
> 
> Thanks, Matthew! Understanding dawns. So the padding of lines is relative to 
> the “{“ and not from the beginning of the editor line as I was assuming. How 
> very clever. That makes alignment much easier than I’d thought!  
> 
> Is this mentioned anywhere in the pollen tutorials? I must have missed it.

Yes:

"The Pollen language is a variant of Racket’s own text-processing language, 
called Scribble. Thus, most things that can be done with Scribble syntax can 
also be done with Pollen syntax. For the sake of clarity & brevity, I’ve only 
shown you the highlights here. But if you want the full story, see @ Syntax in 
the Scribble documentation."

https://docs.racket-lang.org/pollen/pollen-command-syntax.html?q=pollen#%28part._.Further_reading%29

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/D63442C4-6339-420A-903D-1547BD013E19%40mbtype.com.


Re: [racket-users] [racket users] Pollen tag question

2020-10-30 Thread Kevin Forchione


> On Oct 30, 2020, at 12:25 PM, Matthew Butterick  wrote:
> 
> Spaces at the beginning of body lines do not appear in the resulting 
> S-expressions, but the column of each line is noticed, and all-space 
> indentation strings are added so the result has the same indentation … If the 
> first string came from the opening { line, it is not prepended with an 
> indentation”

Thanks, Matthew! Understanding dawns. So the padding of lines is relative to 
the “{“ and not from the beginning of the editor line as I was assuming. How 
very clever. That makes alignment much easier than I’d thought!  

Is this mentioned anywhere in the pollen tutorials? I must have missed it.

Kevin 
T

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/2E23F40B-B3D9-495A-ACF6-34447B95A8A1%40gmail.com.


Re: [racket-users] [racket users] Pollen tag question

2020-10-30 Thread Matthew Butterick


> On Oct 29, 2020, at 9:04 PM, Kevin Forchione  wrote:
> 
> I’ve noticed that the elements being sent to a pollen tag don’t preserve the 
> spacing when the text spans multiple lines for any space occurring before 
> characters on the subsequent line, although does preserve the spacing between 
> characters on that line.Is thes intentional?



Yes:

"Spaces at the beginning of body lines do not appear in the resulting 
S-expressions, but the column of each line is noticed, and all-space 
indentation strings are added so the result has the same indentation … If the 
first string came from the opening { line, it is not prepended with an 
indentation"

https://docs.racket-lang.org/scribble/reader.html?q=spaces%20newlines#%28part._.Spaces__.Newlines__and_.Indentation%29

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/3998A523-1ED7-4446-80F4-A860324FA79C%40mbtype.com.


Re: [racket-users] [racket users] Pollen tag question

2020-10-30 Thread Kevin Forchione
If I remove my pollen.rkt from the directory and use:

#lang pollen



   A   B
   C   D

I get:
'(root "A   B" "\n" "C   D”)

But if I use:
#lang pollen
◊(define foo "foo")


   A   B
   C   D

I get:
'(root "   " "A   B" "\n" "   " "C   D")

Ievin

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/54B1567F-7ED0-4236-8220-BA74D4334EBF%40gmail.com.


Re: [racket-users] [racket users] Pollen tag question

2020-10-30 Thread Kevin Forchione


> On Oct 29, 2020, at 9:21 PM, Sorawee Porncharoenwase 
>  wrote:
> 
> Whoops. I meant:
> 
> #lang pollen 
> 
> ◊(define (vb . s) s)
> 
> ◊vb{ A B
>C D}
> and the output is:
> 
> '(" A B" "\n" "   " "C D")
> 
> On Thu, Oct 29, 2020 at 9:19 PM Sorawee Porncharoenwase 
> mailto:sorawee.pw...@gmail.com>> wrote:
> I think the issue is with vb. How does it work?
> 
> If you try
> 
> #lang pollen
> 
> @(define (vb . s) s)
> 
> ◊vb{ A B
>C D}
> you will find that it outputs:
> 
> '(vb " A B"
>  "\n" 
>  "   " 
>  "C D")
> The third element is the space before “C”. It's not discarded.
> 
> Also notice that the "start" of the line is at the marker shown below
> 
> 
> 
> 
> #lang pollen
> 
> @(define (vb . s) s)
> 
> ◊vb{ A B
>  >>>   C D}
> This is due to how @ syntax 
> 
>  works.


Here’s my pollen.rkt:

#lang racket/base
(require pollen/decode pollen/misc/tutorial txexpr
 #;(only-in racket make-list string->number))
(provide (all-defined-out))
(define (root . elements)
   (txexpr 'root empty (decode-elements elements
 #:txexpr-elements-proc decode-paragraphs
 #:string-proc (compose1 smart-quotes smart-dashes

And  here’s an initial test.html.pm:


#lang pollen

   A   B
   C   D

Which produces
'(root "A   B" (br) "C   D")

Now if I add the vb as you’ve done, but don’t use the tag:

#lang pollen
◊(define (vb . s) s)

   A   B
   C   D

I get this:
'(root "A   B" (br) "   " "C   D")


Kevin


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/2202E524-AAC0-44D3-9B4B-C49216733900%40gmail.com.


Re: [racket-users] [racket users] Pollen tag question

2020-10-29 Thread Sorawee Porncharoenwase
Whoops. I meant:

#lang pollen

◊(define (vb . s) s)

◊vb{ A B
   C D}

and the output is:

'(" A B" "\n" "   " "C D")


On Thu, Oct 29, 2020 at 9:19 PM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:

> I think the issue is with vb. How does it work?
>
> If you try
>
> #lang pollen
>
> @(define (vb . s) s)
>
> ◊vb{ A B
>C D}
>
> you will find that it outputs:
>
> '(vb " A B"
>  "\n"
>  "   "
>  "C D")
>
> The third element is the space before “C”. It's not discarded.
>
> Also notice that the "start" of the line is at the marker shown below
>
> #lang pollen
>
> @(define (vb . s) s)
>
> ◊vb{ A B
>  >>>   C D}
>
> This is due to how @ syntax
> 
> works.
>
> On Thu, Oct 29, 2020 at 9:04 PM Kevin Forchione  wrote:
>
>> Hi guys,
>> I’ve noticed that the elements being sent to a pollen tag don’t preserve
>> the spacing when the text spans multiple lines for any space occurring
>> before characters on the subsequent line, although does preserve the
>> spacing between characters on that line.Is thes intentional?
>>
>> For example: Racket 7.8 [cs], latest pollen version:
>>
>> ◊vb{ A B
>>  C D}
>>
>> Regardless of how many spaces are before the C, the tag elements will
>> only return a single space, although it preserves the spacing between C and
>> D.
>>
>> Is that the expected result? It seems counter intuitive, as the spacing
>> before A is preserved.
>>
>> Kevin
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/2ECCF698-BD5D-4421-B28A-EC74471715B6%40gmail.com
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CADcuegsM3io_ZuY9pR8yOcf-UtGS4r57gYSn3R-OTJS1xEW23A%40mail.gmail.com.


Re: [racket-users] [racket users] Pollen tag question

2020-10-29 Thread Sorawee Porncharoenwase
I think the issue is with vb. How does it work?

If you try

#lang pollen

@(define (vb . s) s)

◊vb{ A B
   C D}

you will find that it outputs:

'(vb " A B"
 "\n"
 "   "
 "C D")

The third element is the space before “C”. It's not discarded.

Also notice that the "start" of the line is at the marker shown below

#lang pollen

@(define (vb . s) s)

◊vb{ A B
 >>>   C D}

This is due to how @ syntax

works.

On Thu, Oct 29, 2020 at 9:04 PM Kevin Forchione  wrote:

> Hi guys,
> I’ve noticed that the elements being sent to a pollen tag don’t preserve
> the spacing when the text spans multiple lines for any space occurring
> before characters on the subsequent line, although does preserve the
> spacing between characters on that line.Is thes intentional?
>
> For example: Racket 7.8 [cs], latest pollen version:
>
> ◊vb{ A B
>  C D}
>
> Regardless of how many spaces are before the C, the tag elements will only
> return a single space, although it preserves the spacing between C and D.
>
> Is that the expected result? It seems counter intuitive, as the spacing
> before A is preserved.
>
> Kevin
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/2ECCF698-BD5D-4421-B28A-EC74471715B6%40gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CADcuegsS6gmBndmQ-xjtKjN8L_E1JsVpU4NKrBO3Fhogr8gFxg%40mail.gmail.com.


[racket-users] [racket users] Pollen tag question

2020-10-29 Thread Kevin Forchione
Hi guys,
I’ve noticed that the elements being sent to a pollen tag don’t preserve the 
spacing when the text spans multiple lines for any space occurring before 
characters on the subsequent line, although does preserve the spacing between 
characters on that line.Is thes intentional?

For example: Racket 7.8 [cs], latest pollen version: 

◊vb{ A B
 C D}

Regardless of how many spaces are before the C, the tag elements will only 
return a single space, although it preserves the spacing between C and D. 

Is that the expected result? It seems counter intuitive, as the spacing before 
A is preserved. 

Kevin

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/2ECCF698-BD5D-4421-B28A-EC74471715B6%40gmail.com.


Re: [racket-users] pollen?

2019-10-30 Thread Hendrik Boom
On Mon, Aug 05, 2019 at 12:05:57PM +0100, bruno cuconato wrote:
> hi Hendrik,
> 
> you might want to try https://groups.google.com/forum/#!forum/pollenpub for
> pollen-related queries

And now that's presumably https://github.com/mbutterick/pollen-users/issues

-- hendrik

> 
> 
> --
> bruno cuconato
> (on mobile)
> 
> On Mon, Aug 5, 2019, 05:12 Hendrik Boom  wrote:
> 
> > On Sun, Aug 04, 2019 at 02:17:33AM -0700, Simon Schlee wrote:
> > > I have not completely read this thread in detail, but to me it seems
> > like
> > > it could be useful to you, to experiment with pollen and custom tags and
> > > try to capture more semantic meaning with those tags.
> > > I think you would have an easier time creating templates that layout the
> > > code exactly like you want, it might be some more work to transition but
> > > you would have more control over how things are rendered.
> > > Have you already checked-out/considered using pollen?
> >
> > I've seen a web page about it but I haven't yet looked into it seriously.
> > Will look again, in more detail.
> >
> > I gather that it's built upon scribble.  The manual (
> > https://docs.racket-lang.org/pollen/ ) seems to be one meta-level above
> > the level of the scribble tutorials I've found.  Instead of descibing
> > how to put together a manuscript that can produce, say, both html and
> > pdf (possibly via TeX) output it seems to describe how you could define
> > notations that could to that.
> >
> > Now you need that for any kind of sophisticated use (which I gather is
> > what I'll be doing) but it's really nice to know what's *already*
> > available to produce documents.  Have I somehow missed that in the
> > documentation bundle?
> >
> > Also... pollen seems to be somewhat based on scribble.
> > Does is share scribble's problem of not being able to nest
> > @include-section within another tag, like
> > @italic{
> >   @include-section["other-file"]
> > }
> >
> > -- hendrik
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/racket-users/20190805041210.zk7aonuutslxqw7m%40topoi.pooq.com
> > .
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAPWro-gSOQSFyn%3DyHcZX4Yt-VVusnF6WKXLewWYyFF9HTRCrxQ%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20191030191532.hpngbrt2pkvdlcsa%40topoi.pooq.com.


Re: [racket-users] pollen?

2019-08-05 Thread bruno cuconato
hi Hendrik,

you might want to try https://groups.google.com/forum/#!forum/pollenpub for
pollen-related queries


--
bruno cuconato
(on mobile)

On Mon, Aug 5, 2019, 05:12 Hendrik Boom  wrote:

> On Sun, Aug 04, 2019 at 02:17:33AM -0700, Simon Schlee wrote:
> > I have not completely read this thread in detail, but to me it seems
> like
> > it could be useful to you, to experiment with pollen and custom tags and
> > try to capture more semantic meaning with those tags.
> > I think you would have an easier time creating templates that layout the
> > code exactly like you want, it might be some more work to transition but
> > you would have more control over how things are rendered.
> > Have you already checked-out/considered using pollen?
>
> I've seen a web page about it but I haven't yet looked into it seriously.
> Will look again, in more detail.
>
> I gather that it's built upon scribble.  The manual (
> https://docs.racket-lang.org/pollen/ ) seems to be one meta-level above
> the level of the scribble tutorials I've found.  Instead of descibing
> how to put together a manuscript that can produce, say, both html and
> pdf (possibly via TeX) output it seems to describe how you could define
> notations that could to that.
>
> Now you need that for any kind of sophisticated use (which I gather is
> what I'll be doing) but it's really nice to know what's *already*
> available to produce documents.  Have I somehow missed that in the
> documentation bundle?
>
> Also... pollen seems to be somewhat based on scribble.
> Does is share scribble's problem of not being able to nest
> @include-section within another tag, like
> @italic{
>   @include-section["other-file"]
> }
>
> -- hendrik
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/20190805041210.zk7aonuutslxqw7m%40topoi.pooq.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAPWro-gSOQSFyn%3DyHcZX4Yt-VVusnF6WKXLewWYyFF9HTRCrxQ%40mail.gmail.com.


[racket-users] pollen?

2019-08-04 Thread Hendrik Boom
On Sun, Aug 04, 2019 at 02:17:33AM -0700, Simon Schlee wrote:
> I have not completely read this thread in detail, but to me it seems like 
> it could be useful to you, to experiment with pollen and custom tags and 
> try to capture more semantic meaning with those tags.
> I think you would have an easier time creating templates that layout the 
> code exactly like you want, it might be some more work to transition but 
> you would have more control over how things are rendered.
> Have you already checked-out/considered using pollen?

I've seen a web page about it but I haven't yet looked into it seriously.
Will look again, in more detail.

I gather that it's built upon scribble.  The manual ( 
https://docs.racket-lang.org/pollen/ ) seems to be one meta-level above 
the level of the scribble tutorials I've found.  Instead of descibing 
how to put together a manuscript that can produce, say, both html and 
pdf (possibly via TeX) output it seems to describe how you could define 
notations that could to that.

Now you need that for any kind of sophisticated use (which I gather is 
what I'll be doing) but it's really nice to know what's *already* 
available to produce documents.  Have I somehow missed that in the 
documentation bundle?

Also... pollen seems to be somewhat based on scribble.
Does is share scribble's problem of not being able to nest @include-section 
within another tag, like
@italic{
  @include-section["other-file"]
}

-- hendrik

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20190805041210.zk7aonuutslxqw7m%40topoi.pooq.com.