Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to link to specific highlights #266

Open
vstrien opened this issue Dec 18, 2023 · 3 comments
Open

Be able to link to specific highlights #266

vstrien opened this issue Dec 18, 2023 · 3 comments

Comments

@vstrien
Copy link

vstrien commented Dec 18, 2023

In Obsidian, you can link to a specific heading.
Translated to exported highlights, I would like to be able to link to a specific highlight.

In the Kindle exporter that I use (https://github.com/hadynz/obsidian-kindle-plugin) this can easily be done, because

  • the per-highlight template is editable (apart from the general template)
  • there are variables for (for example) location

Ideally, this kind of structure makes it very flexible to export highlights.

Alternatively, just putting a heading above every highlight with the location (i.e. ### location {{ location_number }}) would do the trick even without customizable highlight templates.
We could then immediately "deep-link" to the specific highlights by using [[BookTitle#location loc_number]]

@OGKevin
Copy link
Owner

OGKevin commented Dec 19, 2023

Hmm, I see.

Alright, I think the first prio is for me to take over #107 and get it merged. I think this should open op the possibility for a lot of other features such as per-highlight templating.

As this is the second request that is blocked in this MR, I’ll have a look at taking it over after Christmas/New Years.

@OGKevin
Copy link
Owner

OGKevin commented Jan 11, 2024

Could you give an example of how the markdown would look like.

Currently we have 2 headers, one for the title and one for the chapter, so I think you're suggesting to use level 3 header for each highlight. But how would this look when someone is using callouts or quote (>)?

For example:

## Chapter Four

%%START-802b79d7-17e2-4e39-bfb0-3d596800a7ba%%

%% Here you can type whatever you want, it will not be overwritten by the plugin. %%

%%START-EXTRACTED-HIGHLIGHT-802b79d7-17e2-4e39-bfb0-3d596800a7ba%%
> [!quote]
> I was congratulating myself (because nobody else ever does it) on an excellent save — [[2022-03-14]]
%%END-EXTRACTED-HIGHLIGHT-802b79d7-17e2-4e39-bfb0-3d596800a7ba%%

%% Here you can type whatever you want, it will not be overwritten by the plugin. %%

%%END-802b79d7-17e2-4e39-bfb0-3d596800a7ba%%

Would be

## Chapter Four

%%START-802b79d7-17e2-4e39-bfb0-3d596800a7ba%%

%% Here you can type whatever you want, it will not be overwritten by the plugin. %%

%%START-EXTRACTED-HIGHLIGHT-802b79d7-17e2-4e39-bfb0-3d596800a7ba%%
### location 1

> [!quote]
> I was congratulating myself (because nobody else ever does it) on an excellent save — [[2022-03-14]]
%%END-EXTRACTED-HIGHLIGHT-802b79d7-17e2-4e39-bfb0-3d596800a7ba%%

%% Here you can type whatever you want, it will not be overwritten by the plugin. %%

%%END-802b79d7-17e2-4e39-bfb0-3d596800a7ba%%

?

Would't this kind of look ugly once it's rendered? A file full of location headers 🤔.

@OGKevin
Copy link
Owner

OGKevin commented Jan 20, 2024

In case of the highlights being shuffled around due to someone creating a highlight between highlights or using a diff sort order etc. I think it might be an idea to use the ID of the highlight? Just like it's used for the markers.

Would this be satisfactory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants