Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > Non-English Discussions > Deutsches Forum > Erste Hilfe

Notices

Reply
 
Thread Tools Search this Thread
Old 09-08-2014, 07:20 AM   #1
faltradl
Guru
faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.
 
Posts: 602
Karma: 1712372
Join Date: Feb 2013
Location: germany
Device: PocketBook Touch
Epub: Alphabetisch sortiertes Inhaltsverzeichnis?

Hallo zusammen,

es könnte ja sein, dass jemand zufällig die Lösung kennt.

Wie ein normals TOC und ein HTML-TOC eingefügt werden ist bekannt. Das ist ja auch keine Hexerei, da Sigil und Calibre-Editor das auf Knopfdruck erledigen.

Mein Problem ist, dass ich eine Sammlung von Liedern zusammengestellt habe, die nach Datum sortiert ist. Das ist so beabsichtigt, und das normale TOC soll das auch so wiedergeben. Aber ich hätte gerne ein zusätzliches HTML-TOC, das aber alphabetisch sortiert ist. Klar, kann man per Handarbeit erledigen. Aber bei über 200 Einträgen wird das dann doch zur Strafarbeit.

Das "Rezept" kann ruhig eine Frickelei über 5 Ecken sein. Hauptsache es ist trotzdem deutlich einfacher als reine Handarbeit.

Gruß, Faltradl
faltradl is offline   Reply With Quote
Old 09-08-2014, 08:17 AM   #2
dickloraine
Guru
dickloraine ought to be getting tired of karma fortunes by now.dickloraine ought to be getting tired of karma fortunes by now.dickloraine ought to be getting tired of karma fortunes by now.dickloraine ought to be getting tired of karma fortunes by now.dickloraine ought to be getting tired of karma fortunes by now.dickloraine ought to be getting tired of karma fortunes by now.dickloraine ought to be getting tired of karma fortunes by now.dickloraine ought to be getting tired of karma fortunes by now.dickloraine ought to be getting tired of karma fortunes by now.dickloraine ought to be getting tired of karma fortunes by now.dickloraine ought to be getting tired of karma fortunes by now.
 
Posts: 631
Karma: 7544080
Join Date: Apr 2013
Location: Berlin
Device: PRS 350, Kobo Aura
Dürfte nicht so schwer sein. Erstelle ein html-toc. Das kopierst du dann in ein einfaches textdokument. Öffne das textdokument mit notepad++. Jetzt wird es etwas frickelick: mach eine regex ersetzung, die den ganzen anfang jedes eintrags an das ende des eintrags verschiebt, so das jeder eintrag mit dem Titel beginnt. Jetzt kannst du alle Einträge mittels txtfx sortieren. Dann eine weitere regex Ersetzung, welche die obrige wieder rückgängig macht. Das ist nun das neue Inhaltsverzeichnis und kann einfach in das epub eingefügt werden.
dickloraine is offline   Reply With Quote
Old 09-08-2014, 08:31 AM   #3
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Wenn Du einen einfachen (einstufigen) HTML-TOC in Sigil erstellt hast, würde ich erst bei jedem TOC-Eintrag mit Regex-Suche die Zeilenumbrüche entfernen:

Find:<div class="(.*?)">\n\s*<a href="(.*?)">(.*?)</a>\n</div>
Replace:<div class="\1"><a href="\2">\3</a></div>

Anschließend würde ich die so umformatierten Einträge in die zweite Spalte einer Excel-Datei kopieren und mit einem zweiten Regex-Ausdruck den Text extrahieren, der zum Sortieren verwendet werden soll:

Find:<div class="(.*?)"><a href="(.*?)">(.*?)</a></div>
Replace:\3

Anschließend musst Du nur die Kapiteltitel in die erste Spalte der Excel-Tabelle kopieren, die Tabelle nach der ersten Spalte sortieren und danach die sortierten Einträge aus der zweiten Spalte wieder in Sigil einfügen. (Sigil fügt die fehlenden Seitenumbrüche automatisch ein, wenn Du die Option "Pretty Print" oder "Clean Source" aktiviert hast.)

Bei mehrstufigen TOC-Einträgen funktionieren die Regex-Ausdrücke natürlich nicht. Der erste Ausdruck sucht nach einem TOC-Eintrag nach dem Muster:

Code:
<div class="sgc-toc-level-1">
  <a href="../Text/frontmatter001.html">Vorwort</a>
</div>
wandelt ihn um in:

Code:
<div class="sgc-toc-level-1"><a href="../Text/frontmatter001.html">Vorwort</a></div>
und letztendlich in:

Code:
Vorwort
Doitsu is offline   Reply With Quote
Old 09-08-2014, 09:59 AM   #4
faltradl
Guru
faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.
 
Posts: 602
Karma: 1712372
Join Date: Feb 2013
Location: germany
Device: PocketBook Touch
Danke! - Ui, da habe ich ja was zum erst mal verdauen.

Das normale TOC ist zweistufig. Zwischenüberschriften für Zeiträume, doch die will ich in dem zusätzlichen HTML-TOC gar nicht drin haben. Bleibt also nur eine Ebene übrig.

Die Zwischenüberschriften kann ich notfalls auch von Hand rauslöschen, ehe ich dann mit der trickreichen Frickelei weitermache. Das sind nur ein paar wenige.

Schaun'n 'mer mal...
faltradl is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Leiste in der Autoren alphabetisch nach Vorname sortiert werden? Populär Software 0 01-25-2014 02:16 AM
Calibre 1.12: Word -> epub Inhaltsverzeichnis AnselmR Software 0 11-26-2013 06:10 AM
PDF Inhaltsverzeichnis übernehmen tuxianer Software 0 03-21-2010 08:36 AM
Frage zu ungültiger ePub-Datei und Inhaltsverzeichnis polyfragmentiert Erste Hilfe 4 11-22-2009 08:09 AM
Inhaltsverzeichnis unter »calibre« Insider Erste Hilfe 2 09-18-2009 12:59 AM


All times are GMT -4. The time now is 12:14 AM.


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