"Specific" guide to transitioning from Web Development to Obsidian Mods, Publish, Themes, Custom CSS and Custom JS

I have no clue about Javascript, but I know a thing or two about DOM and CSS. And I enjoy digging through documentation. :slight_smile:

What I learned so far in the forum, is that scripts for desktop and Publish work differently. AFAIK on desktop you need a plugin to run a script, whereas in Publish you can add it to publish.js. So I’d approach the scripting for Publish separately from desktop.

How to add content with Javascript on Publish?

I found a script that adds Cookie banners. Apparently it is possible to trigger a script just by opening a page and to target a particular location in the page for the output:

Then I searched for “publish.js tags:publish”.

It shows other examples of publish.js adding content to a webpage, like a donation button.

Triggering a script on Publish seems straight-forward. But the difficult part seems to find useful selectors for parameters and output.

The way I understand it, you don’t call scripts in Markdown.