Highlight.js: Support Code folding

Created on 1 Dec 2013  路  1Comment  路  Source: highlightjs/highlight.js

Hi,
I would like to load and disply the complete source code. For most of the time it is not very interesting to see stuff like imports or helper functions. Thus I would like to hide those not importent parts until the reader chooses to see them or to copy everything into their code.

I would imagine something like the following.

// highlight.js:no-display
import a 
import b
import c
// highlight.js:display
cool code is here
and here 
// highlight.js:no-display

>All comments

Sorry, this is waay out of scope of highlight.js. I don't want to start an argument about the idea itself (it seems too baroque for my taste) but I'm certain that we don't want to include anything like this.

Having said that, it can be implemented outside of highlight.js: you can mark up your code with <span>s needed for folding and highlight.js won't break them while adding its own highlighting mark up.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Vad1mo picture Vad1mo  路  7Comments

starikovs picture starikovs  路  8Comments

Martii picture Martii  路  7Comments

kkeundotnet picture kkeundotnet  路  3Comments

Suyash2810 picture Suyash2810  路  8Comments