Groups | Search | Server Info | Login | Register


Groups > comp.infosystems.www.misc > #202

Re: Program to Split Single-Page HTML Documentation

Message-ID <64cce9fd@news.ausics.net> (permalink)
From Computer Nerd Kev <not@telling.you.invalid>
Subject Re: Program to Split Single-Page HTML Documentation
Newsgroups comp.infosystems.www.misc, comp.os.linux.misc
References (1 earlier) <ee6npjxig4.ln2@Telcontar.valinor> <423fa31-6dd-a7a8-7758-4eca1c952b4@email.de> <64c9941b@news.ausics.net> <d9ddb265-e637-7a8-b6e6-b1d7a6281a3c@email.de> <c9c81087-9545-e093-51a9-84a38531e9c7@email.de>
Date 2023-08-04 22:07 +1000
Organization Ausics - https://www.ausics.net

Cross-posted to 2 groups.

Show all headers | View raw


In comp.os.linux.misc Helmut Richter <hr.usenet@email.de> wrote:
> On Wed, 2 Aug 2023, Helmut Richter wrote:
>> Out-of-page links are trivial: replace each link "#xyz" by "subpage#xyz". 
>> It is known to which subpage each link belongs, at least if you go over 
>> the text in two passes. This is a procedure which I apply to all my web 
>> pages, which are written as one document, and split into pieces later.
> 
> It might be interesting to see an example of the TOC (table of contents) 
> of such a split article (https://hhr-m.de/sw-fibel/contents.html). It 
> contains all anchors in the whole article, which are possible but not 
> necessarily used (except from the TOC, of course) link targets. The link 
> structure might be still better visible if you look into the source code 
> of that web page which is fairly readable.

I think you misunderstood the problem. Perhaps I should have
explained that I would prefer it to rewrite relative links to other
webpages as absolute links.

As it is, a link like this:
<a href="/documentation/computers/processors.html#bcm2835">BCM2835</a>

From here:
https://www.raspberrypi.com/documentation/computers/configuration.html

Doesn't work when conveted unless the processors.html page is also
saved locally. Seeing as the program saw the source URL, I would
have liked it to be smart enough to turn such relative links into
absolute links when the link distination is another webpage.

This has fixed many of those relative links which had a directory
path:
for page in *.html; do sed -i \
's/<a href="\//<a href="https:\/\/www.raspberrypi.com\//g' $page; done

Pre-processing the page to rewrite relative links to other pages in
the same directory when the path isn't in the href, before running
HTMLDOC, would fix the rest.

Such as this:
<a href="config_txt.html#video-options">

It's not a major complaint.

-- 
__          __
#_ < |\| |< _#

Back to comp.infosystems.www.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Program to Split Single-Page HTML Documentation Computer Nerd Kev <not@telling.you.invalid> - 2023-07-31 14:49 +1000
  Re: Program to Split Single-Page HTML Documentation Bud Frede <frede@mouse-potato.com> - 2023-07-31 08:21 -0400
    Re: Program to Split Single-Page HTML Documentation Computer Nerd Kev <not@telling.you.invalid> - 2023-08-01 15:57 +1000
      Re: Program to Split Single-Page HTML Documentation Bud Frede <frede@mouse-potato.com> - 2023-08-01 07:13 -0400
  Re: Program to Split Single-Page HTML Documentation "Carlos E.R." <robin_listas@es.invalid> - 2023-08-01 13:21 +0200
    Re: Program to Split Single-Page HTML Documentation Helmut Richter <hr.usenet@email.de> - 2023-08-01 14:31 +0200
      Re: Program to Split Single-Page HTML Documentation not@telling.you.invalid (Computer Nerd Kev) - 2023-08-02 09:24 +1000
        Re: Program to Split Single-Page HTML Documentation Helmut Richter <hr.usenet@email.de> - 2023-08-02 22:29 +0200
          Re: Program to Split Single-Page HTML Documentation Helmut Richter <hr.usenet@email.de> - 2023-08-03 11:44 +0200
            Re: Program to Split Single-Page HTML Documentation Computer Nerd Kev <not@telling.you.invalid> - 2023-08-04 22:07 +1000
              Re: Program to Split Single-Page HTML Documentation "23k.304" <23k304@bfxw9.net> - 2023-08-05 00:45 -0400
                Re: Program to Split Single-Page HTML Documentation Computer Nerd Kev <not@telling.you.invalid> - 2023-08-05 18:21 +1000
                Re: Program to Split Single-Page HTML Documentation Helmut Richter <hr.usenet@email.de> - 2023-08-05 10:56 +0200
                Re: Program to Split Single-Page HTML Documentation "23k.304" <23k304@bfxw9.net> - 2023-08-05 23:37 -0400
                Re: Program to Split Single-Page HTML Documentation "23k.304" <23k304@bfxw9.net> - 2023-08-05 23:39 -0400
    Re: Program to Split Single-Page HTML Documentation not@telling.you.invalid (Computer Nerd Kev) - 2023-08-02 09:39 +1000
  Re: Program to Split Single-Page HTML Documentation Theo <theom+news@chiark.greenend.org.uk> - 2023-08-07 18:51 +0100
    Re: Program to Split Single-Page HTML Documentation not@telling.you.invalid (Computer Nerd Kev) - 2023-08-08 09:06 +1000

csiph-web