seanlowe / obsidian-timelines

Create a timeline view of all notes with the specified combination of tags
https://seanlowe.github.io/obsidian-timelines/
MIT License
39 stars 2 forks source link

<div> tags not working #24

Closed DianaProbst closed 3 months ago

DianaProbst commented 3 months ago

I've been trying to isolate a couple of paragraphs for my timeline, and I'm finding that I can't do it. Where the tag I want to use is 'silor', the name of a character, I get the message 'No events found for tags: ['silor', 'timeline']

My set-up is:

tags=silor

image

And I've got this console output image

Zooming in on my poor aardvark... image

My set-up on that page, in case you can't see it, is:

#timeline
<div 
          class='ob-timelines' 
          data-type="range"
          data-start-date='1626-01-01-01'
          data-end-date='1627-01-01-01' 
          data-title='This Aardvark is for testing' 
          data-color='orange'
          data-tags="timeline;silor">
    This aardvark is called Silor.
</div>

It doesn't matter where I put the timeline tag on the page - I still get the no events found error.

It looks like filterMDFiles is only looking in the main tags, which isn't the behaviour I expected. Is this my error, or does the tag override not get checked?

seanlowe commented 3 months ago

Alright - took me a few days to be able to check this but was finally able to debug a little. Unfortunately, this is probably a case of bad documentation on my part, so I apologize for that one.

Overview time:

For any note to be included in the list of potential timeline files, it has to have the #timeline tag, which you have done correctly. The mishap here, was not including the #silor tag on the overarching note.

When we provide a tag to the ob-timeline codeblock, the plugin automatically appends "timeline" to the list of tags provided. Then it searches for notes that match exactly those tags.

The tag override, is for having notes in the same file that you want to render on different timelines. See #12 for a bit more information on that feature.

Aside from that, the extra "timeline" on the data-tags isn't necessary and I don't believe it actually affects whether or not it will render. I don't think this was part of the problem but I noticed that.


I'm going to close this issue as resolved but if you have any other issues or stuff regarding this, feel free to open a new one!

Thanks for contributing!