View Single Post
Old 05-08-2017, 03:31 AM   #1
hantsaniala
Member
hantsaniala began at the beginning.
 
hantsaniala's Avatar
 
Posts: 16
Karma: 10
Join Date: Dec 2015
Device: sigil
[Plugin] reLink 1.0a : Link unspecified href to the right XHTML file.

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 And it's my first post.
Attached Files
File Type: zip reLink_v1.0.1a.zip (2.0 KB, 436 views)

Last edited by hantsaniala; 05-22-2017 at 05:22 AM. Reason: Updating attachement.
hantsaniala is offline   Reply With Quote