-
Notifications
You must be signed in to change notification settings - Fork 104
Open
Labels
Description
With new features comes new wishes :–)
When you do code extraction you sometimes have setup code (e.g. a license header) that you'd like to hide in the rendering. With mli files you can simply use a stop comment but in .mld files there is no such thing, everything gets rendered, as noticed in #998.
I think we should standardize an info string tag, e.g. @hidden which should work regardless of whether we are processing .mld file or a cmti one and that removes the tagged code block from the rendering.
So for example I can have:
{@ocaml @hidden name=header[
(*---------------------------------------------------------------------------
Copyright (c) 2011 The cmdliner programmers. All rights reserved.
SPDX-License-Identifier: CC0-1.0
---------------------------------------------------------------------------*)
]}
And then:
{@ocaml name=example1.ml[
…
|}
{@ocaml name=example2.ml[
…
|}
And extract the examples as
odoc extract-code --name header --name example1.ml
odoc extract-code --name header --name example2.ml
Reactions are currently unavailable