1
0
Fork
You've already forked chmark
0
An HTML server for a static site with Markdown files.
  • CSS 80.9%
  • JavaScript 14.5%
  • HTML 4.6%
2025年09月02日 22:39:20 +02:00
demo Updated demo and README.md 2025年08月13日 12:56:13 +02:00
readme-media Screenshot 2025年08月08日 11:02:21 +02:00
templates Correct breadcrumb 2025年08月13日 14:07:37 +02:00
404.html revert to basic 404.html 2025年09月02日 13:36:59 +02:00
chmark.css Initial upload #1 2025年08月08日 10:15:36 +02:00
chmark.js Improved breadcrumb 2025年09月02日 22:39:20 +02:00
favicon.png Initial upload #2 2025年08月08日 10:16:17 +02:00
index.md Added link to repo in index.md 2025年08月13日 14:50:47 +02:00
LICENSE Initial upload #1 2025年08月08日 10:15:36 +02:00
marked.min.js Initial upload #2 2025年08月08日 10:16:17 +02:00
README.md update README.md 2025年09月02日 22:22:28 +02:00

chmark

An HTML server for a static site with Markdown files.

Basicaly

Store your Markdown text directly on your web server and let the client browsers display it as appropriate.

Simple to use and no need to process the Markdown text to generate the html files before putting them on your server.

Installation

Untar the ball in a folder /chmark at the document root of your web server.

What chmark displays

chmark example page screenshot

chmark displays:

  • the rendered markdown code
  • the first level title (ie. the first # or the first === underline) as the tab title
  • on top of the page: the page breadcrumb
  • on top right, and as the tab icon, the site icon that you can change to yours

Usage

chmark has 3 options of usage, which all display the Markdown in the same way, but with a slightly different technique.

  • option A: Drop your .md file directly on your web server, and in the same folder, add a copy of the file /templates/template-option-A.html with the same name as the .md file, but with the extension .html.
  • option B: Copy the file /templates/template-option-B.html to another .html file, at the place you want, with the name you want, and, in it, insert your raw markdown text at the place it is commented.
  • option C: Replace the default 403 and 404 .html error files of your web server by a copy of the file /404.html. Just drop your raw .md files on your web server and make sure that there is no .html file on the same folder with the same main name part.

As a summary:

Option Pros Cons
A Plain .md file But each .md file needs to be paired with a .html file (which is how ever very light)
B Only one file per page But it is a .html file: the Markdown text is not in plain .md file
C Only one file per page and it is a plain .md file But it returns, by design, a hidden 404 error code

Example

This site is powered by chmark: https://chtixof.codeberg.page
and, in it, there is this demo of the 3 options.

Credits

Updates

  • 2025年09月02日: improved algo to get the md file