in reply to Re^2: Adding Line Numbers to the MIT Shakespearein thread Adding Line Numbers to the MIT Shakespeare
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:
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.
perl shake.pl lear.htm > learout.htm
Adding the style sheet as instructed produced results for me, every 5th line is numbered on the right hand side.
Update: should you wish line numbers to be displayed at a different frequency the part of the code which deals with this is fairly simple to alter.
Update 2: Observations from your youtube video:
<link rel="stylesheet" type="text/css" media="screen" href="lear_files
Volume in drive C is XP MP 3.01
Volume Serial Number is CE02-00E2
Directory of C:\lear_files
15/02/2013 09:39 <DIR> .
15/02/2013 09:39 <DIR> ..
15/02/2013 09:39 259 shake.css
If you don't have this css in the location (note that in your file it's looking for /shake.css) it won't render properly on screen. Get this file, save it to your Shakespeare directory.
Update 3: http://shakespeare.mit.edu/shake.css
Now it worked.
I just had to save "complete webpage" instead of "single HTML".
Thanks a lot, marto!
My fellow monks
Can't tell (I'm NSA/FBI/HS/...)
Others (explain your deviation)
Results (64 votes). Check out past polls.