
I am having a bad time with Scribble and racketblock

I can follow the code sample for codeblock
@codeblock\|{
#lang scribble/manual
@codeblock{
#lang scribble/manual
@title{Hello}
}
}\|

But if I change that to racketblock
Scribble outputs all my code as literal text

@racketblock\|{
#lang racket/base
(require web-server/servlet-env
web-server/http
web-server/dispatchers/dispatch)
(serve/servlet (lambda (_) (next-dispatcher))
#:servlet-path "/"
#:extra-files-paths (list (build-path "./static"))
#:port 8080
#:launch-browser? #t)
}\|

renders as

You should use @racketblock[ ... ]
, not @racketblock\|{ ... }\|

index.scrbl:36:0: read-syntax: unexpected `]
`

:confused:

I’m using #lang scribble/manual
in case that matters

do I need some special indentation or something?

It sounds like you have unbalanced parens or curlys or braces.

#lang scribble/manual
@racketblock[
#lang racket/base
]

this is a minimum and it still doesn’t work :confused:

bar.scrbl:5:0: read-syntax: unexpected `]`
context...:
read-undotted
read-syntax

(I snipped the rest)

I don’t think racketblock
is meant to have #lang
within it. racketmod
might be closer to what you’re looking for if you want #lang
there

that did it

that was non-obvious! :smile:

Thanks @samth & @badkins. Very helpful! :slightly_smiling_face:
Definitely sounds like places are the way to go for my purposes, then.
If you’re interested in a little more context of the end-goal, essentially I’m wanting to do something a bit like https://github.com/jcoo092/stereo-matching-practice/blob/master/fsharp/BeliefPropagation.fs using an approach similar to https://github.com/jcoo092/ivcnz2018/blob/master/CML/Program.fs (it would be fair to say that using that approach for the latter was unsuccesful - it was at least 20x slower than a simple naive implementation of the same thing. I expected it to be slower in this instance, but not that much slower - plus the program was much more bloated)