From eeffe272589cfc954536c2808c8fbeda51983d27 Mon Sep 17 00:00:00 2001 From: Tangent Date: Wed, 6 Nov 2024 17:11:15 -0700 Subject: [PATCH] more complete examples --- README.md | 3 ++- make-epub.lua | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e0acb26..3985602 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,8 @@ Example: "sections": { "start": 1, "finish": 4, - "naming": "Chapter" + "naming": "Chapter", + "automatic_naming": true }, "page_counts": [1, 5, 3, 3] } diff --git a/make-epub.lua b/make-epub.lua index aee5fd1..867f601 100755 --- a/make-epub.lua +++ b/make-epub.lua @@ -29,7 +29,8 @@ Configuration example(s): "sections": { "start": 1, "finish": 4, - "naming": "Chapter" + "naming": "Chapter", + "automatic_naming": true }, "page_counts": [1, 5, 3, 3] } @@ -94,17 +95,17 @@ local function get_config() -- print("config done") if not config.authors then - config.authors = {} -- at least have an empty table so it doesn't error below - end - - if config.author then -- old style single author will be prepended to authors list - table.insert(config.authors, 1, config.author) + config.authors = {} -- at least have an empty table so it doesn't error below TODO verify that this is actually true end if not config.keywords then config.keywords = {} -- TODO test if it will work empty end + if config.author then -- old style single author will be prepended to authors list + table.insert(config.authors, 1, config.author) + end + -- detecting manually specified sections and flagging it to the rest of the script if config.sections[1] then config.sections.start = 1