1

I need to ask a question, and I have some code that I want to be hidden at first, and if someone wants to see what's inside all what needs to be done is to click on it.

For instance, I want this lorem ipsum to be initially hidden:

Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un peintre anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte. Il n'a pas fait que survivre cinq siècles, mais s'est aussi adapté à la bureautique informatique, sans que son contenu n'en soit modifié. Il a été popularisé dans les années 1960 grâce à la vente de feuilles Letraset contenant des passages du Lorem Ipsum, et, plus récemment, par son inclusion dans des applications de mise en page de texte, comme Aldus PageMaker.

UPDATE

I'm asking about a feature that I've seen on https://stackoverflow.com, not about whether it's useful or not.

10
  • But....... why?
    – Pekka
    Jul 21, 2017 at 12:11
  • 4
    @Pekka shh.. spoilers
    – Suraj Rao
    Jul 21, 2017 at 12:15
  • 4
    @Pekka웃 to trick people into flagging/commenting "Please post your code"
    – George
    Jul 21, 2017 at 12:15
  • 2
    Stack Snippets....isn't this exactly what they are for?
    – Paulie_D
    Jul 21, 2017 at 12:18
  • 4
    If I saw code had been spoilered....I'd edit the spoiler tag out. I can't think of a professional reason for spoilering code.
    – Paulie_D
    Jul 21, 2017 at 12:20
  • 2
    @Pekka웃 because it's a SO feature and I'd like to use it when I think it's helpful :) And because sometimes some people understand things very fast without all the details and some others need more details..
    – smarber
    Jul 21, 2017 at 12:20
  • 1
    honestly I havent actually used it in SO nor did I find a use case here.. found it commonly used in movies.stackexchange.com..If you find a use case it is there
    – Suraj Rao
    Jul 21, 2017 at 12:22
  • 1
    @suraj or the place where I'd say it's most common puzzling.stackexchange.com
    – George
    Jul 21, 2017 at 12:28
  • 3
    There's a small checkbox on the left side of the screen inside the snippet editor that says "hide snippet by default" or something along those lines. That's what you're looking for.
    – I haz kode
    Jul 21, 2017 at 13:33
  • 1
    If you're afraid you're going to post too much code and people will complain about that, then read How to Ask again and make sure you create a Minimal, Complete and Verifyable Example, emphasis on minimal.
    – CodeCaster
    Jul 21, 2017 at 14:51

2 Answers 2

19

Being as the answer by suraj wasn't what you are on about, I can only assume you mean this?

console.log("Is")
console.log("this")
console.log("right?")

To do this just click the snippet button, then in the modal there is a checkbox to the left which says Hide snippet by default, Check that.

enter image description here

5
  • Well I believe you are correct here.. Really torn wether to delete my answer or not :D.. The paragraph block threw me off
    – Suraj Rao
    Jul 21, 2017 at 12:49
  • 1
    @suraj I was too, I upvoted your answer as I thought you were right! I'd say leave it in as it's nice to know as I didn't know how to create a spoiler text before now, not that I'd need to use it on SO.
    – George
    Jul 21, 2017 at 12:50
  • fair enough..I will leave it
    – Suraj Rao
    Jul 21, 2017 at 12:51
  • @George yeah this is exactly what I want thx! it's juste that you did not explain how to do it....
    – smarber
    Jul 21, 2017 at 14:20
  • @smarber it was just a guess, your question was quite badly worded in describing what you were on about, post some pictures next time. Anyway, there you go, instructions added.
    – George
    Jul 21, 2017 at 14:24
7

Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un peintre anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte. Il n'a pas fait que survivre cinq siècles, mais s'est aussi adapté à la bureautique informatique, sans que son contenu n'en soit modifié. Il a été popularisé dans les années 1960 grâce à la vente de feuilles Letraset contenant des passages du Lorem Ipsum, et, plus récemment, par son inclusion dans des applications de mise en page de texte, comme Aldus PageMaker.

Check here

What's the exact syntax for spoiler markup

I havent actually used it in SO nor did I find a use case here. But it is present in the editor and is primarily used in https://movies.stackexchange.com or https://puzzling.stackexchange.com

4
  • Thx but I'm talking about a feature that display a small link when hidden and once the link clicked the content is displayed
    – smarber
    Jul 21, 2017 at 12:23
  • I am not sure what you are describing then.. maybe edit your question and elaborate?
    – Suraj Rao
    Jul 21, 2017 at 12:25
  • 1
    @smarber you mean a collapsible snippet?
    – George
    Jul 21, 2017 at 12:37
  • @George I guess....
    – smarber
    Jul 21, 2017 at 12:39

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