oleeskild / obsidian-digital-garden

MIT License
1.42k stars 128 forks source link

Is there a way to exclude portion of a note from being published? #302

Closed giocoal closed 1 year ago

giocoal commented 1 year ago

Hi! First of all, thank you for this incredible extension, so useful and easy to use.

My question is: is there a way to exclude portion of a note from being published?

shinanqu commented 1 year ago

I also thought about such a feature. Often I want to add private information to a note that isn't meant to be published. Currently, I just refrain from doing so. Such an option would be very useful.

K1ngP3ach commented 1 year ago

This is exactly what I would like to know as well! I am planning a D&D campaign and would like to use the DG as an in-game reference encyclopedia and would like to reveal information as my players learn new things/talk to NPCs. It would be nice to have some kind of bracketing to use in the note that would skip over or hide the information from being published to the DG.

zcysxy commented 1 year ago

I am implementing a custom filter feature, which allows users to specify some custom syntax to hide or replace text within a note. For example, I am using the pandoc-compatible syntax:

::: hidden
Private information that should not be written to the remote repository.
:::

This will also close #77

oleeskild commented 1 year ago

Thanks to @zcysxy, the latest release of the plugin now supports replacing arbitrary regex expressions before publishing which should allow you to automatically hide certain parts of the note before publishing. 🎉 I haven't documented it yet, but you should be able to get an overview of how it works by looking at #304.

Also, another way to do this is using obsidian comments. These will be stripped away from the note before publishing.