Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-20-2016, 11:29 AM   #1
jcsalomon
Zealot
jcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheese
 
jcsalomon's Avatar
 
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
Quirk: toc.ncx reformats itself

I’m using Sigil for EPUB3 books, and using Git to track changes (by unzipping, and re-zipping with a batch file that does the right thing; see elsewhere on this site). I’ve noticed that toc.ncx takes any opportunity to reformat itself from the for generated by “Tools » Epub3 Tools » Generate NCX from Nav”—nothing substantial, just changing the indentation between
Code:
<?xml version="1.0" encoding="utf-8" ?>
<ncx version="2005-1" xmlns="http://www.daisy.org/z3986/2005/ncx/">
  <head>
    <meta content="401e6912-cfe6-4cb7-8e02-f6ddea0d6467" name="dtb:uid"/>
    <meta content="1" name="dtb:depth"/>
    <meta content="0" name="dtb:totalPageCount"/>
    <meta content="0" name="dtb:maxPageNumber"/>
  </head>
and
Code:
<?xml version="1.0" encoding="utf-8" ?>
<ncx version="2005-1" xmlns="http://www.daisy.org/z3986/2005/ncx/">
<head>
  <meta content="401e6912-cfe6-4cb7-8e02-f6ddea0d6467" name="dtb:uid"/>
  <meta content="1" name="dtb:depth"/>
  <meta content="0" name="dtb:totalPageCount"/>
  <meta content="0" name="dtb:maxPageNumber"/>
</head>
—but adding a useless and confusing delta in my repository.

Very low priority, but why is this happening?
jcsalomon is offline   Reply With Quote
Old 05-20-2016, 02:12 PM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,487
Karma: 5703586
Join Date: Nov 2009
Device: many
Because the code that creates the ncx the first time from the nav is different fron the code that updates the nav/ncx when the toc is edited or changed.

I will look to see if I can track down where it is coming from. You should also look into getting a diff tool that is smart enough to ignore whitspace on xml files.

Plus order of attributes on elements in xml is not sigificant and is not preserved by most xml tools that will also introduce deltas.

Last edited by KevinH; 05-20-2016 at 02:15 PM.
KevinH is offline   Reply With Quote
Advert
Old 05-20-2016, 09:49 PM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,487
Karma: 5703586
Join Date: Nov 2009
Device: many
The ncxgenerator.py generates your second example (which is what creates it from the Nav). Any time it is changed after initial creation the NCXWriter code which uses Qt QXmlStreamWriter with auto formatting set to true and default indent of 4 not 2. I can change ncxgenerator.py to match the indented head tag and change the QXmlStreamWriter to use indents of 2.

I'll try to get that into the next release when I get back home.
KevinH is offline   Reply With Quote
Old 05-25-2016, 12:38 PM   #4
jcsalomon
Zealot
jcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheesejcsalomon can extract oil from cheese
 
jcsalomon's Avatar
 
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
Thank you.
jcsalomon is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with toc.ncx file please AlexBell ePub 7 09-04-2013 02:11 AM
Kindler previewer not recognizing toc.ncx file, my html toc, or the start point... petercrowell Kindle Formats 2 05-01-2012 08:14 AM
Toc.ncx JDawg Amazon Kindle 11 07-29-2011 04:05 AM
Inline TOC from toc.ncx elmago79 Kindle Formats 38 03-25-2011 12:56 PM
Use Regex to Code an Inline TOC, from an External TOC's .ncx File mostlynovels ePub 2 03-16-2011 12:15 PM


All times are GMT -4. The time now is 05:51 PM.


MobileRead.com is a privately owned, operated and funded community.