I use [Dendron](https://www.dendron.so) for this. You can add tags or links to any entry, and the targets of those links will have backlinks. There's a nice "daily note" mechanism as well.
It's a truly dead simple static site generator that uses pandoc to turn the markdown into HTML, and mustache as the templating language. It's about 400 lines of actual code total. It doesn't include an actual server, it just converts your markdown files into HTML. It's by no means finished but I use it for my personal website.
Assuming `foo.bar` is a script inside the package `foo` that you want to both import and run directly (without `python -m ...`), this lets you do so without too much hassle.