Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move as much code as possible to Pipeline and Liblouis #75

Open
6 of 17 tasks
bertfrees opened this issue Nov 17, 2020 · 2 comments
Open
6 of 17 tasks

Move as much code as possible to Pipeline and Liblouis #75

bertfrees opened this issue Nov 17, 2020 · 2 comments

Comments

@bertfrees
Copy link
Contributor

bertfrees commented Nov 17, 2020

Hyphenation

Braille translation

  • The classes GermanInteger2TextFactoryService, GermanInteger2TextFactory, DeInt2TextLocalization BasicInteger2Text and UndefinedNumberException are not used. They can be removed. The idea was to be able to use Dotify's int2text function with German. But to be really useful the function lacks support for cases, plural, ordinal numbers, etc. The approach chosen by Pipeline is to define integer to text conversions as counter styles using @counter-style CSS rules. Counter styles can be applied to all counters including the automatic counters page and volume, and to all numeric OBFL variables (-obfl-volumes, -obfl-sheets-in-volume, etc.).

  • SBSTranslator defines a number of "text-transform" values that are used in CSS. This could be achieved instead using @text-transform rules referencing specialized Liblouis tables (and possibly utilizing Liblouis typeforms) and/or Dotify's int2text function @counter-style rules.

    • print-page: render a print page number (range) as a fraction (with normal and downshifted part)
    • toc-page: render as normal number
    • toc-print-page: render as downshifted number without number sign
    • volume: render as written-out ordinal number
    • volumes: render as written-out number in dative case ("in x volumes")
    • volume-end: render as written-out ordinal number in genitive case ("end of volume x")
    • linenum: render as normal number without number sign, and also check that number does not have more than 2 digits (99) so that it will fit
    • roman-num: render as a roman number (for page numbers on toc pages)

The SBS tables are already part of upstream Liblouis for a large part, and @egli is working on migrating them further.

After the above is done, there still might be some XSLT code left to handle certain corner cases. We'll have to see then if it makes sense to port that XSLT code to Pipeline.

Braille output format

  • SBSFileFormat defines the output file format that the output should be in. One option is to port this class to Pipeline or Dotify. If it is really specific to SBS this is not so great though. (It could also just be specific to the printer that SBS uses. We need to figure this out.) The other option is to use ConfigurableFileFormat. The equivalent "Output file format" query for selecting a ConfigurableFileFormat needs the following features:

    • (file-extension:'.brl')
    • (table:'http://www.sbs.ch/pipeline/liblouis/tables/sbs.dis')
    • (pad:BEFORE)

    In addition we'll need new features to define the following behavior:

    • Each line of braille (including empty lines) should start with a space
    • The first line of each page should start with a "p" instead of a space

Style sheets and custom script options that map to Sass variables

Everything below is about porting CSS code, which is not required to be able to make use of the generic Pipeline because CSS can be supplied as input to a conversion and therefore does not need to be included in pipeline-mod-sbs. Custom options that are solely used to set Sass variables can now be handled with the "Style sheet parameters" option. In other words consider these points optimizations rather than required steps.

@bertfrees
Copy link
Contributor Author

@egli I'd like to move forward with handling emphasis in Liblouis instead of in XSLT. Can you help me with this? I need you especially for the test cases.

@bertfrees
Copy link
Contributor Author

bertfrees commented Mar 24, 2022

My contribution to solving this issue is now more or less done. Most things that could be done on the Pipeline side are done. Except for maybe improving ConfigurableFileFormat or porting SBSFileFormat, but we first need confirmation that this item is really required and find out which approach is most suited.

I can also still provide assistance with improving support for German in Liblouis. For instance with fixing emphasis handling.

I might also port some more CSS code in the future but that has lower priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant