#api-server #markdown #document #index #schema #openapi #search

app smark

The tool provides API to get markdown documents from files

1 unstable release

0.1.9 Apr 17, 2022
0.1.6 Apr 9, 2022

#17 in #documents

MIT license

140KB
3K SLoC

smark

codecov API Documetation

smark is the tool to serve markdown as the API server.

This tool provides API to get markdown documents from files based on tantivy (A full-text search engine in Rust) and lindera (A morphological analysis library in Rust).

Please see API Documetation for more details. smark also provides openapi schema.

Install

You can use release binary from release page or cargo install smark

Prepare Posts

You can make template markdown with required frontmatters by template subcommand.

smark template

# ---
# uuid: db71b71a-c7f2-47c4-ab87-81bd1bb6d58a
# title: ""
# description: ""
# lang: ja
# category: ""
# ---

Prepare index

You need to prepare index to register your markdown posts. Please specify input markdown direcotry and output index direcotry.

smark detect posts/**/*.md files.

smark prep --index-dir index --input posts

Run server

You completed all steps! Let's run server!

smark run --index-dir index --static-dir images

From source

You can use cross to build.

git clone https://github.com/illumination-k/smark.git
cross build --target x86_64-unknown-linux-musl --release
chmod 777 target/x86_64-unknown-linux-musl/release/smark

Dependencies

~36–50MB
~851K SLoC