Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Adding Line Numbers to the MIT Shakespeare

by tobyink (Abbot)
on Dec 07, 2011 at 23:27 UTC ( #942343=note: print w/ replies, xml ) Need Help??


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.


Comment on Re: Adding Line Numbers to the MIT Shakespeare
Select or Download Code
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://942343]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2015-07-04 19:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls