Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Site Bugs / Suggestions
  4. Suggestion: Collapsable Code in Article

Suggestion: Collapsable Code in Article

Scheduled Pinned Locked Moved Site Bugs / Suggestions
csharpc++
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Marc 0
    wrote on last edited by
    #1

    I have suggestion: do something with the code snippet in articles so that they can be collapsed or expanded (just like posts in the forums). That way the article writer can optionally show a lot of code without getting a huge article! Maybe the person who writes the article can set a tag to 'hidden' or 'shown'. Something like this:

    ...blabla article
    <pre state="shown" lang="vb.net">
    ...code and stuff that is shown at start, but can be hidden by the reader
    </pre>
    <pre state="hidden" lang="cs">
    ...code that is hidden, but can also be shown
    </pre>
    <pre state="alwaysshown" lang="cpp">
    ...code that is always shown, and can not be hidden
    </pre>
    more article blabla...

    If the snippet is hidden, you couldshow the first line of the snippet, and a button next to it with a 'Sho whole snippet' text It would be cool if you get a tooltip with the first 10 lines of the snippet, if you hover over the hidden snippet. Just fantasizing... :rolleyes:


    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups