ycnmhd / obsidian-lineage

Gingko-like interface in obsidian
MIT License
107 stars 8 forks source link

[FR] Remove section mark in markdown view #46

Open khanhtoan529 opened 5 months ago

khanhtoan529 commented 5 months ago

What would you like to be added?

These section marks add directly into the markdown file, making it feel really cluttered to read or export. Could you find a way to make this plugin work without these marks?

Actual: image

Expected result: image

Why is this feature needed?

This will make the markdown file have a consistent format with other notes.

Estimated usefulness for plugin users

Useful for the majority of users

ycnmhd commented 5 months ago

You can export the document from the view context menu item export document. This will remove the comments. If your document uses headings, you can import it back using the split card card context menu item.

Alternatively, you can use the outline format to maintain hierarchy.

Could you find a way to make this plugin work without these marks

Can you suggest an alternative way for the plugin to know the hierarchy of the document?

khanhtoan529 commented 5 months ago

Can you suggest an alternative way for the plugin to know the hierarchy of the document?

Unfortunately, I'm not a software developer, so I have no idea about this. But thank you for your response.

Should this FR be closed or open for future enhancement?

ycnmhd commented 5 months ago

I can think of three ways, but I'm personally not sure if any of them is better than using plain text comments or the outline format (1) Use headings:

(2) Store the line number + line content in the plugin settings along with the structure:

(3) Use invisible <div> elements:

khanhtoan529 commented 5 months ago

I think option (3) would be fine because most of us will use live preview mode, making the section mark invisible. Additionally, if a user wants to edit that markdown file using Lineage, they will likely rarely edit it in markdown mode. They would primarily use markdown mode to check the file format, not for editing.

ycnmhd commented 5 months ago

They would primarily use markdown mode to check the file format, not for editing

If you don't mind invisible text, you can use this CSS snippet to hide comments

.cm-comment { 
  opacity: 0;
  transition: opacity 200ms;
}

.cm-comment:hover {
  opacity: 1
}
khanhtoan529 commented 5 months ago

It works great. However, I still prefer to be able to remove it instead of hiding it away. Looking for future updates ☺️