This is a second POC attempt to directly post an Obsidian note to my website.
My script still merely grabs the filecontent and title from files created in Obsidian and saved in a predefined folder on my local system and sends it to my Micropub endpoint. But now it should also parse the content for Markdown and turn it into the HTML equivalent.
header 2
header 3
Bold text
Italic text
- list item
- another list item
- indentend list item
What happens if I have a backticked block in my file
some nonsense here
$string = "stringtext";
As before nothing yet is done yet for tags, categories etc. This is just another attempt to see if the basic process can be made to work.
Screenshot of this posting as I wrote it in markdown in Obsidian
This week was pretty regular, although we mentally prepared ourselves everyday for the message school would close again. When there are 3 children in a class with Covid19, the entire class is expected to go itno quarantaine at home. We made it through the entire week, though Friday the count was 2. So it would not be surprising if we receive an 8 AM message Y can’t go to school tomorrow.
This week I
sent some final invoices for last year, meaning we actually had 1% more turnover in 2021 than 2020. As 2020 was a 18% increase compared to 2019, I am very pleased with that outcome.
calculated the bonus that results in for our team. We allocate 10% of all turnover above the budgeted break even point for additional income for our team (excluding myself and other co-owners). Made those payable with the January payroll round.
did some bookkeeping for the Open Nederland association I’m treasurer of.
approached some network partners to possibly work with one of my clients on a European tender
summarised a range of Digital Europe Program calls for proposals and distributed them to people I think might be interested to submt proposals.
made some progress with our company’s ‘how busy are we? tracker’, for each us to be better able to balance their week the way works best for them, and for us as a team to have a better handle on when we’re overloaded, running out of time in a project, or not paying enough attention to (internal) projects. The key is not to maximise efforts, but to be able to stay balanced as individuals and as a whole.
spent quite a bit of spare time on building my own Micropub client. I have most of what I envisioned at the start working now. I can easily post from my feedreader, as well as from my notes in Obsidian. This posting for instance was written in my notes, and then posted directly to my site. (You can tell, because I changed the numbering in the title from YY#WW to YY-WW, as Obsidian does not accept # in the note titles.
bought a new laserprinter for our office, and brought it to the office. While there looked at the neighbour’s office in our building. They will be leaving, and we are contemplating adding their space to ours.
had our monthly half day all hands (online) meeting with the team
did some paperwork for the Open State Foundation I chair, with stuff to sign etc.
Y had a fever Friday evening, but by Saturday morning was fine again. That’s not unusual for 5y olds, but in these pandemic times any occurrence of fever e.g. stands out way more.
Current status:
Created a working way to submit JSON formatted blogposts to this site, code on GitHub
Included that in my earlier scripts to create posts from my feed reading, that I now no longer then have to post by hand.
Created a Microsub client to replace my feed reader, in which I can respond directly from within the page I am reading.
Combined the same basic script with a local webform so I can very quickly post something. I don’t think I will be using this possibility much but it was a good way to add a front-end to the micropub script first and fast.
Can take a local markdown file written in Obsidian and post it as html to my site. This is by far the most useful to me
I write my blogposts in Obsidian, drafts live in a specific writing folder. They have two inline data fields, status and tags. While writing a note has status ‘writing’, when it is ready to publish I set the status to ‘draft’.
Within Obsidian I use the same status field to create a dynamic overview of posts being written, ready to publish, and previously published (using the DataView plugin).
When I’m ready to post, I hit a hotkey which launches my PHP script. It looks at all files in the specific writing folder and checks for files that changed within the last few hours and if those contain a status field ‘draft’. For those that do it transforms the markdown in those files to html, and then posts that to my site, using the tags in the other data field to tag and categorise the post. It also sets the status field in my notes from ‘draft’ to ‘posted’.
I could also run the script every hour or so using a cron job, so that anything posts automatically, while I go on with my other work.
Rationale:
Local first, personal, narrow band
See blogpost.
Narrow band means:
my preferences can be treated as default inputs
my tasks are predictable to me
together they are functions with parameters, aka code.
Sources:
Micropub standard
IndieWeb wiki on Micropub
Tips from Jan Boddez (in Dutch)
Jamie Tanna’s work on his personal micropub client
Jamie Tanna’s tool to get authorisation tokens manually, great for testing/development.
Parsedown, which I use to translate markdown files written in Obsidian, to HTML for my site.
I extended the capabilities of my microsub feed reader with the option to save web articles directly from the reader to my Obsidian notes in markdown format.
Until now if I wanted to save an entire article I found in my feed reader, I would open it in the browser and then use the markdownclipper browser add-on to add some context and then save the article in markdown in my notes. I wanted to cut out that step of opening it in the feed reader, by saving it directly to my markdown notes. In my feedreader I already have a response form to e.g. post a reply to a posting on my own site. Posting it to my notes means adding a path to how I process that form.
I had to find a suitable script for converting HTML to MarkDown first. Which I found in PHP League’s HTML-to-Markdown, as suggested by Jan Boddez. It requires Composer which I already had installed on my laptop.
I tweaked my feed reader’s response form to also (as a hidden field) include the original HTML of a posting (using
htmlentities
to stuff it into a form field value). The script that processes the form I altered to both have a path for posting to websites (using micropub) and a new path to make a note in Obsidian, which is then saved as a .md file to the folder I store all clipped articles in.To make a note I shape the available input the same way I template clipping things from the browser. At the top is my rationale for clipping something and reference to the source, followed by the original posting after which I add some keywords as tags and again the reference to the source.
In the images below you see the corresponding elements marked both as they appear in the reader as well as the resulting note.
The article as shown in my feed reader:
1: the original HTML content from a feed
2: title of the article (prefilled by my feed reader)
3: name of the author (prefilled by my feed reader)
4: original article’s URL (prefilled by my feed reader)
5: the reason and context why I am saving this to notes (also used to write a reply to a post, or the reason for bookmarking something if it will be posted on my site)
6: a quote I want to highlight
7: keywords that will become tags or categories on my site, and tags in my notes
8: selector for which site to post to (zyl is my blog), or ‘obs’ for making a note in Obsidian
Except for that last one those numbers are marked on the image of the resulting markdown note.
The resulting note in Obsidian:
1: the original HTML content from a feed shown in Markdown as the main body of the note
2: title of the article, both shown as part of the content of the note, as well as the title of the note (where a timestamp is added)
3: name of the author (mentioned with the source both at the top and bottom)
4: original article’s URL (mentioned with the author both at the top and bottom)
5: the reason and context why I am saving this, always at the top as it helps me process the content better
6: a quote I wanted to highlight
7: keywords that have become hashtags
(This posting was also written in my notes and, except for the images, posted directly from Obsidian to my site. Meaning I can both automatically move material into Obsidian, as well as automatically move material out of Obsidian. I quite enjoy the feeling of using that ‘magic’.)
Over in the IndieWeb community we were having a conversation about how easy it should be for people to create their own websites (also for small local businesses etc.) Where making the site is basically the same as writing the text you want to put on it. Social media silos do that for you, but out on the open web?
Aaron mentioned that one a tech conference, someone had a linktree site on the last slide for people to find more info, because it was the easiest way apparently to make a small site just for that info, by using a third party silo.
Tantek then said that is a good summary of the use case:
Seeing that single line on my screen, I was mildly shocked that my own first instinctive answer to “easiest way to make a small site” is “write my own html in Notepad“. That answer is almost 30 years old, it’s how I made my very first web page. And handwriting html is still my first answer! No other path immediately comes to mind. Of course, I wouldn’t want to hand write this weblog in html, but ‘small site’ as in a few simple pages, yes, I would do that by hand in some plain text app like Notepad.
Can it be that three decades on the closest answer to ‘making a website is as easy as making a plain text note’ is still hand written html? Dave Winer uses an outliner to blog, and more recently created Drummer for the rest of us, that for him at least means blogging is as simple as writing plain text. I can post to this blog from my plain text notes on my laptop (from Obsidian using micropub), but I use markdown to style it a bit. What else is out there?
Can making your web page be as simple as writing a note you put on the door or in the window of your business?
The answer can’t really still be Notepad, can it?
No not really, also because I don’t use Windows…but it could still be, and it was back in ’93. Image by John Lester, license CC BY
Web pages are predictably untrustworthy to remain online as they were when you dropped by to see them. They can change while their address remains the same, can redirect an address to someplace else entirely, and entire websites can disappear meaning there’s no response when attempting to visit an address.
This means that when I link to something here, there’s no guarantee at all that when you click such a link that you actually get to see what I thought I’ve linked to. And no, screenshots don’t help: fake is easy and we need to back up our words with hyperlinks.
The same is true for stuff I don’t link to here, but save to my archive. That’s why I don’t just save URLs but the entire article for future reference to my markdown notes. That still means the actual source might disappear, without me having a way of proving what I saved is what I saw. This not only is relevant to the content itself, but also for instance for licensing information. There are photos in this blog that were openly licensed when I used them, but no longer, leaving it impossible for me to prove I still can use the image because of the license at the time.
This makes an archiving service useful, like Archive.org. I can use that to store URLs I find interesting and I do that with some regularity. It is why I am a monthly donor to the Web Archive, I’d like it to remain a more robust reference point on the web.
Currently I have one way of adding web pages to an archive, using the Wayback Machine add-on in my browser. The same add-on helps me find previous versions of a page already archived, tweets about that page, and annotations made by others. Very useful, during browsing.
The Web Archive browser add-on bookmarklet
Writing blogposts and saving webpages as markdown in my local notes, or starting to annotate a page in Hypothes.is are another matter however. There I’d like to automate getting or creating an archive link.
In all cases it would need to be an archive link next to the original. If I link to something in a blogpost here I want to still send WebMentions to the linked site, and that requires the link to the original to be in my posting. Similarly for my notes, I want to have the original url as well, although it would be reconstructable from the archive link. For online social annotations in Hypothes.is, the original link is needed because that is how you find other people’s annotations alongside your own. The last one is probably easiest, by using the browser add-on manually and adding the result as a first annotation for instance.
An archive link as first Hypothes.is annotation
On the page in the IndieWeb wiki about using the Internet Archive there are some code snippets to be found to use with the Archive’s API, or using the basic string to save something
https://web.archive.org/save/urlhere
. It also mentions bloggers who either send the URLs they mention, or their own postings, or both (e.g. when sending a WebMention) to the Internet Archive.When posting to my blog from my local markdown notes I could potentially add a function to the markdown-to-html parser I use where it detects external links, runs them through the Archive and writes the html for both the direct and the archived link.
For saving web articles as local notes in markdown there are several options to explore:
When saving from the browser using the Markdownload add-on, first saving and copying the saved url using the Achive add-on, then pasting that archive link in the dialog box.
Adding
[Opslaan in Internet Archive](https://web.archive.org/save/{baseURI})
to the Markdownload template so I can directly save a URL from within the local note later, if wanted. I added this experimentally, to see if I would actually use it like this.When saving to notes from my microsub feedreader I could add a function to the html-to-markdown parser I use there to run external links through the Archive and write the Archive link in markdown after the original link.
I just watched this video about using the Map View plugin in Obsidian, which allows you to visualise the existence of notes grouped by geo-location on a map. The Map View plugin allows viewing and organising notes along a dimension that is currently missing in my notes, geographic location. I do have an overview of all my travel since the late eighties in my notes. The creator of the video, Zsolt is the creator of both the Obisidian Excalidraw and Brain plug-ins, which I both enjoy using and recommend. So when he suggests a plugin by someone else, it piques my curiosity.
Now I am of course thinking about integrating that with my check-in forms for this site enabling individualised Plazes. Specifically it may play a role in determining venue or location.
Would it be doable to, like I’m already posting from my notes to the site, automatically create an optional check-in record here when I create a geolocated note in Obsidian? Or the other way around, to have a check-in made through the webform also create a note in Obsidian?