Skip to content

A dynamic blog engine written in pure Prolog. Zero dependencies, built-in Markdown support, and a prolog HTTP server.

License

Notifications You must be signed in to change notification settings

cryptoque/prolog-blog-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plog - A Prolog Blog Engine

Prolog License: Apache-2.0 PRs Welcome

What does a blog engine look like if you write it in logic?

Dynamic Markdown -> HTML server in pure Prolog.

Yes, you can write a web server with Prolog.

Plog is a blog engine written in pure Prolog that dynamically reads Markdown files, parses them at request time, and serves clean HTML using a minimal prolog HTTP server.

No frameworks. No dependencies. No JavaScript. Just Prolog.

To add a new blog entry, simply write it in markdown and add it as prolog file to the contents folder. The prolog engine will dynamically parse the markdown into html recursively for display.

Check the site live: https://blauanarchy.org

Features

  • Dynamically reads and parses Markdown on every request.

  • Pure Prolog: no external libraries or framework (except the standard HTTP package).

  • Prolog HTTP server: routing + rendering.

  • Prolog markdown parser supports: All headings, paragraphs, links, code block, bold, italic, blockquote, images, horizontal rule.

Getting Started

Run the server

swipl -s main.pl -g server(YOUR_PORT)

Then open: http://localhost:YOUR_PORT, which contains the index page for the blogs and links to each individual blog page.

Add your own posts: wrap your own markdown file like this:

content("your content in markdown").

Each file can use:

# Heading
## Subheading
### Sub-subheading
plain paragraphs
bold
italic
links
images
horizontal rule
code block

That's it!

Code Philosophy

This project intentionally avoids complexity. No abstractions unless justified. Everything is visible and understandable at a glance.

Future Works

  • Static site generation (export/0)
  • Support more Markdown features
  • RSS

If you find it interesting, feel free to ⭐ the repo.

About

A dynamic blog engine written in pure Prolog. Zero dependencies, built-in Markdown support, and a prolog HTTP server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages