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. Article Writing
  4. Code Line Numbers? Colorized Code?

Code Line Numbers? Colorized Code?

Scheduled Pinned Locked Moved Article Writing
csharpvisual-studioquestion
3 Posts 3 Posters 1 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.
  • D Offline
    D Offline
    David Deley
    wrote on last edited by
    #1

    Is there a way to post code with line numbers? Is there a way to colorize code (the way Visual Studio colorizes code)?

    S 1 Reply Last reply
    0
    • D David Deley

      Is there a way to post code with line numbers? Is there a way to colorize code (the way Visual Studio colorizes code)?

      S Offline
      S Offline
      Sean Ewington
      wrote on last edited by
      #2

      Unfortunately the only way to do line numbers is either to already have them in your code and put the <pre> block around it, or to add the line numbers manually. As for colorizing the code, you certainly can. There are a couple of ways to do it, one is to add the language tag in the code, the other is the use the dropdown to add it: CodeProject Article FAQ - Part 2: How to Post an Article on CodeProject [^]

      Thanks, Sean Ewington CodeProject

      Richard DeemingR 1 Reply Last reply
      0
      • S Sean Ewington

        Unfortunately the only way to do line numbers is either to already have them in your code and put the <pre> block around it, or to add the line numbers manually. As for colorizing the code, you certainly can. There are a couple of ways to do it, one is to add the language tag in the code, the other is the use the dropdown to add it: CodeProject Article FAQ - Part 2: How to Post an Article on CodeProject [^]

        Thanks, Sean Ewington CodeProject

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        Can't you just add linecount="on" to the <pre> like you can in the forums and QA?

        <pre lang="Plain" linecount="on">
        Line 1
        Line 2
        Etc.
        </pre>

        Line 1
        Line 2
        Etc.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        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