Better Obsidian Markup

Robert has a scheme for uploading assets from a markdown note taking app on his phone.

I wanted to make converting this material to pages easy to understand. But I consider it poor style to make a whole page out of one markdown item.

So here we split the uploaded text on blank lines with a separate markdown item for each paragraph. And we then offer a few more embellishments.

tips

script click handler formats file contents as title and story.

const title = 'New Note from Obsidian' const story = text.split(/\n\n/) .map(text => ({type:'markdown', text}))

name page after asset file name.

const title = event.target.innerText.split(/\./)[0]

make simple items be type paragraph.

const story = text.split(/\n\n/) .map(text => { const type = text.match(/[a-z./i}) ? 'paragraph' : 'markdown' return {type,text} })

.

I've written a lot of scripts like this. With each version I find a slightly more direct way to write it. For example, it is very handy to name constants so that they can be just dropped into a { } style object by themselves.

See Obsidian Bit by Bit for more process tips.

Scripts vary most in the story they create with the data they have retrieved. Here is the story I create for Thompson once I have figured out that there is a copy editing change that needs to be explained. Some of this is me adding conversion detail that are more for me than him. But, we're working this together and this sharing the workflow page is part of it. github