2024-12-17-Tuesday


created: 2024-12-17 04:03 tags: - daily-notes


Tuesday, December 17, 2024

<< Timestamps/2024/12-December/2024-12-16-Monday|Yesterday | Timestamps/2024/12-December/2024-12-18-Wednesday|Tomorrow >>


🎯 Goal


🌟 Results


🌱 Next Time

  • Create a page to read about the actual note itself (vault_note_detail) so that users can read the full breakdown of what I worked on that day
  • Potentially come up with a way to process the summaries into the actual data of the Note in the Django Management Command, currently the summaries are left blank.
  • Develop some process to update the links to each note to go from Obsidian style ([[]]) to a Markdown URL style ([]())

📝 Notes

Yesterday I managed to successfully automate imports of the Notes from the BigBrain App to the Production version of the DIMMiN App. I can see that all the data about my notes are there, now I just need somewhere to put them in my actual app.

I want each vault to be accessible through the blog, essentially treating each Vault of notes as its own mini-series. Therefore, I created a VaultNoteListView Django View to display all of the Notes in a given Vault. I then made this Django View accessible via the following Django Route:

http://127.0.0.1:8000/blog/vault/dimmin-notes/notes

Then I needed to figure out how to render Markdown in my HTML via django-markdownx. I followed the django-markdownx docs. It looks like there is a custom MarkdownxField that can be used when defining a Django Model. I'll try changing the content section of the note to reflect this. After changing my model's content to a MarkdownxField and adding a property to format it with markdownify:

# A note is any markdown / obsidian-based file that constitutes
# the foundation of a digital garden
class Note(models.Model):
    vault = models.ForeignKey(Vault, related_name='notes', on_delete=models.CASCADE)
    title = models.CharField(max_length=256)
    slug = models.SlugField(max_length=256)
    content = MarkdownxField()
    summary = models.CharField(max_length=256, blank=True, null=True)
    relative_path = models.CharField(blank=True, null=True)
    tags = models.ManyToManyField('Tag', related_name='notes', blank=True)
    is_private = models.BooleanField(default=True, null=False)
    created_at = models.DateTimeField()
    updated_at = models.DateTimeField()
    last_modified_s3 = models.DateTimeField(null=True, blank=True)

    # Make notes unique to one digital garden
    class Meta:
        constraints = [
            models.UniqueConstraint(fields=['vault', 'slug'], name='unique_slug_per_vault')
        ]
        indexes = [
            models.Index(fields=['slug']),
            models.Index(fields=['title']),
        ]

    # Create a property that returns the markdown 
    @property
    def formatted_markdown(self):
        return markdownify(self.content)

and everything started working! Truncating the output might be difficult, as it seems to allow the Markdown HTML to bleed over to the rest of the page. This could be fixed by loading in the summaries from notes to the actual summary field in the Django Model of the Note. I'll also need some way to develop / process my links (these things [[]]) to link to the actual note so that people can explore my public vaults. Also, the Floaty Notes idea is much closer now than it ever has been...

For now I'll focus on rendering the Note details page, trying to get an example to work at the following Django Route:

http://127.0.0.1:8000/blog/vault/dimmin-notes/


Notes created today

List FROM "" WHERE file.cday = date("2024-12-17") SORT file.ctime asc

Notes last touched today

List FROM "" WHERE file.mday = date("2024-12-17") SORT file.mtime asc

(Template referenced from Dann Berg, can be found here)


Previous Note 2024-12-16-Monday Next Note 2024-12-18-Wednesday