View Single Post
Old 02-21-2017, 11:47 AM   #4
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Quote:
Originally Posted by Tex2002ans View Post
Are these IDs being generated by some outside program?
No, manually made, just as an example to show how ugly and longwinded this code gets.

Quote:
It is typically better to create human-readable code... so this gibberish:

Code:
<h3 id="uwSzW8DWUPEK6RzzmX5nCi4"><a href="Inhalt.html#u2BtpeVxwIEyIFtCSZ7oQU6">Golkonda</a></h3>
might be fixed into this:

Code:
<h3 id="Golkonda"><a href="Inhalt.html#Section5">Golkonda</a></h3>
Making it that way will also make your life a lot easier when you are trying to debug problems (broken links, links that send you to the wrong locations, etc.).
It's one possibility.

Click image for larger version

Name:	Inhalt.png
Views:	192
Size:	51.8 KB
ID:	155185
Inhalt Start of Contents of one book of six. Alltogether more then thousand headings. That needs a sophisticated system. In accordance with the character on an ID such one should look like e.g. u7yl38 - like a randomly generated sequence of characters - not like Mai_und_Mais etc.

Status Quo:
Code:
IN CONTENTS
  <li><a href="Wiener_Symptome.html#Mai und Mais" id="umBEMpICNPq2GwgIRSssJq5">Mai und Mais</a></li>
IN BOOK
   <h3 id="ughWpyPh6ETHp8Eqf99tJc8"><a href="Inhalt.html#Mai und Mais">Mai und Mais</a></h3>
Your way would look like that:
Code:
IN CONTENTS
  <li><a href="Wiener_Symptome.html#Mai_und_Mais" id="Mai_und_Mais">Mai und Mais</a></li>
IN BOOK
  <h3 id="Mai_und_Mais"><a href="Inhalt.html#Mai_und_Mais">Mai und Mais</a></h3>
Warning message
Quote:
The id 1 example for example is not a valid id. IDs must start with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
Reasons: ID starts with number & contains empty spaces. I got headings with a range of unallowed characters, like parentheses ("( )"), brackets ("« »"), question marks ("?"), exclamation marks "!") etc.

Anyhow I have to find a generally acceptable way to create them automatically, with any regex. I tend to a randomly generated 6 character ID (only lower case a-z would produce 308915776 ID's, about. Errors excepted.

Last edited by chaot; 02-21-2017 at 11:51 AM.
chaot is offline   Reply With Quote