http://www.perlmonks.org?node_id=942343


in reply to Adding Line Numbers to the MIT Shakespeare

The id attribute is supposed to be unique per-document. That is, you must not have two elements in the same document with the same value for id.

Try replacing id="lineNum" with class="lineNum" in your HTML, and replacing #lineNum with .lineNum in your stylesheet.

Replies are listed 'Best First'.
Re^2: Adding Line Numbers to the MIT Shakespeare
by Anonymous Monk on Feb 14, 2013 at 18:04 UTC

    Hi,

    Sorry for asking maybe a very simple question, but where should I enter the file (or the name of the file) for parsing?

    Thanks in advance,

    Eduardo

      Input: an HTML file using the MIT Shakespeare Format ... die "File must be given as first arg\n";

      Provide the input file when running the script, like this:

      perl scriptname.pl inputfile.html

        Thanks for your answer, marto.

        The parsing worked.

        But how to "capture the output into a new html file"?

        I used the following command:

        "perl scriptname.pl inputfile.html > result.html".

        In the result.html file that was generated, I added the stylesheet indicated:

        <style type="text/css"> .lineNum { position: absolute; left: 550px; } </style>

        But the result.html file didn't show any line numbers.

        What may I have done wrong?

        P.S. - I've compared the original and the result file, before adding the stylesheet, and they are exactly the same. So the parsing didn't work as it should.