List of nbdev special comments?

Is there a summary list of all nbdev special comments somewhere?

The export page Export to modules | nbdev only mentions the export related ones.
But then I found this blog post Things you might not know you can do with nbdev | fastpages where they talk about # collapse-hide, and I only found them via searching directly for them on the docs page.
They are on the export2html site Convert to html | nbdev, but they seem to be having a slightly different syntax then in the blog post (#collapse_input) and it seems that they even take parameters, like # collapse_input open.

Now I’m worried I’m missing out on more special comments that I might not have seen?

The best answer lies in the source code. grep through nbdev for any use of _mk_flag_re, and you’ll see the different regexes it’s checking for.

Not a great answer, but not sure the documentation exists anywhere that has a full list.


I don’t think a full list does, a PR with a quick reference would be most welcome :smiley:

OOTOMH there is:

  • hide
  • hide_input
  • hide_output
  • export
  • exporti
  • exports
  • slow (or any other flags you have)
  • all_ at the top of a notebook to have a flag trickle down

(There are more though)

1 Like