yzhang-gh / vscode-markdown

Markdown All in One
https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
MIT License
2.9k stars 324 forks source link

Heading numbering without trailing dot #714

Open Momo-Coco opened 4 years ago

Momo-Coco commented 4 years ago

What is the problem?

The feature to add/update section number is very nice, but I would like to have an option to remove the trailing dot (which is 1.1 instead of 1.1.)

How can I reproduce it?

Is there any error message in the console?

yzhang-gh commented 4 years ago

From a technical perspective, it is easy. However, it is possible that headings literally start with a (floating) number 3 or 1.5. Then we will have some trouble.

https://github.com/yzhang-gh/vscode-markdown/issues/457#issuecomment-623103838

Momo-Coco commented 4 years ago

I think it can be safely assumed that the headings are non-fractional.

yzhang-gh commented 4 years ago

I think it can be safely assumed that the headings are non-fractional.

I tend to agree with that but I don't want to take the risk as this extension has many users. I will need more feedback from other users.

Momo-Coco commented 4 years ago

What about this: put a settings checkbox "remove trailing dots in heading numbering", and if the checkbox is ticked assume the headings are integers and remove the trailing dot. If not, leave the current behavior alone. Notwithstanding, I am still ROFL at the thought somebody might number their headings as 1.4142, 2.4142, etc :)))

yzhang-gh commented 4 years ago

Don't be closed-minded (e.g. a date or a year).

I do agree that it should be really rare. But collecting more feedback is always helpful. The more users want this, the higher priority it is.

ozboss commented 4 years ago

I am +1 for this.

ts78 commented 2 years ago

I also would need an option to remove trailing dot - we are going to move our documentation to MD and this extension helps a lot for TOC generation and section numbering. But according DIN 5008 and ISO 2145, decimal outline does not have a trailing dot. See https://en.wikipedia.org/wiki/Outline_(list)#Decimal_outline for reference.

Adding just an option to switch this behaviour on/off would help a lot, so this is backwards compatible and every user can select on his own. When adding such an option it could be helpful to have this also per document. But that would be optional from my point of view.

If I could help (testing or something like this), let me know.

yzhang-gh commented 2 years ago

Thanks for the information. Then I agree that we need such an option.