Code Blocks
Fenced Code Blocks
def strip_prefix(filename: str, pattern: str = r'^\d+--') -> str:
"""Remove numeric prefix from filename."""
import re
return re.sub(pattern, '', filename)
Language Highlighting
// JavaScript example
const stripPrefix = (filename, pattern = /^\d+--/) => {
return filename.replace(pattern, '');
};
# YAML configuration
plugins:
- strip-number-prefix:
pattern: '^\d+--'
strict: true
Line Numbers
| def process_files(files):
for file in files:
# Strip the prefix
clean_name = strip_prefix(file.name)
# Update the file
file.url = clean_name
|
Highlighting Lines
def important_function():
# This line is highlighted
result = calculate_something()
# This line is also highlighted
return result * 2
Next: Tables