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

label-template on ol/li #653

Open
opoudjis opened this issue Feb 12, 2025 · 4 comments
Open

label-template on ol/li #653

opoudjis opened this issue Feb 12, 2025 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@opoudjis
Copy link
Contributor

metanorma/firelight#41

As metanorma/metanorma-iso#319 https://github.com/metanorma/metanorma-iso/blob/main/lib/isodoc/iso/html/style-iso.scss will show, changing the rendering in HTML of a ordered list label is convoluted.

The only way this is going to be realisable at all is by providing a separate value for the rendering template: the label needs to be kept alone as a value, which would be the input into any CSS counter, and then styled by the template:

ol[class="roman"] > li::before {
  counter-increment: roman;
  content: counter(roman, lower-roman)") "
}

The CSS would need to be content: %), with % replaced by the counter value derived from label: b.

I will add a label-template attribute to ol/li, which by default will be "%." and in this instance will be "%)".

@opoudjis opoudjis added the enhancement New feature or request label Feb 12, 2025
@opoudjis opoudjis self-assigned this Feb 12, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in Metanorma Feb 12, 2025
@ronaldtse
Copy link
Contributor

ronaldtse commented Feb 12, 2025

We should probably generalize this task because an unordered list also have list labels that are customized depending on list levels and indent levels.

@opoudjis
Copy link
Contributor Author

Do you mean unordered lists? This is as generalised as ordered list labels get.

@ronaldtse
Copy link
Contributor

Yes indeed. Updated the comment.

@opoudjis
Copy link
Contributor Author

opoudjis commented Mar 1, 2025

We need to provide list hierarchy / label styling definitions in the presentation XML so that renderers like PDF and Firelight can render them properly:

unordered lists
ordered lists
We do not want individual XML downstream renderers making up their own implementation for list styling, references and labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🏗 In progress
Development

No branches or pull requests

2 participants