BBazard / obsidian-orgmode-cm6

Orgmode plugin for Obsidian
MIT License
53 stars 2 forks source link

Feature Requests: Style Settings Support, Use Obsidian font settings, +more #8

Closed wychwitch closed 1 month ago

wychwitch commented 1 month ago

Thank you so much for making this plugin! I've been wanting something like this for literal years lmao

I have a few feature requests tho!! Some easier than others:

Style Settings Plugin Support Because not everyone is adept with CSS, it would be nice to expose some CSS properties there! While it's mostly themes who use it, some plugins such as supercharged links use it as well!

Option to use Obsidian's Font settings Something that could be rolled into the above, but I would love for it to have a toggle to use obsidian's font settings! I found the default hard to read, especially since I tend to have large org files.

A Unique Class For Header Level One issue I had when trying to css target only the top org header was that those settings trickled down to each subsequent header. Not only that, but with how the CSS is structured targeting more nested headers-levels was difficult for me.

Is it possible for each header to get an additional (generated?) header for its level? So a top level header would be org-header-1, and the next direct ones would be org-header-2 and so on. Then I could target whatever level header I want through CSS!

Those are the most pressing ones I had. If you prefer for these to get their own issues, feel free to let me know and I'll open them! I didn't want to flood your issues all at once ^^

BBazard commented 1 month ago

Glad you find it useful :slightly_smiling_face:

Thank you for your requests.

Style Settings Plugin Support I would need to look into it, it is not my priority right now. I don't consider the CSS to be stable, the classes might change as I implement more orgmode features. But it is definitely a good idea and I will review PRs about it. Feel free to open a dedicated issue.

Option to use Obsidian's Font settings No need for toggle! The org views should be consistent with markdown views. Implemented in 2.5.1

A Unique Class For Header Level Implemented in 2.5.1

I am curious to know / see what you have in mind for your CSS styling?

wychwitch commented 1 month ago

Thank you so much!! That was so quick ^^

To answer your question the main reason was to more easily change the sizes and colors of the headers (top being largest and red, then the next one being smaller and blue, etc) however I also wanted to use the ::before target to add a custom bullet with the content property! My emacs setup has custom bullets using Unicode flowers, and while I can't hide the *'s on each header on the obsidian side like I can on emacs I was just going to live with that lmao

I'll show you the before and after once I get to my computer!

wychwitch commented 1 month ago

okay I updated it and the font has been changed! Thank you so much

The addition of the .org-header-n tags also are great I can now target a header by simply going .org-header-(n-1)>.org-header-n!!

However I did notice two things:

1: While the font settings are now applied the font-size seems to still be baked in! Is it possible to also have it also fall back on obsidian's settings?

2: As of right now the org header stars are not wrapped in a tag themselves, and are instead just text before the org-title or org-section span. However, this makes it difficult to target them in css without also affecting the rest of the org tree. Is it possible to have them wrapped in a span with a class like org-stars?

In the meantime I'll attach what I've been able to do with the CSS changes so far ^^ if the org-stars change is able to go through, I'll make the bullets look a bit more consistent lmao

image

Many thanks again!! This one plugin has already helped me so much you have no idea

BBazard commented 1 month ago

Thank you for the screenshot, it looks nice :+1:

I released 2.5.2 with an option to hide the stars. In addition, the CSS classes changed a little. It's not perfect yet but it can simplify the CSS:

.org-heading.org-heading-1::before {
  content: '✿ ';
}
.theme-light .org-heading.org-heading-1 {
  color: red;
}

Tell me if that helps. I would need to investigate more the font-size, it seems to be working on my side.

wychwitch commented 1 month ago

Those changes do help a lot!! Thank you!

A for the font-size I'm not sure why it's happening... I'll try investigating it. Attached is a side-by-side example with the same text, only on the left is a regular md file

image

I thought it was a theme thing, but this is the case even on the default theme 🤔 I'll try and go through my plugins and see if any of them are causing issues !

Thanks again so much ^^

Edit: Don't worry about the stars being black, that's cos I'm experimenting with SVG lmao

wychwitch commented 1 month ago

Okay yeah I just checked, on a fresh vault w/o any other plugins or css snippets the font-size issue is still there 🤔

If it helps I'm on Windows 11 and I'm changing the font-size via Settings->Appearance->Font size (slider)

If there's any other testing I can do let me know!

BBazard commented 1 month ago

Thank you for checking, it's because I am using the minimal theme! The default theme is handled in 2.5.3. I believe everything should work as expected now :slightly_smiling_face:

Thank you for your input.

wychwitch commented 1 month ago

OH Im so sorry I thought I responded!!

Thank you so much!!! It works great now ^^ you've made my obsidian journey so smooth thank you