Using both source and nonsource mode lines in one file

Hi, I have a question about source mode. I am trying to take notes about bash codes, so I think I need to work on source mode. But I also want to use titles, tags etc. I am nearly new at Obsidian, if I couldn’t explain very well, I’m sorry.

For example I have a title like this

###Deleting the lines with sed

and the code definition like this

sed -i ‘4d’ *.txt

I have searched in the forums, but couldn’t find a helping point.

I think you may be looking for ways to format code within your note: https://help.obsidian.md/Editing+and+formatting/Basic+formatting+syntax#Code

You could use inline code:

### Deleting the lines with sed

and the code definition like this

`sed -i ‘4d’ *.txt`

or a code block:

### Deleting the lines with sed

and the code definition like this

```
sed -i ‘4d’ *.txt
```

Maybe that could work?

2 Likes

Oh yes that is what I was looking for. Thank you.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.