brackets-asciidoc-preview icon indicating copy to clipboard operation
brackets-asciidoc-preview copied to clipboard

Support code folding

Open domgold opened this issue 10 years ago • 4 comments

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

domgold avatar Nov 25 '14 22:11 domgold

:+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.

mojavelinux avatar Nov 25 '14 22:11 mojavelinux

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.

nerk avatar Nov 26 '14 07:11 nerk

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 :)

mojavelinux avatar Nov 26 '14 07:11 mojavelinux

:+1:

hwinkel avatar Jan 31 '15 22:01 hwinkel