Skip to content

Automating Markdown content injection into SvelteKit with stranger Quarkdown-Flavoured Markdown

License

Notifications You must be signed in to change notification settings

Sup2point0/stranger-quarkdown

Repository files navigation

Stranger Quarkdown: A Successor to Quarkdown

Tests


Stranger Quarkdown (Squarkdown) is a successor to Quarkdown, for integration with Svelte, SvelteKit and MDSveX.

Write content for a site with Squarkdown-Flavoured Markdown in any directory, then use Squarkdown to export them to .svx files in your SvelteKit project directory.


Features

Core

  • Automates several parts of the build process for SvelteKit projects
  • Multiple configuration options and Rake tasks for flexibility
  • Intelligently handles directories for more versatile navigation

Extra

  • Moves assets from a different folder to the SvelteKit static/ directory
  • Collects fonts to build the Google Fonts <link> tag for you
  • Collects global .scss files to build an scss-config.js file

Future

  • Correct internal relative links to correct absolute links in production

Directory

I mean, these should be pretty self-explanatory, but here you go anyway ;)

folder notes
squarkdown source code
tests unit tests
docs documentation
site project site
.github/scripts helper scripts for generating docs and site

Usage

Tip

See Using Squarkdown in a SvelteKit project for a full detailed walkthrough.

This project is designed to be used as a Git submodule.

Add it to a repo:

git submodule add https://github.com/Sup2point0/stranger-quarkdown

Make sure you’ve got your repo config in ./.squarkdown/squarkup.json if needed.

Run rake in the ./stranger-quarkdown/ directory to start the squarkup process. You can add this to your npm run build definition in package.json, so that it executes whenever you build the site:

  {
    "scripts": {
+     "build": "cd stranger-quarkdown && rake && cd .. && vite build"
    }
  }

Squarkdown will recursively look for all .md files starting from the root of the repo, and export them to .svx files in src/routes.

Many additional configurations are available to customise this process, although the defaults should cover most projects.


License

MIT. It’s not that even that good code, lmao.