Closed vepo closed 10 months ago
First of all, you may use section ids to customize that behavior:
[#alternative_id]
= O Início
There was #217 where we intentionally try to add suport for Unicode filenames in generated files. Looks like KindleGen is incapable of Unicode. I guess we need to use some other naming scheme when producing Mobi files.
So let me clarify: this is a valid EPUB. EPUB spec allows unicode filenames: http://idpf.org/epub/301/spec/epub-ocf.html#sec-container-filenames. But KindleGen is not able to process it properly.
What you're probably looking for is ICU collation/transliteration, which we use in Asciidoctor PDF. See https://github.com/asciidoctor/asciidoctor-pdf/blob/main/lib/asciidoctor/pdf/index_catalog.rb#L60 I'm not convinced that throwing away the name of the chapter and replacing it with a number is a great solution.
It is extremely hard to do human-friendly identifiers.
Neither of 2+3+4 are fully implemented as of today.
I've been thinking about this issue for couple of days already and a proper solution seems to be just too much complex.
I would think you could use the same solution we use for section IDs in an AsciiDoc document. Clear away invalid characters (either via regex, ICU transformation, or both), then append a counter if the name is already used. That doesn't seem unreasonably complex to me. However, if the users are happy with a straight counter, then I suppose my case is moot.
Okay, I have a plan. I will reuse :sectids:
logic.
I have a book with some headers with Latin characters like áéíôú and other characters as the degree symbol.
An example can be
I'm executing
asciidoctor-epub3
and a the result a EPUB is create with invalid files. It's creating a file with_o_início.xhtml
and the Kindle Previewer cannot open it with the error:How can I remove all non [a-z] characters from the headers using
asciidoctor-epub3
?Is this a bug?
I'm using the GitHub action vepo/asciidoctor-action
To validate that this is the error, I unzip the generated EPUB, remove all Latin characters from the files and references and zip it again. Then it works.