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. Line numbers in code blocks

Line numbers in code blocks

Scheduled Pinned Locked Moved Site Bugs / Suggestions
comtoolsquestion
5 Posts 3 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.
  • A Offline
    A Offline
    Ashley van Gerven
    wrote on last edited by
    #1

    Would be useful to refer to specific lines in the code PRE blocks when explaining functionality.

    1 string s = null;
    2
    3
    4 string s = null;
    5 string s = null;
    5 string s = null;
    6 string s = null;
    7 string s = null;

    E.g. "Lines 4-7 calculate the coffee strength required for optimum productivity." Has this idea ever been considered?

    "For fifty bucks I'd put my face in their soup and blow." - George Costanza

    CP article: SmartPager - a Flickr-style pager control with go-to-page popup layer.

    C 1 Reply Last reply
    0
    • A Ashley van Gerven

      Would be useful to refer to specific lines in the code PRE blocks when explaining functionality.

      1 string s = null;
      2
      3
      4 string s = null;
      5 string s = null;
      5 string s = null;
      6 string s = null;
      7 string s = null;

      E.g. "Lines 4-7 calculate the coffee strength required for optimum productivity." Has this idea ever been considered?

      "For fifty bucks I'd put my face in their soup and blow." - George Costanza

      CP article: SmartPager - a Flickr-style pager control with go-to-page popup layer.

      C Offline
      C Offline
      Chris Maunder
      wrote on last edited by
      #2

      I've thought about it, and there are a few javascript includes that will do this for us. Just not sure... Maybe we need a vote on it.

      cheers, Chris Maunder

      CodeProject.com : C++ MVP

      realJSOPR A 2 Replies Last reply
      0
      • C Chris Maunder

        I've thought about it, and there are a few javascript includes that will do this for us. Just not sure... Maybe we need a vote on it.

        cheers, Chris Maunder

        CodeProject.com : C++ MVP

        realJSOPR Offline
        realJSOPR Offline
        realJSOP
        wrote on last edited by
        #3

        Why don't you just make it a setting in the article submission wizard, and default it to "off".

        "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
        -----
        "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

        1 Reply Last reply
        0
        • C Chris Maunder

          I've thought about it, and there are a few javascript includes that will do this for us. Just not sure... Maybe we need a vote on it.

          cheers, Chris Maunder

          CodeProject.com : C++ MVP

          A Offline
          A Offline
          Ashley van Gerven
          wrote on last edited by
          #4

          How about an attribute on the PRE tag? IIRC you can set the "lang" attribute to specify the syntax highlighting. So maybe "lineNumbers='true'" could enable the line numbers.

          "For fifty bucks I'd put my face in their soup and blow." - George Costanza

          C 1 Reply Last reply
          0
          • A Ashley van Gerven

            How about an attribute on the PRE tag? IIRC you can set the "lang" attribute to specify the syntax highlighting. So maybe "lineNumbers='true'" could enable the line numbers.

            "For fifty bucks I'd put my face in their soup and blow." - George Costanza

            C Offline
            C Offline
            Chris Maunder
            wrote on last edited by
            #5

            Now that I like. Added to the TODO

            cheers, Chris Maunder

            CodeProject.com : C++ MVP

            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