### Install and Run Development Commands
Source: https://github.com/oselvar/malte/blob/main/CONTRIBUTING.md
Install dependencies and run common development tasks like starting the demo app, running tests, checking code, and formatting.
```sh
pnpm install # install dependencies
pnpm dev # run the SvelteKit demo app
pnpm test # run unit tests once
pnpm test:watch # watch mode
pnpm check # svelte-check + tsc
pnpm lint # prettier + eslint
pnpm format # prettier --write
pnpm build:lib # build the publishable library into dist/
```
--------------------------------
### Install Malte Package
Source: https://github.com/oselvar/malte/blob/main/README.md
Command to install the Malte package as a development dependency using pnpm.
```sh
pnpm add -D @oselvar/malte
```
--------------------------------
### Configure Vite with Malte Plugin
Source: https://github.com/oselvar/malte/blob/main/README.md
Example Vite configuration in `vite.config.ts` showing how to add the Malte plugin before the Svelte plugin. This enables Malte's build-time processing and HMR.
```typescript
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { malte } from '@oselvar/malte';
export default defineConfig({
plugins: [malte(), sveltekit()]
});
```
--------------------------------
### Initialize Malte with Locales and Runtime
Source: https://github.com/oselvar/malte/blob/main/README.md
Configure Malte with a list of locales, a base locale, and a runtime locale accessor. This setup is used to manage internationalized content.
```ts
malte({
locales: ['en', 'no'],
baseLocale: 'en',
runtimeLocale: {
importStatement: "import { getLocale } from '$lib/i18n';",
expression: 'getLocale()'
}
});
```
--------------------------------
### Svelte Component with Malte Markers
Source: https://github.com/oselvar/malte/blob/main/README.md
Example of a Svelte component using `data-malte` attributes to indicate where Markdown content should be injected. This allows for design-time preview with placeholder text.
```svelte
Design-time heading
Design-time tagline.
```
--------------------------------
### Conventional Commit Message Example
Source: https://github.com/oselvar/malte/blob/main/CONTRIBUTING.md
An example of a commit message following Conventional Commits with the Angular preset, including a feat type and a BREAKING CHANGE.
```git
feat: add data-marte-each region for repeatable blocks
BREAKING CHANGE: renames the deprecated data-marte-block attribute.
```
--------------------------------
### Repeatable Region with `data-malte-each`
Source: https://github.com/oselvar/malte/blob/main/README.md
Example of a Svelte container marked with `data-malte-each` and a single child template. This allows the Markdown content to determine the number of elements rendered.
```svelte
placeholder
```
--------------------------------
### Cut a Standard Release
Source: https://github.com/oselvar/malte/blob/main/CONTRIBUTING.md
Initiates the release process using release-it, which includes running checks, determining the next version, updating files, building the library, and publishing to npm.
```sh
pnpm release
```
--------------------------------
### Initialize Malte with Paraglide Project
Source: https://github.com/oselvar/malte/blob/main/README.md
Configure Malte to automatically wire up the locale list and runtime by pointing it to your Paraglide project configuration.
```ts
malte({ paraglideProject: './project.inlang' });
```
--------------------------------
### Preview Release Changes
Source: https://github.com/oselvar/malte/blob/main/CONTRIBUTING.md
Performs a dry run of the release process to preview changes without making any actual modifications or publishing.
```sh
pnpm release --dry-run
```
--------------------------------
### Cut the First Release
Source: https://github.com/oselvar/malte/blob/main/CONTRIBUTING.md
Explicitly specifies the version for the very first release when conventional-changelog cannot infer it from prior tags.
```sh
pnpm release 0.0.1
```
--------------------------------
### Malte CLI Commands
Source: https://github.com/oselvar/malte/blob/main/README.md
Overview of Malte's command-line interface for managing localized Markdown content. Use these commands to extract, check, and apply translations.
```sh
malte extract bootstrap a Markdown companion from a .svelte file
malte check [--dir src] validate that markers and blocks line up. No writes.
malte apply [--dir src] validate, then bake the content into .svelte
```
--------------------------------
### Cut a Prerelease
Source: https://github.com/oselvar/malte/blob/main/CONTRIBUTING.md
Publishes a prerelease version, typically used for testing new features before a stable release, and assigns it a specific dist-tag.
```sh
pnpm release --preRelease=next # e.g. 0.2.0-next.0, published under the "next" dist-tag
```
--------------------------------
### Malte Style Transfer with List Rendering
Source: https://github.com/oselvar/malte/blob/main/README.md
Shows how Malte renders Markdown lists onto placeholder Svelte markup, applying classes and styles recursively. The generated content inherits Svelte's scoped CSS.
```svelte
```
--------------------------------
### Markdown for Styled List Items
Source: https://github.com/oselvar/malte/blob/main/README.md
Markdown content representing a list, which will be rendered into the Svelte `` structure, creating multiple `- ` elements with alternating classes.
```markdown
- First feature
- Second feature
- Third feature
- Fourth feature
- Fifth feature
```
--------------------------------
### Malte Element Markers in Svelte
Source: https://github.com/oselvar/malte/blob/main/README.md
Demonstrates two ways to mark elements in Svelte for Malte content injection: a boolean attribute `data-malte` on HTML elements and a `` comment for components.
```svelte
…
…
```
--------------------------------
### Check Malte Translations
Source: https://github.com/oselvar/malte/blob/main/README.md
Run the Malte check command to validate that translation markers and blocks align correctly within your source directory. This command is suitable for CI environments.
```sh
pnpm malte check --dir src
```
--------------------------------
### Markdown Content for Svelte Component
Source: https://github.com/oselvar/malte/blob/main/README.md
Corresponding Markdown file for the Svelte component, where content blocks are separated by `---`. The Nth block fills the Nth marker positionally.
```markdown
Build content-driven Svelte sites
---
Edit the **Markdown**. Watch the component update.
```
--------------------------------
### Markdown for Repeatable Region
Source: https://github.com/oselvar/malte/blob/main/README.md
Markdown content for a repeatable region, where each block corresponds to one instance of the template element defined in the Svelte component.
```markdown
First fact
---
Second fact
---
Third fact
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.