Event Handling, How can I create and catch custom events?

Hello,

I would like to bring event-handlers in position for two events. One: When I add a code block, second when I add a link to a note.

I use obsidian for exploring codebases and inquiries on tutorials. The tutorials have listings and I want to number the listings which I would copy into a codeblock in my note on that tutorial or some codebase investigation.

For this sake I would need to capture the event “codeblock Java-Code created”

The event documentation isn’t really helpful to me.

I have found this link custom-events - shabegom's Obsidian Tutorials on custom events as the title says but it is a bit too high for me. I just installed obsidian today. Before this I tired Notion for a week or so and I am a bit let down by the database functionality. For instance, I would have liked to put my tutorial urls there in a database and run queries but bang notion doesn’t support database queries. It is definitely not for programmars.

Can you get me started with event handling in Obsidian please?

Where do I start?

Thanks a LOT

Yours,
coreSpotz