Hızlı Başlangıç

unifast'i yükleyin ve ilk Markdown belgenizi bir dakikadan kısa sürede derleyin.

unifast’i yükleyin ve ilk Markdown belgenizi bir dakikadan kısa sürede derleyin.

Kurulum

Temel Kullanım

import { compile } from "@unifast/node";

const result = compile("# Hello, unifast!\n\nThis is **Markdown**.");

console.log(result.html);
// <h1>Hello, unifast!</h1>
// <p>This is <strong>Markdown</strong>.</p>

Hepsi bu kadar. Tek import, tek fonksiyon çağrısı, HTML çıktısı.

Plugin Ekleme

Plugin’ler, derleyiciyi ek özelliklerle genişletir. Plugin’lerin çoğu @unifast/node içinde yer alır ve dahili geçişleri yapılandırır.

import { compile, frontmatter, gfm } from "@unifast/node";

const source = `---
title: My Post
date: 2025-01-15
---

# My Post

A table:

| Feature | Status |
|---------|--------|
| GFM     | Yes    |

- [x] Task complete
- [ ] Task pending
`;

const result = compile(source, {
  plugins: [frontmatter(), gfm()],
});

console.log(result.frontmatter);
// { title: "My Post", date: "2025-01-15" }

console.log(result.html);
// GFM tablosu ve görev listesi ile render edilmiş HTML

Sözdizimi Vurgulama Ekleme

import { compile, syntect } from "@unifast/node";

const result = compile(
  '```js\nconsole.log("highlighted");\n```',
  { plugins: [syntect()] }
);
// Sözdizimi vurgulama sınıflarına sahip kod bloğu

Sırada Ne Var?