Re: [racket-users] Scribble examples for languages other than Racket

2019-01-25 Thread Ryan Kramer
On Thursday, January 24, 2019 at 9:45:39 PM UTC-6, Alex Knauth wrote:
>
> Would the `scribble-code-examples` package work for you? 
> https://docs.racket-lang.org/scribble-code-examples/index.html
>
> Looks like yes, it will! Thanks.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Scribble examples for languages other than Racket

2019-01-24 Thread Alex Knauth
Would the `scribble-code-examples` package work for you? 
https://docs.racket-lang.org/scribble-code-examples/index.html 


An example use of it might be:

@code-examples[#:lang "plisqin" #:context #'here]|{
{where x.Foo > 3}
}|

Alex Knauth

> On Jan 23, 2019, at 2:19 AM, Ryan Kramer  wrote:
> 
> I was thinking about how to document #lang plisqin, a language I am working 
> on. I wanted to use the "examples" procedure from scribble/example. But it 
> looks like when you use the #:lang option, it disables evaluation and 
> printing of results. (The typesetting works fine though.)
> 
> I came up with a workaround, in which I programmatically construct a 
> racketblock that looks like the standard examples. You can see a working, 
> single-file prototype here: 
> https://github.com/default-kramer/plisqin/blob/dev/scribblings/TEMP-scribble-lang-idea.scrbl
> 
> Since I control the evaluator, this should allow me to typeset a fragment of 
> #lang plisqin such as
> 
>   {where x.Foo > 3}
> 
> but evaluate it as
> 
>   (where (> (Foo x) 3))
> 
> which will allow me to print the result. (I might even try to typeset both 
> syntaxes side-by-side or something.)
> 
> Has anyone done something similar?
> 
> Does my approach seem reasonable?
> 
> -- 
> 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 
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Scribble examples for languages other than Racket

2019-01-22 Thread Ryan Kramer
I was thinking about how to document #lang plisqin, a language I am working 
on. I wanted to use the "examples" procedure from scribble/example. But it 
looks like when you use the #:lang option, it disables evaluation and 
printing of results. (The typesetting works fine though.)

I came up with a workaround, in which I programmatically construct a 
racketblock that looks like the standard examples. You can see a working, 
single-file prototype here: 
https://github.com/default-kramer/plisqin/blob/dev/scribblings/TEMP-scribble-lang-idea.scrbl

Since I control the evaluator, this should allow me to typeset a fragment 
of #lang plisqin such as

  {where x.Foo > 3}

but evaluate it as

  (where (> (Foo x) 3))

which will allow me to print the result. (I might even try to typeset both 
syntaxes side-by-side or something.)

Has anyone done something similar?

Does my approach seem reasonable?

-- 
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.
For more options, visit https://groups.google.com/d/optout.