asciidoctor / brackets-asciidoc-preview

Live Preview of AsciiDoc for Adobe Brackets
MIT License
50 stars 16 forks source link

Support code folding #19

Open domgold opened 9 years ago

domgold commented 9 years ago

It would be nice to be able to collapse blocks, chapters, etc., similar to what this extension does.

mojavelinux commented 9 years ago

:+1:

This should be possible at the block-level since Asciidoctor parses blocks to the AST and keeps the line numbers of the blocks (set sourcemap option to true). However, we may find we need more support in Asciidoctor core, which will get corrected if need be.

nerk commented 9 years ago

Yes, good idea. I have been thinking about this feature already for some time. As @mojavelinux mentioned, the core support is already there. Special handling of included documents is required, though. AFAIK, included documents are expanded and sourcemap information is related to the whole main document. Informaton about included docs is lost.

Maybe we could handle this through an 'include' extension and expand (unfold) include blocks on demand or something like that. Need to investigate further. Dan would know better.

mojavelinux commented 9 years ago

Maybe we could handle this through an 'include' extension and expand (unfold) include blocks on demand or something like that. Need to investigate further. Dan would know better.

Sounds about right, but this is new territory for me to explore mentally, so I'm on the journey with you :)

hwinkel commented 9 years ago

:+1: