Re: still trying to get coloured text in scribble
Hendrik Boom <hendrik-e9JHxFxFq/[email protected]>
| Newsgroups | gmane.comp.lang.racket.user,gmane.lisp.scheme.plt |
|---|---|
| Message-ID | <[email protected]> |
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 <hendrik-e9JHxFxFq/[email protected]> 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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
> >> 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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
> > 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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.