in reply to Change default style sheet: add line numbers

This would block C&P without clicking on DOWNLOAD, that's why many would object.

But an interactive JS toggle might solve that.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)

PS: Je suis Charlie!

  • Comment on Re: Change default style sheet: add line numbers

Replies are listed 'Best First'.
Re^2: Change default style sheet: add line numbers
by choroba (Cardinal) on Mar 28, 2015 at 14:22 UTC
    I have line numbers turned on, but they aren't selected when I copy the code. But I might have forgotten putting some JS to a nodelet or similar.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      I think this may depend on the browser, but I can't test cause I can't find the setting in Display Settings ... ?

      edit

      Or is it just a CSS hack?

      update

      OK found it hidden in the help page...


      • Code Prefix: whatever you enter here will be used as a prefix for lines inside <code> blocks. If you specify something that matches /&\d+;/, then those digits will be incremented for each line of code. Typically you would specify &001;: to have all code lines numbered starting from 001.

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)

      PS: Je suis Charlie!

        OK, I investigated my settings. I use a CSS + JS solution (it links to CodeMirror). When I remove it and add the Code Prefix, the line numbers get selected with the code.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re^2: Change default style sheet: add line numbers
by Anonymous Monk on Apr 01, 2015 at 11:13 UTC

    This would block C&P without clicking on DOWNLOAD, that's why many would object. But an interactive JS toggle might solve that.

    Hmm , firefox doesn't copy/paste line numbers ... so I don't think JS is required

    1. #!/usr/bin/perl --
    2. use strict;
    3. use warnings;
    4. print "Hello + world!\n";