From 0a84e0c56f87699e7f5ea62909ca10fa5e10ed45 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 11 Jan 2014 15:45:06 +0530 Subject: [PATCH] Conversion: Allow getting text for entries int he Table of Contents from tag attributes. Fixes #1267837 [[Enhancement] option to always use title attribute for chapter titles in TOC](https://bugs.launchpad.net/calibre/+bug/1267837) --- manual/conversion.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/manual/conversion.rst b/manual/conversion.rst index 2654925c6b..a4d8f94f97 100644 --- a/manual/conversion.rst +++ b/manual/conversion.rst @@ -536,6 +536,30 @@ Use the following HTML markup to achieve this Set the :guilabel:`Level 1 TOC` setting to ``//h:h2``. Then, for chapter two, |app| will take the title from the value of the ``title`` attribute on the ``

`` tag, since the tag has no text. +Using tag attributes to supply the text for entries in the Table of Contents +----------------------------------------------------------------------------- + +If you have particularly long chapter titles and want shortened versions in the +Table of Contents, you can use the title attribute to achieve this, for +example: + +.. code-block:: html + + + +

Chapter 1: Some very long title

+

chapter 1 text...

+

Chapter 2: Some other very long title

+

chapter 2 text...

+ + + +Set the :guilabel:`Level 1 TOC` setting to ``//h:h2/@title``. Then |app| will +take the title from the value of the ``title`` attribute on the ``

`` tags, +instead of using the text inside the tag. Note the trailing ``/@title`` on the +XPath expression, you can use this form to tell |app| to get the text from any +attribute you like. + How options are set/saved for Conversion -------------------------------------------