Properly displaying config file names in code blocks

Hi Obsidian friends,

What I’m trying to do

I’d like to display config files incl. filename and their file contents in a code block, which would be a handy task for admins.

Things I have tried

As long as the config filename does not contain a file extension (separated by a dot), this already works out of the box with Obsidian core. As we can see in the following screenshot, the filename /etc/ssh/sshd_config is displayed properly:

working

However, this does not work if the filename contains an extension, since the file extension gets cut off, In this particular case etc/sysctl.conf becomes /etc/sysctl without the .conf extension:

error

I do understand I’m misusing the code block feature for something (using config filenames instead of programming languages as a title) it’s not supposed to be used for. This would a great feature anyway. I’m writing the filename above or below the code block as a workaround, although this is not ideal.

How do you guys display configfiles in Obsidian?

Best Regards
Mike

You could take a look at the plugin Shiki Highlighter :blush: … One of its feature is displaying a title for a code block. Maybe that could help :blush:

Thanks for your reply.

Unfortunately Shiki Highlighter makes code blocks look entirely different. I’d prefer a native solution (if any).