Re: split an html file

2014-04-22 Thread Mike McClain
On Sat, Apr 19, 2014 at 08:30:50AM +0100, Maurice McCarthy wrote:
 On 2014-04-17 18:01, Mike McClain wrote:
 Hi,
 My brother Rick, a windrider, put together a webpage,
 http://www.photographers1.com/Sailing/NauticalTermsNomenclature.html
 about sailing and wind surfing that has grown too large and should be
 split into smaller sections to reduce load time.
 Can anyone point me to any tools/modules that would automate the
 process of fixing all the links?

 I'm only a beginner in Perl myself so I don't know the perl tool or
 module but I'd imagine that the html editor Bluefish would make this
 fairly easy, but not automatic. Split your page into several, then
 lets assume there is one page per letter of the alphabet. You can
 select all pages as separate tabs and change all references from
 present-url#A to pageA-url.

 Just an idea
 Moss

Thank you Moss for the thought.
Most any editor will do a global search and replace as will sed and
perl itself but I'm hoping to find a tool that will automate that process
rather than, as in the case you proposed, issuing 26 or more separate
commands.
Mike
--
In theory, there is no difference between theory and practice.
In practice, there is.  - Yogi Berra

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: split an html file

2014-04-21 Thread 'lesleyb'
On Thu, Apr 17, 2014 at 10:01:35AM -0700, Mike McClain wrote:
 Hi,
 My brother Rick, a windrider, put together a webpage,
 http://www.photographers1.com/Sailing/NauticalTermsNomenclature.html
 about sailing and wind surfing that has grown too large and should be
 split into smaller sections to reduce load time.
 Can anyone point me to any tools/modules that would automate the
 process of fixing all the links?
That's an awesome effort by your brother, Mike.

As far as automating the re-assigment of links: Use something like
HTML::TokeParser::Simple - https://metacpan.org/pod/HTML::TokeParser::Simple

Then you can replace
http://www.photographers1.com/Sailing/NauticalTermsNomenclature.html#Knot 
with something like 
http://www.photographers1.com/Sailing/Encyclopedia/K.html/#Knot 
assuming you have all the entries starting with K split to K.html of course.

The anchor tags e.g. A Name=KnotKnot/A  won't need to be changed.

Kind regards

Lesley

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: split an html file

2014-04-21 Thread Uday Vernekar
Awesome..Lesley



On Mon, Apr 21, 2014 at 4:00 PM, lesleyb lesl...@herlug.org.uk wrote:

 On Thu, Apr 17, 2014 at 10:01:35AM -0700, Mike McClain wrote:
  Hi,
  My brother Rick, a windrider, put together a webpage,
  http://www.photographers1.com/Sailing/NauticalTermsNomenclature.html
  about sailing and wind surfing that has grown too large and should be
  split into smaller sections to reduce load time.
  Can anyone point me to any tools/modules that would automate the
  process of fixing all the links?
 That's an awesome effort by your brother, Mike.

 As far as automating the re-assigment of links: Use something like
 HTML::TokeParser::Simple -
 https://metacpan.org/pod/HTML::TokeParser::Simple

 Then you can replace
 http://www.photographers1.com/Sailing/NauticalTermsNomenclature.html#Knot
 with something like
 http://www.photographers1.com/Sailing/Encyclopedia/K.html/#Knot
 assuming you have all the entries starting with K split to K.html of
 course.

 The anchor tags e.g. A Name=KnotKnot/A  won't need to be changed.

 Kind regards

 Lesley

 --
 To unsubscribe, e-mail: beginners-unsubscr...@perl.org
 For additional commands, e-mail: beginners-h...@perl.org
 http://learn.perl.org/





-- 
*
Don't ask them WHY they hurt you,
because all they'll tell you is lies and excuses.
 Just know they were wrong, and try to move on.
**


Re: split an html file

2014-04-19 Thread Shlomi Fish
Hi Mike,

On Thu, 17 Apr 2014 10:01:35 -0700
Mike McClain mike.j...@nethere.com wrote:

 Hi,
 My brother Rick, a windrider, put together a webpage,
 http://www.photographers1.com/Sailing/NauticalTermsNomenclature.html
 about sailing and wind surfing that has grown too large and should be
 split into smaller sections to reduce load time.
 Can anyone point me to any tools/modules that would automate the
 process of fixing all the links?

Not sure if there's anything ready made, but you can use an HTML
parsing/manipulation module or framework. See:

* http://perl-begin.org/uses/text-parsing/

* http://perl-begin.org/uses/web-automation/

(*Note*: perl-begin.org is a site I originated and maintain).

And write some code using it.

Before you do all that, it is a good idea to make sure the HTML markup
validates so the parser will have an easier time:

* http://perl-begin.org/tutorials/bad-elements/#generating_non_valid_markup

See:

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.photographers1.com%2FSailing%2FNauticalTerms%26Nomenclature.html

Perhaps https://metacpan.org/pod/HTML::Tidy and
https://github.com/petdance/tidyp will prove of utility.

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Optimising Code for Speed - http://shlom.in/optimise

The apple completely supplanted the tree.
— http://www.shlomifish.org/humour/Summerschool-at-the-NSA/

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: split an html file

2014-04-19 Thread Maurice McCarthy

On 2014-04-17 18:01, Mike McClain wrote:

Hi,
My brother Rick, a windrider, put together a webpage,
http://www.photographers1.com/Sailing/NauticalTermsNomenclature.html
about sailing and wind surfing that has grown too large and should be
split into smaller sections to reduce load time.
Can anyone point me to any tools/modules that would automate the
process of fixing all the links?
Thanks,
Mike
--
Why is it that all of the instruments seeking intelligent life
in the universe are pointed away from Earth?



Hi,

I'm only a beginner in Perl myself so I don't know the perl tool or 
module but I'd imagine that the html editor Bluefish would make this 
fairly easy, but not automatic. Split your page into several, then lets 
assume there is one page per letter of the alphabet. You can select all 
pages as separate tabs and change all references from present-url#A to 
pageA-url.


Just an idea
Moss




--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/