![]() |
#1 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 179
Karma: 91148
Join Date: Jun 2010
Device: Sony 350
|
Absolute filepaths being converted to relative?
A cursory search did not turn up the answer to my question so my apologies if it's been addressed already.
When I have internal links (such as to end notes) I prefer to use the full / absolute filepath (using Sigil's normal file structure), for example: href="../Text/notes.xhtml#footnote-1" In the very latest version(s? not sure when it started) of Sigil, these mysteriously get converted into relative filepaths: href="notes.xhtml#footnote-1" I cannot for the life of me figure out what triggers it as it doesn't appear to be on save and I don't see anywhere to set a preference for that but I am 99.99999% sure this didn't used to happen previously. Why / when does this happen, and is there a way to stop it? I'm using version 1.2 on windows 10. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Sigil 1.0+ got rid of the strict enforcement of the "Text", "Images", "Styles", "Fonts" folders.
(You could sort files back to Sigil's old way by going under Tools and clicking the new menu item.) See the 1.0.0 changelog:
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,939
Karma: 315160596
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,761
Karma: 5706256
Join Date: Nov 2009
Device: many
|
There is no way to have absolute path urls for internal epub files.
If the source xhtml is in Text/ and uses a relative href "../Text/notes.xhtml", that url is simplified to notes.xhtml since that is the correct destination. The "../Text" is unneeded and does in no way clarify the link destination. So when Sigil went 1.0, it allowed for users to have any organization they want for their epub and the need and use for prefacing a destination with its folder went away since those links can now be relative to other folders and need not be correct anymore. |
![]() |
![]() |
![]() |
#5 | |||
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 179
Karma: 91148
Join Date: Jun 2010
Device: Sony 350
|
Quote:
![]() Quote:
Quote:
One of the things I like about Sigil is that in general it does not modify my code unless explicitly allowed (in preferences or with a dialog box), which doesn't seem to be the case here. If "../Text" is unneeded, but not actually incorrect, since I am explicitly deliberately setting my internal file structure to that, does it matter if I write the filenames that way? If it matches the real file structure and won't cause problems, why change it? As I said, it's down to a question of habit for me and I don't mind changing if there is a reason to but either way, I'd prefer it if my code wasn't changed in the background (if only so I don't start to wonder if I'm going crazy when I do search / replace all for 50 footnote links to add "../Text" to the front of them and then 5 minutes later that bit of code has disappeared. I did that S/RA 3 times on the same file the other day thinking maybe I'd not selected "all html files" or something, I thought I was going mad ![]() |
|||
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,761
Karma: 5706256
Join Date: Nov 2009
Device: many
|
Any move or rename or splitting or merging of anything will invoke the update all links code. This code was always run from the beginning. In the old Sigil the added the folder to the path was a workaround instead of resolving the simplest relative path.
So your version of the link from epub root we be would be the following: OEBPS/Text/../Text/notes.xhtml which would then need to be simplified. whereas in current Sigil the link destination will be built as OEBPS/Text/notes.xhtml with no further simplification needed. So if you stop making any changes to the epub or mending of code, no changes will be made to links. But once a file name is changed or a mend is done, a split is done, etc, the links will be corrected and properly updated, just as Sigil always has done. |
![]() |
![]() |
![]() |
#7 | ||
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 179
Karma: 91148
Join Date: Jun 2010
Device: Sony 350
|
Sorry, somehow I completely missed out seeing this until now.
Quote:
Quote:
Anyway thanks for taking the time to explain it. |
||
![]() |
![]() |
![]() |
#8 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Nov 2020
Device: Kindle Oasis
|
Updated Links on Split
Hi
It is so long that I used the forum that I have had to re-register! I have been using Sigil for a number of years and recently updated to 1.4.2. (Windows 10). I have noted an issue regarding splitting files and the updating of links. When creating links to footnotes I use the following format: <a id="fn1" href="#en1"> and then close off with </a>. In the past, when I split the file into chapters the links were updated automatically to reflect the split files. When I split a file now the link stays the same. Is there a setting I need to change or is it the way I have formatted the tag? The posts above suggest that the link update should be automatic. I have another query regarding file splitting and performance but will raise this in a separate thread. Many thanks. |
![]() |
![]() |
![]() |
#9 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,761
Karma: 5706256
Join Date: Nov 2009
Device: many
|
Yes this is a bug! I have just now committed a fix for it to master. The Sigil devs need to think about a Sigil-1.4.3 release or not.
As for performance in splitting really really long files, the best approach is to use find and replace to manually insert split markers all at once. Then running SplitAtMarkers which should use QtConcurrent and multiple threads to help speed up things. If you do splitting manually, you should start at the end of the file and split pieces off from the bottom. It is a bit faster that way. But before doing that, if you do a lot of file splitting, I would revert to Sigil-1.3.0 for now until or if a Sigil-1.4.3 makes the scene. Sorry about that. And thank you for your bug report! Quote:
Last edited by KevinH; 11-30-2020 at 02:40 PM. |
|
![]() |
![]() |
![]() |
#10 | |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Nov 2020
Device: Kindle Oasis
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Absolute beginner confused Help! | LivingLegend | Kindle Developer's Corner | 9 | 12-29-2021 10:03 AM |
Relative Paths in Comments | Hudaman | Calibre | 24 | 04-06-2018 06:45 AM |
The Opposite of Absolute | RobertLCollins | Self-Promotions by Authors and Publishers | 0 | 12-14-2012 09:26 AM |
The Ponotrons and the Anarchists of the Absolute | D. Florakis | Self-Promotions by Authors and Publishers | 0 | 12-11-2012 03:44 PM |
Absolute middle | Jorge Junior | Sigil | 6 | 10-02-2012 09:19 AM |