probmods / chapters

The online textbook Probabilistic Models of Cognition
https://probmods.org
163 stars 27 forks source link

Code folding #23

Closed ngoodman closed 10 years ago

ngoodman commented 10 years ago

It would be useful to have code folding possible in the codemirror boxes, and have a way in the markdown to tell a region to start out folded. This way helper routines could be hidden from sight. Eg:

(define coolfun ...)

;;;folded helper code
(define boringfun ...)
;;;

..the real stuff..

Why? There are lots of examples that build progressively meaning we repeat the same code... It would look much better to hide this code from sight after the first time.

ngoodman commented 10 years ago

done:

fold a region with Cmd-F.

mark a region to start out folded by using the following in the markdown code box:

;;;fold: ... ;;;