This blog uses code blocks to display code samples. The Rehype Pretty Code plugin provides beautiful code blocks for your MD & MDX files. You can you choose from a number of preconfigured syntax highlighting themes or you can define your own one using a json file.
I use the Winter is Comming (Dark Black) custom theme from John Papa including the custom font DankMono on this page, which is my preferred theme in my local environment as well. The following list of code blocks shows different configurations by example.
JAVA Code Block
java defines the code highlighter for the code block. The language will be shown as flag in the upper right corner as well.
{1,5-6} defines the rows that should be highlighted.
showLineNumbers defines that the line numbers will be shown on the left hand side.
title="path/HelloWorld.java" defines the name of the title in the top of the code block where / is the sequence for the forward slash in html.
Terminal Block
Run this command ls -l.
Run this command to achive unattended happyness and control.