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 with hierarchical numbering 1.2.2.1 #327

Open
flaushi opened this issue Mar 29, 2020 · 0 comments
Open

Label with hierarchical numbering 1.2.2.1 #327

flaushi opened this issue Mar 29, 2020 · 0 comments
Labels

Comments

@flaushi
Copy link

flaushi commented Mar 29, 2020

I am using the ListRenderer to create a table of contents for a webpage (actually I use https://github.com/caseyamcl/toc and th OrderedListRenderer).

Using some CSS pseudo elements, I am able to get hierarical numbering dynamically:

<style>
		ol {
			list-style-type: none;
			counter-reset: item;
			margin: 0;
			padding: 0;
		}
		ol > li {
			display: table;
			counter-increment: item;
			margin-bottom: 0.6em;
		}
		ol > li:before {
			content: counters(item, ".") ". ";
			display: table-cell;
			padding-right: 0.6em;
		}
		li ol > li {
			margin: 0;
		}
		li ol > li:before {
			content: counters(item, ".") " ";
		}

Gives something like:
image

But would it be possible to compute and render these "addresses" and set them as value attribute in the created list? Like here https://www.w3schools.com/tags/att_li_value.asp

<li value="2.1">Übersicht</li>

Thanks in advance! Stay healty!

@garak garak added the Question label Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants