Skip to content
Margent
Language
All guides

Markdown pages

For owners · Push .md files as they are: what is rendered, and how comments find the line.

Push the files as they are

Markdown needs no build step. Upload the repository, or the folder with your .md files, and Margent turns each one into a page: guide/setup.md becomes guide/setup.html, and a folder’s index.md, or else its README.md, becomes the folder’s start page. The source files stay in the build too.

Every block on the page knows the lines it came from. A comment on a sentence shows “line 12” in the panel, and your agent opens the .md file at that line to work on it.

What is rendered

  • CommonMark, with the GitHub additions: tables, strikethrough, task lists and bare links.
  • Footnotes, and GitHub-style heading ids, so #installation links keep working.
  • Front matter is left off the page. Its title: names the document; without one, the first heading does.
  • Raw HTML in the Markdown is kept.
  • Relative links to other .md and .csv files point to their rendered pages. Images and other files are served from the build as they are.

There is no syntax highlighting for code blocks, and no Mermaid diagrams or math. If you need those, render the Markdown yourself (see Static sites and HTML). A page you build wins over the rendered one at the same path. Files over 5 MB are not rendered.

Example workflow

The workflow the project page gives you uploads the whole repository. Files your .gitignore keeps out of the repository are left out of the upload as well. To show only a folder, set dir to it, or keep dir: . and set the project’s Content root.

name: Publish to Margent
on:
  push:
    branches: [main]
  workflow_dispatch:
jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803  # v6.1.0
      - uses: sacovo/margent-publish/action@3e05fdf9c312df0e0401680322591080d6b376f3  # pin by SHA
        with:
          dir: .

From your own machine, margent push . does the same (see Publish from a repository).

Tips

  • Link between documents with relative links (../setup.md). They work on GitHub, in Margent and on every branch version.
  • A file with marp: true in its front matter is a slide deck. Build it instead: Marp slides.