2023-09-27 19:51:55 +03:00
2023-09-27 16:27:56 +00:00
2023-09-27 19:51:55 +03:00
2023-09-27 19:51:55 +03:00
2023-09-27 19:51:55 +03:00
2023-09-27 19:51:55 +03:00
2023-09-27 19:51:55 +03:00
2023-09-27 19:51:55 +03:00
2023-09-27 19:51:55 +03:00
2023-09-27 19:51:55 +03:00
2023-09-27 19:51:55 +03:00

MDSnippets

MDSnippets is a static HTML page with JS markdown parser to create a generic snippet storage

Snippets are syntax highlighted with highlight.js. See their documentation for language names.

UI

  • At the top there is a search bar. Enter values to filter snippet names.
    • Pressing key 's' or / focuses the search bar.

Configuration

  • config.js
    • File is read to replace values in "config.xx" object.
    • config.source='path_to_markdown.txt';
    • config.style='path_to_style.css';
    • config.title='Title of page';
    • config.search=true; // Display link search bar
    • config.favicon='path_to_favicon.ico';

Markdown

Only 1st level heads, names and code blocks are parsed:

# header

name
\`\`\`python
print("Hello World!")
# Dot escape the ticks in real config.
\`\`\`

Static HTML builder

Sometimes the reloading of styles and links is hard due to caching. You can create a static single HTML page with:

bash build_static.sh  -l example_snippets.txt -c config.js -s style.css  > templated.html
Description
No description provided
Readme 87 KiB
Languages
HTML 84.3%
Shell 14.6%
JavaScript 1.1%