luarocks / luarocks/luarocks-site
Migrate from markdown executable to cmark Lua module
Nobody has claimed this yet.
- Dominant language
- MoonScript
- Stars
- 201
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Replace the external `markdown` executable (discount 3.0.0d) with the [`cmark` Lua module](https://luarocks.org/modules/jgm/cmark) to reduce external dependencies.
## Current Implementation
The codebase currently uses a build-time approach:
1. **Build rule** (`static/md/Tupfile`):
```
: foreach *.md |> markdown < %f > %o |> %B.html
```
2. **Markdown files** in `static/md/`:
- `home.md`
- `about.md`
- `changes.md`
- `intro.md`
- `security_incident_march_2019.md`
3. **Views** include pre-compiled HTML via `raw_ssi` helper in `widgets/helpers.moon`
## Plan
### Files to Modify
1. **`luarocks-site-dev-1.rockspec`** - Add cmark dependency
2. **`cmd/render_markdown.moon`** - New script to render markdown using cmark module
3. **`static/md/Tupfile`** - Update build rule to use new script
## Benefits
- Removes dependency on external `markdown` executable
- Uses a Lua module that can be managed via LuaRocks
- `cmark` is the reference implementation for CommonMark, well-maintained by jgm
## Tasks
- [ ] Add `cmark` to dependencies in rockspec
- [ ] Create `cmd/render_markdown.moon` script using cmark module
- [ ] Update `static/md/Tupfile` to use new script
- [ ] Test all pages that render markdown content
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with luarocks-site-dev-1.rockspec, cmd/render_markdown.moon, and static/md/Tupfile; compare the existing build rule with the planned cmark-based renderer. Rebuild the five files in static/md/ and check the generated pages, with completion meaning cmark is managed through LuaRocks and the pages render without the external markdown executable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- build-system
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100