![]() |
#1 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Feb 2024
Device: none
|
How to Detect and Format "Side Story" with Calibre
Hello all!
I convert several txt files to epubs via Calibre, and several of these txt files have chapters that I would like to be detected as "Side Story 1" or "Side Story 2-3" etc. etc. I'm going crazy trying to find a way for Calibre's struction detection to detect and consistently format these headers the same as regular chapters. Taking Calibre's default: Code:
//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part\s+', 'i')) or @class = 'chapter'] Code:
//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|side\s+story|section|part\s+', 'i')) or @class = 'chapter'] Code:
//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|side\sstory|section|part\s+', 'i')) or @class = 'chapter'] Code:
//*[((name()='h1' or name()='h2') and re:test(., '\s*((chapter|book|section|part)\s+)|((prolog|prologue|epilogue)(\s+|$))', 'i')) or @class = 'chapter' or contains(., 'Side Story')] Code:
//*[(re:test(., '\s*((chapter|book|section|part)\s+)|((prolog|prologue|epilogue)(\s+|$))', 'i')) or @class = 'chapter' or contains(., 'Side Story')] For example, my regular chapters are auto-formatted to: Code:
<h2 id="calibre_toc_2" class="calibre4">Chapter 2</h2> Code:
<p id="calibre_toc_21" class="calibre3">Side Story 3</p> Is there any way to adjust settings so that I can consistently detect and format Side Story chapters to be the same as regularly detected chapters? Any help would be greatly appreciated! |
![]() |
![]() |
![]() |
Tags |
calibre, formating title, structure detection, toc, txt conversion |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre "save to disk", "last_modified" field format | bodiccea | Calibre | 20 | 09-01-2018 04:09 AM |
Request: separate "Preferred output format" from "Save to Disk" format | Katsunami | Calibre | 2 | 08-24-2014 11:23 AM |
Free Short Story: "Hunter's Pond" (multi-format) | tammycravit | Self-Promotions by Authors and Publishers | 0 | 10-29-2010 10:17 PM |
converting to "same" format - any side effects? | cybmole | Calibre | 17 | 09-20-2010 07:16 AM |
Getting calibre to detect "Prologue" and "Epilogue" for TOC | sherman | Calibre | 2 | 09-20-2010 02:21 AM |