automatic_naming more usable

This commit is contained in:
Tangent / Rose / Nebula Rosa 2024-12-23 13:34:34 -07:00
parent 82cfb9ecc7
commit 6a8f8e4c74
2 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,7 @@ Example:
- `manually_specified_sections`: (Optional) Boolean, must be `true`. Technically not required as the script is capable of figuring out you are using this variation, but *should be* included.
- `sections`: Array of Strings: A complete URL for each story.
- `section_titles`: (**Required**) Array of Strings: The titles to be used for Table of Contents / headings. (Must be in the same order as `sections`.)
- `automatic_naming`: (Optional) Boolean: Will match a single line against common patterns denoting the beginning of a chapter and add a heading on such lines. It's the same as `sections.automatic_naming` above.
Example:
```json

View File

@ -89,6 +89,10 @@ local function load_config(config_file_text)
config.sections = {} -- I've decided to allow empty sections (defaults to 1 section, for single story ebooks)
end
if config.automatic_naming then
config.sections.automatic_naming = true
end
-- detecting manually specified sections and flagging it to the rest of the script
if config.sections[1] then
config.sections.start = 1