An open API service indexing awesome lists of open source software.

https://github.com/sup2point0/stranger-quarkdown

Markdown preprocessing automation for Svelte/Kit projects
https://github.com/sup2point0/stranger-quarkdown

markdown mdsvex quark quarkdown quarkup ruby squark squarkdown squarkup sup svelte sveltekit

Last synced: 3 months ago
JSON representation

Markdown preprocessing automation for Svelte/Kit projects

Awesome Lists containing this project

README

        

![Stranger Quarkdown: A Successor to Quarkdown](.assets/squark-cover.png)

[![Tests](https://github.com/Sup2point0/stranger-quarkdown/actions/workflows/test.yml/badge.svg)](https://github.com/Sup2point0/stranger-quarkdown/actions/workflows/test.yml)

---

**Stranger Quarkdown** (*Squarkdown*) is a successor to [*Quarkdown*](https://github.com/Sup2point0/Quarkdown), for integration with [Svelte](https://svelte.dev), [SvelteKit](https://svelte.dev/docs/kit/introduction) and [MDSveX](https://mdsvex.pngwn.io).

Write content for a site with [Squarkdown-Flavoured Markdown](docs/walkthrough.md) 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](https://fonts.google.com) `` tag
- Collects global `.scss` files to build an `scss-config.js` file

### Future
- Search root directory without recursively searching every directory
- Allow arbitrary JSON data in squark charm
- 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`](squarkdown/) | source code |
| [`tests`](tests/) | unit tests |
| [`docs`](docs/) | documentation |
| [`site`](site/) | project site |
| [`.github/scripts`](.github/scripts/) | helper scripts for generating docs and site |


## Usage

> [!Tip]
> See [Using Squarkdown in a SvelteKit project](docs/walkthrough.md) for a full detailed walkthrough.

This project is designed to be used as a [Git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules).

Add it to a repo:

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

Make sure you’ve got your [repo config](docs/squarkup-config.md) 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:

```diff
{
"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.