Skip to content

Migrate from markdown executable to cmark Lua module #236

@leafo

Description

@leafo

Summary

Replace the external markdown executable (discount 3.0.0d) with the cmark Lua module 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions