Skip to content

Doesnt fetch the correct title #40

@JLuc

Description

@JLuc

In the uploaded SLA document, so as to produce the bookmarks md out of the main title of each chapter, makebook script doesnt fetch the correct text.
It fetches the paragraph before the main title, instead of fetching the main title.

See : there are 2 main title paragraphs, and another paragraph coming before, which is the one brought back.

Image

Fichier SLA de test contains :

...
<StoryText>
	<DefaultStyle/>
	<ITEXT CH="L’association accompagne les écoles."/>
	<para PARENT="Signature" ALIGN="0"/>
	<ITEXT FONTSIZE="27" CH="un sac à dos"/>
	<ITEXT CH="  "/>
	<para PARENT="Titre Principal Grand" ALIGN="0"/>
	<ITEXT FONTSIZE="55" CH="bien trop lourd"/>
	<para PARENT="Titre Principal Grand" LINESP="24"/>
	<para/>
	<ITEXT CH="Un texte après encore"/>
	<trail PARENT="Intro"/>
</StoryText>
...

"Titre Principal Grand" is the style used to build bookmarks.

code is

# bookmark style : either as para or as trail paragraph
bookmarklabel=`xmlstarlet sel -t -v  //
  "SCRIBUSUTF8NEW/DOCUMENT/PAGEOBJECT/StoryText [para/@PARENT='$pdf_bookmark_style']/ITEXT[1]/@CH" "$fic.sla"`
if [[ "$bookmarklabel" != "" ]]
then
	bookmarktag='para '
else
	bookmarklabel=`xmlstarlet sel -t -v //
   "SCRIBUSUTF8NEW/DOCUMENT/PAGEOBJECT/StoryText [trail/@PARENT='$pdf_bookmark_style']/ITEXT[1]/@CH" "$fic.sla"`
	bookmarktag='trail'
fi

Ce doit être que le [1] prend le permier ITEXT alors que là il y en une introduction avant.

TODO

Prendre l'ITEXT dans le StoryText, avant le para "Titre principal grand", mais après le précédent para, s'il y en a un.

En attendant, si les bookmarks sont importants, il faut scinder le cadre de texte juste avant le titre bookmarké.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions