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

Custom numbering with @counter-style rules #15

Open
2 of 5 tasks
Tracked by #32
bertfrees opened this issue Jan 6, 2015 · 4 comments
Open
2 of 5 tasks
Tracked by #32

Custom numbering with @counter-style rules #15

bertfrees opened this issue Jan 6, 2015 · 4 comments

Comments

@bertfrees
Copy link
Member

bertfrees commented Jan 6, 2015

  • Support symbols() function in XSLT
  • Support symbols() function in Java (while formatting)
  • Support @counter-style in css:inline
  • Support @counter-style in XSLT
  • Support @counter-style in Java (while formatting)

Related issues:

@bertfrees
Copy link
Member Author

Possible implementation of @counter-style support in Java (while formatting):

  • The '@counter-style' style sheet is read (input or option) and based on this a Translator is generated and registered on the fly. The Translator has a unique identifier that is meant to be used as the mode parameter.
  • When the method translate(int value, String style) is called, the Translator applies the counter style named style on the counter value value (note that the Translator API must be enhanced). (EDIT: This is not going to happen.)

@bertfrees
Copy link
Member Author

The alternative is to use a text-style attribute (with number-format="default") and to perform the styling/formatting on the string (which represents an integer). This means that:

  1. We need some way to mark certain text segments as counters.
  2. We need some way to distinguish special counter styles from regular text styles (CSS).

I can see two possibilities:

  • Make counter styles of the form COUNTER[foo]. The identifier foo refers to a style defined within the Translator (like in initial proposal, see previous comment).
  • Define the styles directly in the attribute, i.e. no identifiers that refer to definitions within the Translator. This is possible because counter styles can be defined as plain text (CSS). @counter-style foo { ... } could simply become @counter-style { ... }, because the identifier foo becomes obsolete when the style is applied directly on an element. Or we can be inspired by SASS and do it like counter-style: { system: ...; symbols: ... } (which in SASS would actually be compiled down to counter-style-system: ...; counter-style-symbols: ...).

The problem with the second appoach is that while it looks like CSS it is not actually valid CSS so that may cause some confusion.

EDIT: In order to solve this problem I came up with the following:

  • a new (Dotify-specific) value for text-transform called -dotify-counter
  • -dotify-counter-style: { system: ...; symbols: ... } == -dotify-counter-style-system: ...; -dotify-counter-style-symbols: ...

@bertfrees
Copy link
Member Author

Another possibility is to use "anonymous counter styles" (i.e. the symbols() function), although it does not provide the full feature-set of the @counter-style rule.

EDIT: symbols(...) would then also become a value for -dotify-counter-style.

@bertfrees
Copy link
Member Author

See daisy@dde546f, daisy@fa1ddd7

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

No branches or pull requests

1 participant