obsidian-plugin-dynamic-toc icon indicating copy to clipboard operation
obsidian-plugin-dynamic-toc copied to clipboard

FR: Wikipedia style lists.

Open spoon-m4a opened this issue 2 years ago • 2 comments

I really like the Number list style, but I wonder if it would be possible to have it in the Wikipedia style, where you have 1. for your main entry, and children would be prefixed with 1.1, 1.2, etc. I've attached an image for reference

Number(Wiki style)

spoon-m4a avatar May 04 '22 15:05 spoon-m4a

Markdown doesn't help us out by default here. I'd need to build a custom heading renderer. I'll add it to the backlog and have a play around when I can find the time.

Thanks for the suggestion!

Aidurber avatar May 04 '22 17:05 Aidurber

For anyone who really likes this feature, you can directly apply this to your whole document with some custom css:

https://help.obsidian.md/How+to/Add+custom+styles

h2:before {
    counter-increment: h2counter;
    content: counter(h2counter) "\0000a0\0000a0";
}

h3:before {
    counter-increment: h3counter;
    content: counter(h2counter) "." counter(h3counter) "\0000a0\0000a0";
}

h4:before {
    counter-increment: h4counter;
    content: counter(h2counter) "." counter(h3counter) "." counter(h4counter) "\0000a0\0000a0";
}

h5:before {
    counter-increment: h5counter;
    content: counter(h2counter) "." counter(h3counter) "." counter(h4counter) "." counter(h5counter) "\0000a0\0000a0";
}

h6:before {
    counter-increment: h6counter;
    content: counter(h2counter) "." counter(h3counter) "." counter(h4counter) "." counter(h5counter) "." counter(h6counter) "\0000a0\0000a0";
}

Which looks like

image

Sandwich1699975 avatar Jun 11 '22 05:06 Sandwich1699975