code 2021 04 09
It’s pretty simple, just use the corresponding include:
#pragma once
void hello_snippets();
#include "world.hpp"
#include <iostream>
void hello_snippets() {
std::cout << "Hello snippets!\n";
}
This is another set of snippets:
#pragma once
void hello_world();
#include "world.hpp"
#include <iostream>
void hello_world() {
std::cout << "Hello world!\n";
}
Of course, you can insert a code snippet using the regular Markdown syntax without any highlighting:
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
main() {
echo "Hello, world!"
}
main
The same with highlighting enabled:
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
main() {
echo "Hello, world!"
}
main
Also, some inline code: ./test.sh
!
Here’s a snippet which requires a horizontal scrollbar to display, it should look OK:
#!/usr/bin/env bash
echo AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA What a long snippet
My Jekyll theme. Feel free to contribute or contact me.