asciidoctor-vscode icon indicating copy to clipboard operation
asciidoctor-vscode copied to clipboard

Add code folding on source blocks

Open noraj opened this issue 2 years ago • 0 comments
trafficstars

It would be nice to add code folding for source blocks. This way if you have something like:

[source, ruby]
----
# Output "I love Ruby"
say = "I love Ruby"
puts say

# Output "I *LOVE* RUBY"
say['love'] = "*love*"
puts say.upcase

# Output "I *love* Ruby"
# five times
5.times { puts say }
----

blabla

```ruby
# The famous Hello World
# Program is trivial in
# Ruby. Superfluous:
#
# * A "main" method
# * Newline
# * Semicolons
#
# Here is the Code:

puts "Hello World!"
```

You could fold it to:

[source, ruby]
----…

blabla

```ruby…

Note: dots are added by VSCode on folding

Documentation: https://docs.asciidoctor.org/asciidoc/latest/verbatim/source-blocks/

It would be very similar to https://github.com/asciidoctor/asciidoctor-vscode/issues/553

noraj avatar Sep 18 '23 21:09 noraj