# Code block with ``` (3 backticks)# for line numbering: linenums="1", to highlight lines: hl_lines="3-5 11 13"mkdocs.yml# The configuration file.docs/index.md# The documentation homepage....# Other markdown pages, images and other files.# useful links:hamk.figithub.com# commentthe11thlineishighlighted# commentreplacethefollowingwithyourown'username'and'password'
markdown_extensions:-pymdownx.highlight:anchor_linenums:true-pymdownx.inlinhilite# in line highlight-pymdownx.snipets
Examples of inline highlight (inlinehilite):
1. Here is some code: importpymdownx;pymdownx.__version__.
2. The python range() function is used to generate a sequence of numbers.
2b. The python range() function is used to generate a sequence of numbers.
3. The mock shebang will be treated like code here: vartext='HAMK';.
3b. The mock shebang will be treated like text here: #!js var text = 'HAMK';.
4. Do not expose your password.
# this is bashwsl--set-default-version2wsl--list--verbose
wsl-uroot-dUbuntu-24.04bash-c"touch /etc/wsl.conf"wsl-uroot-dUbuntu-24.04bash-c"echo [boot] >> /etc/wsl.conf"wsl-uroot-dUbuntu-24.04bash-c"echo systemd=true >> /etc/wsl.conf"wsl-tUbuntu-24.04
wsl--exportUbuntu"G:\My Drive\Ubuntu_wsl_backup_24.04.tar"#!/bin/bashecho"Today is "`date`echo-e"\nenter the path to directory"readthe_path
echo-e"\n you path has the following files and folders: "ls$the_path
/*this is css*//*HAMK branding colors*/.md-header{background-color:#003755;scrollbar-color:#7300F0;}/*this is correct, do not remove it*/.md-tabs{background-color:#7300F0;}
<!-- this is html --><!DOCTYPE html><html><body><h1>My First Web Page</h1><pid="demo">My First Paragraph</p><script>document.getElementById("demo").innerHTML=5+6;</script></body></html>
// this is php //(1)! //This annotation is not enabledecho "Hello, world!";function myMessage() { echo "Hello world!";}myMessage();// the same code below// until <?//(2)! //This annotation is enabled thanks to the php opening tagecho"Hello, world!";functionmyMessage(){echo"Hello world!";}myMessage();
(1) This annotation is not enabled
(2) The code in lines 2-6 are not highlighted. The same code, lines 10-14, are higlighted thanks to the [short] opening PHP tag <?, even commented as in line 9. Missing the tag also inactivates the annotation (1) above.
# this is powershell$contentToAdd=@"[wsl2]memory=4GB # Limits VM memory in WSL 2 to 4 GBprocessors=2 # Makes the WSL 2 VM use two virtual processors[experimental]autoMemoryReclaim=true"@New-Item$home\.wslconfigAdd-Content$home\.wslconfig$contentToAddnotepad++$home\.wslconfigNew-Item-Path'D:\temp\Test Folder'-ItemTypeDirectory
# this is sh (similar appearance as bash)wsl--set-default-version2wsl--list--verbose
wsl-uroot-dUbuntu-24.04bash-c"touch /etc/wsl.conf"wsl-uroot-dUbuntu-24.04bash-c"echo [boot] >> /etc/wsl.conf"wsl-uroot-dUbuntu-24.04bash-c"echo systemd=true >> /etc/wsl.conf"wsl-tUbuntu-24.04
wsl--exportUbuntu"G:\My Drive\Ubuntu_wsl_backup_24.04.tar"#!/bin/bashecho"Today is "`date`echo-e"\nenter the path to directory"readthe_path
echo-e"\n you path has the following files and folders: "ls$the_path
# this is yamllanguage:enpalette:-scheme:slate# put slate first to make dark mode the default onetoggle:icon:material/toggle-switchname:Switch to light modeprimary:redaccent:lime-scheme:defaulttoggle:icon:material/toggle-switch-off-outlinename:Switch to dark modeprimary:indigo
# this is bashwsl--set-default-version2wsl--list--verbose# (1)!wsl-uroot-dUbuntu-24.04bash-c"touch /etc/wsl.conf"wsl-uroot-dUbuntu-24.04bash-c"echo [boot] >> /etc/wsl.conf"wsl-uroot-dUbuntu-24.04bash-c"echo systemd=true >> /etc/wsl.conf"wsl-tUbuntu-24.04
wsl--exportUbuntu"G:\My Drive\Ubuntu_wsl_backup_24.04.tar"#!/bin/bashecho"Today is "`date`echo-e"\nenter the path to directory"readthe_path
echo-e"\n you path has the following files and folders: "ls$the_path
/*this is css*//*HAMK branding colors*/.md-header{background-color:#003755;/* (1)! */scrollbar-color:#7300F0;}/*this is correct, do not remove it*/.md-tabs{background-color:#7300F0;}
<!-- this is html --><!DOCTYPE html><html><body><h1>My First Web Page</h1><!-- (1)! --><pid="demo">My First Paragraph</p><script>document.getElementById("demo").innerHTML=5+6;// (2)</script></body></html>
// this is phpecho "Hello, world!";/* not highlighted until leaded by the opening PHP tag, even commented, as shown right below */function myMessage() { echo "Hello world!";}myMessage();// until <?phpecho"Hello, world!";// (1)!// this is phpfunctionmyMessage(){echo"Hello world!";}myMessage();
# this is powershell$contentToAdd=@"[wsl2]memory=4GB # Limits VM memory in WSL 2 to 4 GBprocessors=2 # Makes the WSL 2 VM use two virtual processors[experimental]autoMemoryReclaim=true"@New-Item$home\.wslconfig# (1)!Add-Content$home\.wslconfig$contentToAddnotepad++$home\.wslconfigNew-Item-Path'D:\temp\Test Folder'-ItemTypeDirectory
# this is sh (similar appearance as bash)wsl--set-default-version2wsl--list--verbose
wsl-uroot-dUbuntu-24.04bash-c"touch /etc/wsl.conf"wsl-uroot-dUbuntu-24.04bash-c"echo [boot] >> /etc/wsl.conf"wsl-uroot-dUbuntu-24.04bash-c"echo systemd=true >> /etc/wsl.conf"wsl-tUbuntu-24.04
wsl--exportUbuntu"G:\My Drive\Ubuntu_wsl_backup_24.04.tar"#!/bin/bashecho"Today is "`date`echo-e"\nenter the path to directory"# (1)!readthe_path
echo-e"\n you path has the following files and folders: "ls$the_path
\n to go to next line and print the content after \n (in this example, "enter the path to directory" will be printed in the next line)