Wouldn't it be easier to recommend to users they add an html comment to the first file or define display:none header with the filename in the first file, or add a metadata element to the opf with that info and then invoke the output plugin? Your plugin could easily determine if the user has done this and if so read and use it otherwise default to a generic output filename.
Alternatively, parse the opf to get the main book title and remove unwanted/unsafe chars from it and use that as a suggested title.
|