This second post is mainly here to show you that you can also create single file posts for convenience. The first post contains more interesting content.
Don’t forget to read the official SuperMD docs to know how to style your content.
Math
Btw this sample website also includes the JS/CSS dependencies required to render math:
This: is an inline equation instead!
Code blocks
/// Shaper that uses CoreText.
///
/// CoreText shaping differs in subtle ways from HarfBuzz so it may result
/// in inconsistent rendering across platforms. But it also fixes many
/// issues (some macOS specific):
///
/// - Theta hat offset is incorrect in HarfBuzz but correct by default
/// on macOS applications using CoreText. (See:
/// https://github.com/harfbuzz/harfbuzz/discussions/4525)
///
/// - Hyphens (U+2010) can be synthesized by CoreText but not by HarfBuzz.
/// See: https://github.com/mitchellh/ghostty/issues/1643
///
pub const Shaper = struct {
/// The allocated used for the feature list, font cache, and cell buf.
alloc: Allocator,
/// The string used for shaping the current run.
run_state: RunState,
/// CoreFoundation Dictionary which represents our font feature settings.
features: *macos.foundation.Dictionary,
// ...
If you open the web inspector on the code below, you will see that the code has been correctly tagged for syntax highlighting, but it’s currently on you to come up with CSS definitions for styling each class.
#include <stdio.h>
int main() {
puts("Hello, world!");
return 0;
}
fn main() {
println!("Hello, world!");
}