Quantcast
Channel: MobileRead Forums - Reading and Management
Viewing all articles
Browse latest Browse all 23783

[Plugin] reLink : Link unspecified href to the right XHTML file.

$
0
0
Hello everyone !

I just want to share this plugin "edit" that Just find the XHTML source where the ID is from and replace the link by it's real path.

Eg :
Let's suppose that there is a <p id="myid001">Text</p> in Chapter003.xhtml. So the script find it and convert all link that point to it like this :
Code:

<a href="#myid001">Text</a>
to
Code:

<a href="../Text/Chapter003.xhtml#myid001">
You just must specify an tag id so the script can find the right XHTML file to link it.

EDIT : The plugin assumes that all fragment ids are unique, however, if multiple files contain the same id they'll all be changed to the last file that the id was used in.

You can use the AddIDs by Doitsu to generate ID on your document if there is no ID in.

Requirements :
- Python 3.4
- BeautifulSoup 4
- Sigil 0.8.7

Version : 1.0a

Thanks !

NB : Sorry, my english is poor :o And it's my first post. :D

Attached Files
File Type: zip reLink_v1.0a.zip (912 Bytes)

Viewing all articles
Browse latest Browse all 23783

Trending Articles