daisy / pipeline-ui

A user interface for the DAISY Pipeline 2
MIT License
5 stars 2 forks source link

Use description of option value in drop-down list #87

Closed bertfrees closed 1 year ago

bertfrees commented 1 year ago

In a drop-down list, when a description is available for an option value it should be used in the list instead of the actual value.

Note that the description can consist of multiple lines, with the first line being the short description. Obviously we can only use the short description in the list.

marisademeglio commented 1 year ago

To save me some time: what's a script that has descriptions (short + long) for options?

bertfrees commented 1 year ago

An example is the "Footnotes placement" option of DTBook to braille:

/ws/datatypes/px:dtbook-to-pef.script-notes-placement gives the following:

<choice>
  <value>bottom-of-page</value>
  <documentation xml:lang="en" xml:space="preserve">At the bottom of the page

Notes are rendered in the [`@footnotes`](http://braillespecs.github.io/braille-css/#the-footnotes-area)
area of the page on which they occur.
...
  </documentation>
  ...
</choice>
See full data-type XML ```xml bottom-of-page At the bottom of the page Notes are rendered in the [`@footnotes`](http://braillespecs.github.io/braille-css/#the-footnotes-area) area of the page on which they occur. There is a built-in fallback mechanism: if a note does not fit on a page, e.g. because it is too big, or there are too many other notes on that page, all notes in the whole book will be rendered at the end of the volume in which they occur. The footnotes area can be styled using a `@footnotes` rule. Example: ~~~css @page { @footnotes { border-top: ⠤; max-height: 20; } } ~~~ end-of-block At the end of the block Notes are rendered after the block (e.g. paragraph) in which they occur. end-of-chapter At the end of the chapter Notes are rendered at the end of the chapter (`level1`, `level2`, `level3`, `level4`, `level5`, `level6`,) in which they occur. end-of-volume At the end of the volume Notes are rendered in the [`@end`](http://braillespecs.github.io/braille-css/#the-footnotes-area) area of the volume in which they occur. end-of-book At the end of the book Notes are rendered in the [`@end`](http://braillespecs.github.io/braille-css/#the-footnotes-area) area of the last volume. Notes can be grouped by volume using a [`.endnotes-section::-obfl-on-volume-start`](http://braillespecs.github.io/braille-css/obfl#extending-the-display-property-with--obfl-list-of-references) rule. Example: ~~~css .endnotes-section::-obfl-on-volume-start { content: "Notes in volume " -obfl-evaluate("$started-volume-number"); margin: 1 0; } ~~~ custom Custom handling Special handling of notes is disabled. Notes are rendered as specified in custom style sheets. ```

The drop-down list would only contain "At the bottom of the page". The long description is the whole thing, the short description plus everything else.

Note the xml:space="preserve". I think you can assume that it is always there.