Add frontmatter, markdown, path, xml, rss, and web packages

Sync local packages into the registry repo and update index.json
and README.md to include all 9 packages.
This commit is contained in:
2026-02-24 21:04:20 -05:00
parent c5a2276f6e
commit cbb66fbb73
42 changed files with 3844 additions and 0 deletions

View File

@@ -0,0 +1,82 @@
# markdown
A Markdown to HTML converter for [Lux](https://github.com/thebrandonlucas/lux).
## Install
```bash
lux pkg add markdown --git https://git.qrty.ink/blu/markdown
```
## Usage
```lux
import markdown
fn main(): Unit with {Console} = {
let html = markdown.toHtml("# Hello **world**")
Console.print(html)
}
let _ = run main() with {}
```
## API
### `toHtml(markdown: String): String`
Convert a full markdown document to HTML.
### `inlineToHtml(text: String): String`
Convert inline markdown only (bold, italic, links, etc.) without block-level processing.
### `escapeHtml(s: String): String`
Escape HTML entities (`&`, `<`, `>`).
## Supported Markdown
### Block elements
- Headings (`# h1` through `#### h4`)
- Paragraphs (auto-wrapped in `<p>`)
- Fenced code blocks (` ``` ` with optional language)
- Blockquotes (`> text`)
- Unordered lists (`- item`)
- Ordered lists (`1. item`)
- Horizontal rules (`---`, `***`, `___`)
- Images on their own line (`![alt](src)`)
- Raw HTML pass-through (lines starting with `<`)
### Inline elements
- **Bold** (`**text**`)
- *Italic* (`*text*` or `_text_`)
- ~~Strikethrough~~ (`~~text~~`)
- `Code` (`` `code` ``)
- [Links](url) (`[text](url)`)
- Images (`![alt](src)`)
- Raw HTML tags pass through
### Special features
- Headings inside list items (`- ### Title` renders correctly)
- Nested inline formatting (`**[bold link](url)**`)
- Code blocks with syntax highlighting class (`language-*`)
- Recursive blockquote content processing
## Running Tests
```bash
lux test.lux
```
## Known Limitations
- No nested lists (indented sub-items)
- No reference-style links (`[text][ref]`)
- No tables
- No task lists (`- [ ] item`)
- The C backend does not support module imports; use the interpreter (`lux`) or include the source directly for compiled binaries
## License
MIT