The simple and lightweight markdown framework / viewer written in rust
Igneous-md is a gfm compatible markdown viewer and viewer framework with a focus of staying lightweight and extensible
- Syntax highlighting similar to GitHub using highlight.js
- Standalone markdown viewer outside browser
- Switching of stylesheets on the fly
- Ability to add custom CSS
- Export generated HTML
- Works offline
-
Write e2e tests (and benchmarks with hyperfine?)
-
Create packages
-
Allow multiple running instances at the same time on different docs
-
Add change streaming API
- Editor integration either via plugin
-
Fix bug relating to multi line GFM notes
-
Add github theme closer to github itself (limit width and center content)
-
Optimize performance
- Fix slow shutdown times
If your system uses nix flakes you can do the following:
# flake.nix
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
igneous-md = {
url = "github:DOD-101/igneous-md"; # or /ref/tags/0.3.0 to pin a version
inputs.nixpkgs.follows = "nixpkgs";
};
}and then
# configuration.nix
{
inputs,
...
}:
{
environment.systemPackages = [
inputs.igneous-md.packages."${pkgs.stdenv.hostPlatform.system}".igneous-md-release
];
}Important
This will build the project from source
cargo install igneous-md
Important
This will build the project from source (see build dependencies)
You must also install webkit-gtk 2.3x+.
-
Clone the repo
git clone https://github.com/DOD-101/igneous-md.git -
Install the following build dependencies:
- rust 1.89+
- gtk4 (also a runtime dependency)
- webkit-gtk 2.3x+ (also a runtime dependency)
- esbuild
sudo pacman -Syu gtk4 webkitgtk-6.0 base-devel
sudo apt update && apt install libgtk-4-dev libwebkitgtk-6.0-dev build-essential libssl-dev[!NOTE] Feel free to add your distro here! PRs welcome!
-
Run
cargo build --release -
Finally run
cargo install --path crates/igneous-md
igneous-md view path/to/file.md
Or at least questions I think people could ask
-
How do I view my markdown in the browser?
Simply pass the
--browserflag. For all options runigneous-md --help -
How can I change the order of color schemes?
Prefix the css file names with numbers e.g:
00_github-dark.css 01_github-light.css
To get started run igneous-md generate-config (will run by automatically if you view a file without the config dir ~/.config/igneous-md/)
# in ~/.config/igneous-md/
css # general styling
βββ github-markdown-dark.css
βββ github-markdown-light.css
βββ hljs # codeblocks
βββ github-dark.css
βββ github-light.cssNote
Config generation is only available if compiled with --features generate_config (a default feature)
| Key | Description |
|---|---|
c |
Go to next color scheme |
C |
Go to previous color scheme |
e |
Export html |
hjkl |
Vim bindings for moving |
This allows to to launch igneous-md directly from your editor on the current buffer
local job_id = -1
vim.keymap.set("n", "gm", function()
if job_id ~= -1 then
vim.fn.jobstop(job_id)
end
local current_buffer_path = vim.fn.expand("%")
job_id = vim.fn.jobstart({ "igneous-md", "view", current_buffer_path })
end, {})igneous-md convert <PATH>
Yes. It's simpler than it sounds.
Since igneous-md works by using a server in the background and then communicates with the built-in viewer, as well as the browser, using https and websockets anyone could use this to write their own viewer.
The benefits of this being you receive all of the hot-reloading and conversion from md to html for free, while having full freedom to implement your viewer however they you like.
The only real limitation on this is what the websocket json-protocol is written to support. (PRs welcome)
This aspect of igneous-md is still experimental, but if you already want to get started check out ./crates/igneous-md/src/ws/msg.rs
and have a look at what is possible right now.
If you want to only use igneous-md for this be sure to disable the viewer cargo feature.
Many thanks to all the people, who have created/contributed to technology used in the creation this project.
GitHub for their markdown styling and markdown-alert icons.
This project is licensed under either of
at your option.