onlyafly / number-headings-obsidian

Automatically number headings in a document in Obsidian
MIT License
113 stars 11 forks source link

Highlight active header in Outline pane #2

Closed DutchPete closed 2 years ago

DutchPete commented 3 years ago

Is it possible that, if I am in say header 4.1.3, that header is highlighted in the Outline pane?

onlyafly commented 3 years ago

Also interesting idea. I'll see what I can do.

DutchPete commented 3 years ago

Have you been able to have a look at this?

onlyafly commented 3 years ago

I have, and it doesn't seem possible :(

However, I'm considering adding an alternative outline pane feature to this plugin. Maybe I'll turn this plugin into a super headings plugin that could add support for several headings improvements.

DutchPete commented 3 years ago

Looking forward to it 😀

DutchPete commented 3 years ago

I have just installed the Dynamic toc plug-in with which you can created a ToC at the top of the note - useful when the note is exported.

However, that ToC now has duplicate numbers because your plug-in adds numbers to the headings.

image

I like your plug-in because the numbers it creates are also shown in the Outline pane.

So, I am not sure whose issue this: the Dynamic toc plug-in's the number headings plug-in's. But since you are considering an alternative outline pane feature I was wondering if somehow the 2 could be combined or merged to allow both features.

I have raised this issue on the other's page too.

onlyafly commented 3 years ago

@DutchPete It seems like there's a lot of duplication in Obsidian plugins :)

I just finished implementing this feature as well as part of this plugin. I'm still testing to make sure it works in every case, but you can try it out here: https://github.com/onlyafly/number-headings-obsidian/tree/toc

DutchPete commented 3 years ago

@onlyafly I installed version 1.8.0 but it “Failed to load”. I looked at the files on the folder and noticed main.js is missing. I load main.js of version 1.7.3, and sure enough the plug-in loaded, but after refreshing Obs nothing showed.

In the subfolder, src I noticed a main.ts, copied that to the parent folder and renamed it to main.js after taking out the old one, but again the plug-in failed to load.

onlyafly commented 3 years ago

@DutchPete Ah, yes. Fixed now.

DutchPete commented 3 years ago

@onlyafly Yes, version 1.8.0 now loads without any problems, but ………

So, I put 1.7.3 back.

Aidurber commented 2 years ago

Hi @onlyafly, I'm the creator of Dynamic ToC. I think @DutchPete's issue can be resolved with CSS as I've mentioned here.

The alternative to CSS would be number-headings-obsidian gets re-architected to use a markdown post-processor with a higher sortOrder so it runs after the Dynamic ToC. But that sounds like a lot of work and would fundamentally change how your plugin has to work. This doesn't sound fair or worthwhile for you.

Here is what it looks like with the CSS I've suggested @DutchPete uses. image

DutchPete commented 2 years ago

@onlyafly The number duplication is actually another issue is now solved with a very simple piece of CSS code - see here.

That still leaves the original topic of this issue Highlight active header in Outline pane.

onlyafly commented 2 years ago

Thanks, I'll look into this on my side!

DutchPete commented 2 years ago

Kevin, have you been able to have a look at this?

onlyafly commented 2 years ago

@DutchPete Not yet, but I'm going to spend a couple of days fixing bugs and answering some of the questions that have come up here, so I'll try my best!

DutchPete commented 2 years ago

OK, thanks 👍

DutchPete commented 2 years ago

Kevin, no news yet I guess?

onlyafly commented 2 years ago

I can't find a way to do this without changing the basic idea behind the plugin :(

DutchPete commented 2 years ago

OK, fair enough.