[racket-users] Racket News - Issue 21

2019-12-02 Thread Paulo Matos
Hello fellow Racketeers,

A new issue of RN is here, now counting 21!
https://racket-news.com/2019/12/racket-news-issue-21.html

Time to grab that coffee and enjoy,

Paulo Matos

-- 
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/ffabb4a9-7d5a-4e20-8943-e0368b7c546a%40googlegroups.com.


Re: [racket-users] Scribble: how to wrap a flow in a style?

2019-12-02 Thread Matthew Flatt
At Mon, 2 Dec 2019 22:55:34 +, Reuben Thomas wrote:
> On Mon, 2 Dec 2019 at 22:47, Matthew Flatt  wrote:
> 
> > Does this get closer?
> >
> >  @(define foo-style (make-style "foo" (list (body-id "div"
> >
> 
> Thanks for the suggestion. It doesn't seem to make any difference. I added
> scribble/html-properties to my requires, of course, then since I couldn't
> tell which version of (define foo) you meant me to use it with, I tried it
> with both. With the definition using make-nested-flow, the output still has
> a blockquote element. With the definition using make-part, the output still
> doesn't have any element wrapping it, or any mention of class "foo".

Ah, it looks like `alt-tag` is the one that works, instead of
`body-id`. (I'll fix the docs.)

Since I actually tried it this time, here's a modified version of your
example.



#lang scribble/base

@(require scribble/core
  scribble/decode
  scribble/html-properties)

@(define foo-style (make-style "foo" (list (alt-tag "div"
@(define (foo . content) (make-nested-flow foo-style (decode-flow content)))
@foo{Test.

@para[#:style "bar"]{Bar.}}

-- 
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/5de59902.1c69fb81.6072d.28acSMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: [racket-users] Scribble: how to wrap a flow in a style?

2019-12-02 Thread 'Reuben Thomas' via Racket Users
On Mon, 2 Dec 2019 at 22:47, Matthew Flatt  wrote:

> Does this get closer?
>
>  @(define foo-style (make-style "foo" (list (body-id "div"
>

Thanks for the suggestion. It doesn't seem to make any difference. I added
scribble/html-properties to my requires, of course, then since I couldn't
tell which version of (define foo) you meant me to use it with, I tried it
with both. With the definition using make-nested-flow, the output still has
a blockquote element. With the definition using make-part, the output still
doesn't have any element wrapping it, or any mention of class "foo".

-- 
https://rrt.sc3d.org

-- 
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/CAOnWdoj35MTKmVybH06gwrMr-vj4Bo96Or7KAfsD65dneW0FcA%40mail.gmail.com.


Re: [racket-users] Scribble: how to wrap a flow in a style?

2019-12-02 Thread Matthew Flatt
Does this get closer?

 @(define foo-style (make-style "foo" (list (body-id "div"


At Mon, 2 Dec 2019 22:41:04 +, "'Reuben Thomas' via Racket Users" wrote:
> I'm trying to get LaTeX output that wraps an environment around several
> paragraphs (while containing @para elements) and HTML output that does
> something similar with a . HTML is actually my sticking point, because
> so far all I've managed to do is get nested  elements, which is illegal.
> 
> Here's a M(non-)WE:
> 
> #lang scribble/base
> @(require scribble/core
>   scribble/decode)
> 
> @(define foo-style (make-style "foo" null))
> @(define (foo . content) (make-nested-flow foo-style (decode-flow content)))
> @foo{Test.
> 
> @para[#:style "bar"]{Bar.}}
> 
> This is almost what I want, except that the outer element is a blockquote,
> not a div. The LaTeX does exactly what I want: the contents is wrapped in
> \begin{foo}…\end{foo}.
> 
> How can I get it wrapped in a div instead? I tried this:
> 
> @(define (foo . content)
>   (make-part
>#f
>(list `(part ,(generated-tag)))
>#f
>foo-style
>null
>(decode-flow content)
>null))
> Unfortunately, styles on parts seem to be interpreted differently, and the
> name "foo" does not come out in the HTML or LaTeX.
> 
> None of the other sorts of block seem to do what I want: table and
> itemization are special-purpose, compound-paragraph and paragraph are too
> low level (they are paragraphs, and can't have paragraphs inside them), and
> traverse-block and delayed-block are of course ways of computing blocks
> eventually, of one of the other types.
> 
> 
> -- 
> https://rrt.sc3d.org
> 
> -- 
> 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/CAOnWdohD15-1ajAjFEG8CLdLrbDoGYQ
> Ax0VQR%3DKe0PW_iyyt-g%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/5de59467.1c69fb81.d42c8.1a41SMTPIN_ADDED_MISSING%40gmr-mx.google.com.


[racket-users] Scribble: how to wrap a flow in a style?

2019-12-02 Thread 'Reuben Thomas' via Racket Users
I'm trying to get LaTeX output that wraps an environment around several
paragraphs (while containing @para elements) and HTML output that does
something similar with a . HTML is actually my sticking point, because
so far all I've managed to do is get nested  elements, which is illegal.

Here's a M(non-)WE:

#lang scribble/base
@(require scribble/core
  scribble/decode)

@(define foo-style (make-style "foo" null))
@(define (foo . content) (make-nested-flow foo-style (decode-flow content)))
@foo{Test.

@para[#:style "bar"]{Bar.}}

This is almost what I want, except that the outer element is a blockquote,
not a div. The LaTeX does exactly what I want: the contents is wrapped in
\begin{foo}…\end{foo}.

How can I get it wrapped in a div instead? I tried this:

@(define (foo . content)
  (make-part
   #f
   (list `(part ,(generated-tag)))
   #f
   foo-style
   null
   (decode-flow content)
   null))
Unfortunately, styles on parts seem to be interpreted differently, and the
name "foo" does not come out in the HTML or LaTeX.

None of the other sorts of block seem to do what I want: table and
itemization are special-purpose, compound-paragraph and paragraph are too
low level (they are paragraphs, and can't have paragraphs inside them), and
traverse-block and delayed-block are of course ways of computing blocks
eventually, of one of the other types.


-- 
https://rrt.sc3d.org

-- 
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/CAOnWdohD15-1ajAjFEG8CLdLrbDoGYQAx0VQR%3DKe0PW_iyyt-g%40mail.gmail.com.


[racket-users] Re: window on-move / move inconsistency: is this a bug?

2019-12-02 Thread Simon Schlee
Yes, when I put on my pragmatic thinking hat, I certainly agree with you.
But it also makes me think about whether I should create a utility library 
which does a more abstracted window placement and restoring.
That library would care more about logical "human" positioning and for 
example snap to screens and possibly use platform specific code like you 
suggested.
Currently such a library seems to be nice to have, but not that urgent to 
me.

On the other hand when I play devil's advocate I think racket/gui is a 
cross-platform gui library and should have a highlevel api where these 
platform specific quirks don't leak through.

I am unsure what is most reasonable and the better approach, I guess 
changing the move behavior might be difficult because of backwards 
compatibility,
so the utility library might be the way to go.

-- 
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/49c69439-2590-4429-ae58-b7edd18b6898%40googlegroups.com.