Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Adding Line Numbers to the MIT Shakespeare

by Anonymous Monk
on Feb 14, 2013 at 18:04 UTC ( #1018765=note: print w/replies, xml ) Need Help??


in reply to Re: Adding Line Numbers to the MIT Shakespeare
in thread Adding Line Numbers to the MIT Shakespeare

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

  • Comment on Re^2: Adding Line Numbers to the MIT Shakespeare

Replies are listed 'Best First'.
Re^3: Adding Line Numbers to the MIT Shakespeare
by marto (Bishop) on Feb 14, 2013 at 18:48 UTC
    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.

        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:

        • The output file is larger than the input file. This is good, something has changed.
        • The Shakespeare dir is missing a sub directory. When I saved a play it generated:

        HTML

        <link rel="stylesheet" type="text/css" media="screen" href="lear_files +/shake.css">

        Directory/file

        C:\>dir 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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018765]
help
Chatterbox?
[1nickt]: marto would like to hear that. Of course he speaks very deliberately and dramatically, allowing pauses between words, so if anybody could pull it off it would be him, or someone impersonating him ...
[Eily]: Discipulus that's a chess joke BTW right? Because bishops don't walk straight :D
[choroba]: stop making chessy jokes about bishops!
[choroba]: I mean cheesy
[LanX]: lol
[ambrus]: no, the chess bishop itself is a joke on real bi-shops
[ambrus]: or at least on the stereotype of bi-shops
[choroba]: we call chess bishops "archers"
[Eily]: choroba sorry, I had to get that off my chess
[ambrus]: chess certainly hasn't started those stereotypes, like how kings aren't that powerful but has convinced their whole country to work for them, etc. it's just poured them to a nice clean form that would easily get propagated.

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (13)
As of 2017-09-26 12:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (294 votes). Check out past polls.

    Notices?