I'm not sure about this because the way the tools are named, the
`build-*` tools operate directly on book directories, while other tools
generally don't. We'd need an argument to pass a directory, which is
also unusual for the toolset. I think we're trying to shoehorn new
functionality in for the sake of it... if this belongs anywhere it's in
`build-titles`.
On 12/17/23 5:04 PM, David at Standard Ebooks wrote:
> Thanks, Erin. I've tried that approach but am still struggling with it
> (as I say, my limited grasp of xpath is part of the problem). But I'm
> starting to think there's also a conceptual problem.
>
> The more I think about this project, the less I think it should be part
> of se build-title. The latter command already strips out anything which
> can't go into a HTML <title> tag, and while it's probably useful to have
> that string automatically titlecased via a command-line option, I think
> that's as far as it should go.
>
> Consider a new project where the producer is faced with a PG transcript
> where there are potentially scores of headings in all caps. As well as
> the chapter titles and subtitles, these could also include the headings
> of sub-chapters and other headings which aren't used as the source of
> the <title> tag. Titlecasing these is currently a tedious manual
> exercise, one which I typically do in the very early days of production.
>
> What do we think about modifying the* se titlecase* function in the
> following ways:
>
> 1. It will still accept a string on the command line and in that case
> return a titlecased string on the command-line.
> 2. Change it so that it will accept a string which incorporates HTML
> tags and still return a correct result on the command-line
> 3. Give it an option to work on a directory of files (obviously,
> intended to be an SE production directory).
> 4. By default when in that mode, it will titlecase the contents of any
> h2/h3... etc tag it finds (excluding titlepage.xhtml,
> uncopyright.xhtml etc.)
> 5. And/or it titlecases the content of any tag with an attribute of
>> can figure /that/ out (using .inner_xml) but I can't work out how
>> to get hold of the nodes I need to write the result back to. I
>> tried a couple of things which I've since removed.
>>
>> Any suggestions appreciated (I admit my knowledge of xpath is very
>> rudimentary).
>>
>> Here's the branch I'm working on:
>>
https://github.com/standardebooks/tools/tree/add_titlecaser_to_build_title <
https://github.com/standardebooks/tools/tree/add_titlecaser_to_build_title> .
>>
>> On 6 Dec 2023 at 9:24 AM +1100, David at Standard Ebooks
>> <
standar...@thegriggs.org>, wrote:
>>
>> Great, thanks. I’m getting close to code I’m happy with in my
>> stand-alone repository, so I’ll clean it up and move on to
>> looking at integrating it into the toolset.
>> On 6 Dec 2023 at 3:07 AM +1100, Alex Cabal
>> <
al...@standardebooks.org>, wrote:
>>
>> We just want the output to be the same as titlecase's
>> regular output. It
>> can't always do the right thing because it can only
>> understand some
>> basic rules of thumb, not the actual grammar of the sentence.
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Standard Ebooks" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to
standardebook...@googlegroups.com
>> <mailto:
standardebook...@googlegroups.com>.
>> To view this discussion on the web visit
>>
https://groups.google.com/d/msgid/standardebooks/a0b09c3c-430f-47a5-92ec-fe090473c592n%40googlegroups.com <
https://groups.google.com/d/msgid/standardebooks/a0b09c3c-430f-47a5-92ec-fe090473c592n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Standard Ebooks" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
standardebook...@googlegroups.com
> <mailto:
standardebook...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/standardebooks/67e8ea6d-999e-427e-b1c5-d5c6ecbe3be8%40Spark <
https://groups.google.com/d/msgid/standardebooks/67e8ea6d-999e-427e-b1c5-d5c6ecbe3be8%40Spark?utm_medium=email&utm_source=footer>.