I have dataview scripts that only provide data in Reading view. So that makes it a breaking issue for me.
In the way the plugin is currently set up, it works in both editing and reading view, with the live preview both enabled and disabled. However, it seems to only work on my end, where on other clients there seem to be vastly different issues.
Iām currently working on a way to minimize inconsistencies, which will also fix the multi-tab issue. Iāll make sure to test it on more devices and OSs before announcing the new version here.
This is my first time working on an Obsidian plugin, so please have patience with the back and forth!
Maybe a theme conflict? I use the Minimal Theme
Ok maybe not. I switched to the default and had to turn Readable line length back on. still had zeros on everything.
@Platon_Ivanov the plug-in does show up in my Settings now!
Nevertheless, the scroll issue whereby the numbers change is still present in the plug-in.
Iāve dug a little deeper and hereās what the CodeMirror reference manual says about the viewport:
To be able to display large documents without consuming too much memory or overloading the browser, CodeMirror only draws the code that is visible (plus a margin around it) to the DOM. This property tells you the extent of the current drawn viewport, in document positions.
So the CSS only solution would produce problems @Klaas came across, since elements which donāt exist on the screen couldnāt be picked up by CSS counters. Furthermore, the first plugin solution wouldnāt work either, since at its core it still used CSS selectors to pick up DOM elements.
So I tried a new solution which is CodeMirror-based. This way we should avoid the issues with CSS selectors.
Please take a look at the new version and let me know if it works for you:
Thanks for the effort. Unfortunately, the scrolling issue persists.
Do you not see it at your end?
Hello!
It has been a while since my last update. I had a very busy period, but now I finally found time to work on the plugin again.
It took me quite a bit of time to think of how to do it properly. On the previous CSS based solutions (oh, what simple times) we had the scrolling issue, which was caused by rendering optimizations built into Code Mirror. I tried to incorporate counting even with some text which isnāt being rendered using many different ways. The final solution turned out to be much, much simpler in the end, which Iām happy about.
Now live preview counting works no matter the document length.
There are also some settings (the number separators and the heading level you want to start counting from (if you want to skip first-level headings for example)). Itāll be good to add more settings in the future, especially in regards to styling.
The markdown preview, however, doesnāt work quite as well as Iād imagine itā¦
- it sometimes doesnāt count correctly, so you have to switch to editing mode and back
- if you have the same file opened in two tabs, you have to switch to editing mode and back to update the count
Iāll be looking for solutions to these issues, hopefully there is a way to track file changes and refresh all the related views. I wasnāt able to find it today.
Please let me know whether the current version works for you and if you find new bugs, please describe them here or start an issue on GitHub!
@Platon_Ivanov Hi there, long time no speak, I thought you had abandoned the plug-in.
Before I try it (probably tomorrow) I have 1 question:
when you say āmarkdown previewā, do you mean Live Preview, Reading, or Source Editor?
I mean the Reading mode.
Yes, that works now
Yes that works now!!
Yes, thatās good; I stick with your default settings
I personally donāt mind because I donāt really use Reading mode.
Good improvements.
I have opened an issue, #5, on Github. I think I may have inadvertently messed up the number - oh boy, me and numbers
Just curious, what font is this that youāre using here? Are you using that only for the interface or for the font in the editor/preview as well.
Hi,
Iāve been using @Platon_Ivanov 's EXCELLENT plugin. Found some issues with the build, and after fixing them, went on to add support for:
(1) global apply visual numbering by default or based on note frontmatter
(2) Note frontmatter property: āvisually-number-headings: trueā or āvisually-number-headings: falseā; this will override the global default, so numbering can be switched on/off on a note-by-note basis.
(3) Some style adjustments so the collapse indicators are not obscured
The plugin with the above changes can be found here:
Iāve submitted pull requests to the original, but have not heard back.
I couldnāt install this with BRAT.
Error message: The release is not complete and cannot be download. main.js is missing from the Release
I hope Ivanov is OK. His name suggests he may be from an area currently in war.