Files
mdsnippets/README.md
2023-09-27 19:51:55 +03:00

46 lines
1.0 KiB
Markdown

# MDSnippets #
MDSnippets is a static HTML page with JS markdown parser to create a
generic snippet storage
Snippets are syntax highlighted with [highlight.js](https://highlightjs.org).
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
```