![]() |
[Plugin] reLink 1.0a : Link unspecified href to the right XHTML file.
1 Attachment(s)
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>Code:
<a href="../Text/Chapter003.xhtml#myid001">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 |
Thanks for contributing this plugin!
I did a quick test and it appears that your plugin will prefix fragment ids with the file name if it can be found in any file. To make it even more useful, I'd recommend the following: 1. Add the following line to plugin.xml to automatically start the plugin: Code:
<autostart>true</autostart>3. 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. |
Quote:
not work plugin Status: failed Traceback (most recent call last): File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 134, in launch target_script = __import__(script_module) File "C:\Users\com106\AppData\Local\sigil-ebook\sigil\plugins\reLink\plugin.py", line 4, in <module> from bs4 import BeautifulSoup ImportError: No module named 'bs4' Error: No module named 'bs4' Please suggest |
Quote:
The easiest "fix" would be to change line 4 of plugin.py from: Code:
from bs4 import BeautifulSoupCode:
try: |
1 Attachment(s)
I've updated the pulgin as Doitsu and DiapDealer said.:2thumbsup
Quote:
Thanks for the help bro. :thanks: |
| All times are GMT -4. The time now is 08:54 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.