How to document syntax using scribble?

160 views Asked by At

I want to make some documentation about a project I'm making and I want to make it using #lang scribble/manual.

Since I have some user-defined procedures I would like to make my manual look like this, what I mean is the blue procedure/syntax square in the manual.

How can I do something like that?

Thank you!

1

There are 1 answers

3
Asumu Takikawa On BEST ANSWER

You can use Scribble forms like defproc, defform, etc. to define these "blue box" blocks in the documentation.

The relevant doc pages for those forms have examples which show their use, so I'll just copy one of the examples from the docs which might help you get started:

@defproc[(make-sandwich [ingredients (listof ingredient?)])
         sandwich?]{
  Returns a sandwich given the right ingredients.
}

The docs for defproc are here. There are examples for the other forms further down the page.

You may also want to read the following guide to documenting Racket libraries: http://docs.racket-lang.org/scribble/how-to-doc.html