Re: [racket-users] still trying to get coloured text in scribble

2016-05-26 Thread Hendrik Boom
On Thu, May 26, 2016 at 10:35:30AM -0400, Brian LaChance wrote:
> On Tue, May 24, 2016 at 9:14 PM, Hendrik Boom  wrote
> > ```
> > #lang scribble/base
> > (require scribble/core)
> 
> The "require" is missing a @---change it to @(require scribble/core)
> and your unbound identifier error should go away.

Thank you.

duhh.. yes.  I figured it out just now and opened my email to report 
my stupidity and found your message.

> 
> >
> > Example of color:
> >
> > @(define (colorize #:color c . content)
> >   (elem #:style (style #f (color-property c)
> 
> Once the require is taken care of, you'll probably also get a contract
> violation here due to style's second argument. The docs say it should
> be a list. Hope that helps.

Yes, I did get that contract violation.  But had no idea what list I 
had to have.  Fortunately, I allso found a working exam0le in my 
email.

-- hendrik


> 
> -Brian

-- 
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] still trying to get coloured text in scribble

2016-05-26 Thread Brian LaChance
On Tue, May 24, 2016 at 9:14 PM, Hendrik Boom  wrote
> ```
> #lang scribble/base
> (require scribble/core)

The "require" is missing a @---change it to @(require scribble/core)
and your unbound identifier error should go away.

>
> Example of color:
>
> @(define (colorize #:color c . content)
>   (elem #:style (style #f (color-property c)

Once the require is taken care of, you'll probably also get a contract
violation here due to style's second argument. The docs say it should
be a list. Hope that helps.

-Brian

-- 
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] still trying to get coloured text in scribble

2016-05-24 Thread Hendrik Boom
On Tue, May 24, 2016 at 08:17:01PM -0400, Leif Andersen wrote:
> Ya, we should probably have a `color` function in scribble/base.
> Currently you actually have to use `color-property` found in
> `scribble/core`.
> 
> You could make your own colorize function like so:
> 
> ```
> (define (colorize #:color c . content)
>   (elem #:style (style #f (color-property c)
> content))
> ```

Unfortunately, it complains that style s unbound.

hendrik@notlookedfor:~/write/Melinda/Melinda$ make spedia
scribble --html --dest generated pedia/spedia.scrbl
pedia/spedia.scrbl:7:17: style: unbound identifier in module
  in: style
Makefile:95: recipe for target 'spedia' failed
make: *** [spedia] Error 1
hendrik@notlookedfor:~/write/Melinda/Melinda$ 

spedia.scrbl is the source code I'm using:


```
#lang scribble/base
(require scribble/core)

Example of color:

@(define (colorize #:color c . content)
  (elem #:style (style #f (color-property c)
content)))

@colorize[#:color "red"]{WARNING}
```

Any idea where I should get style from?  make-style also fails.

-- hendrik

> 
> (Code taken from:
> http://stackoverflow.com/questions/34888125/change-font-color-in-scribble-html-backend)
> 
> >From there, you can just do:
> 
> ```
> @colorize[#:color "red"]{WARNING}
> ```
> 
> Hope that helps.
> 
> ~Leif Andersen
> 
> 
> On Tue, May 24, 2016 at 6:53 PM, Hendrik Boom  wrote:
> > On Mon, May 23, 2016 at 03:20:53PM -0400, Hendrik Boom wrote:
> >> Can someone give me an example of coloured text in scribble?
> >
> > I've figured out that I need a style connotaining a color-property
> > but I still have no idea how to code that style in scribble, nor how to
> > apply it to a piece of text in the middle of a paragraph.
> >
> > Presumably I need to @something{ } to delimit the piece of text, and
> > then somehow apply a style to it.
> >
> > THe obvious @color[red]{foo} doesn't work, because color  isn't defined.
> >
> > -- hendrik
> >
> >>
> >> -- 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.
> >> 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.

-- 
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] still trying to get coloured text in scribble

2016-05-24 Thread Leif Andersen
Ya, we should probably have a `color` function in scribble/base.
Currently you actually have to use `color-property` found in
`scribble/core`.

You could make your own colorize function like so:

```
(define (colorize #:color c . content)
  (elem #:style (style #f (color-property c)
content))
```

(Code taken from:
http://stackoverflow.com/questions/34888125/change-font-color-in-scribble-html-backend)

>From there, you can just do:

```
@colorize[#:color "red"]{WARNING}
```

Hope that helps.

~Leif Andersen


On Tue, May 24, 2016 at 6:53 PM, Hendrik Boom  wrote:
> On Mon, May 23, 2016 at 03:20:53PM -0400, Hendrik Boom wrote:
>> Can someone give me an example of coloured text in scribble?
>
> I've figured out that I need a style connotaining a color-property
> but I still have no idea how to code that style in scribble, nor how to
> apply it to a piece of text in the middle of a paragraph.
>
> Presumably I need to @something{ } to delimit the piece of text, and
> then somehow apply a style to it.
>
> THe obvious @color[red]{foo} doesn't work, because color  isn't defined.
>
> -- hendrik
>
>>
>> -- 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.
>> 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.

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