Sometimes only 10 lines of 100 are relevant to the question/answer, the other 90 are setup.

Is there a way to hide 90 those in lines in the answer?

  • I proposed a solution here. Maybe you can argue that's the same question but I guess I didn't think of that until after I posted it. Doh – gman Sep 17 '14 at 10:04
  • I had proposed a solution @MSO – Tilwin Joy Oct 2 '14 at 13:50

The way to do this is just to include the 10 lines like you normally would.

Then in the Stack Snippet you place the full code. So the 10 lines will appear twice in the markup. One time before the snippet starts, and one time in the snippet.

Then make sure to check mark the box to hide the snippet by default, as shown below :

enter image description here

For a working example of this, see my answer that does just this here

  • 2
    not very D.R.Y. – gman Sep 17 '14 at 9:58
  • The question title reads "How do I select which lines of code to show and which lines to hide?" - from the snippet. Currently there is no option for that. Copy pasting isn't a practical solution for larger amount of code... – Tilwin Joy Oct 2 '14 at 15:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .