Generate pseudo-static pages from markdown and HTML files for Flarum

Last update: Feb 21, 2022

Flarum Pages Generator

This is not a Flarum extension. This package provides a Flarum extender that you can use in the local extend.php to define custom pages.

Install at the root of your Flarum, or as a dependency to one of your custom extensions.

I don't recommend bundling this as a dependency of public extensions.

This package is in beta! Breaking releases will be released regularly. Make sure to use ^ or ~ semver constraints!

composer require clarkwinkelmann/flarum-pages-generator

Usage

In extend.php:

return [
    (new \ClarkWinkelmann\PagesGenerator\Pages())
        ->source(__DIR__ . '/pages')
        ->mithrilComponent('ContactForm', "flarum.extensions['acme-basic-form'].ContactForm"),
];

->source(string $path) defines a source folder to enumerate for pages.

->mithrilComponent(string $tag, string $import) optionally defines a mapping of an HTML tag to a Mithril component. The expression will be called with eval().

You can call source and mithrilComponent multiple times on a single extender instance.

At the moment, a single extender instance must exist in the Flarum application! If multiple extensions try to use it, it will break.

Pages

Pages can be Markdown (.md) or HTML (.html) and must include a Yaml front matter.

Markdown is parsed using the Flarum formatter. Any markdown or bbcode made available by extensions will be available.

The filename without file extension will be the page URL. Subfolders under the source directory are preserved as part of the URL.

Example: basic markdown

---
title: About us
---

This is a markdown text with **formatting**.

Example: basic HTML

">
---
title: Find Us
---

It's very simple to find us

Example: Markdown page with custom component

">
---
title: Contact
---

Use the form to contact us:


   

GitHub

https://github.com/clarkwinkelmann/flarum-pages-generator
You might also like...

PHP Markdown Engine Support

PHP Markdown Version v1.x support all PHP version =5.4 v2.x support all PHP version =7.0 Cài đặt thư viện Thư viện này được cài đặt thông qua Compos

Jul 1, 2022

markdown wiki/blog

markdown wiki/blog

Kwiki markdown wiki/blog Usage Place your markdown files in the /wiki directory. Categories are directories and subcategories are subdirectories. If y

May 29, 2022

Rendering markdown from PHP code

JBZoo / Markdown Installing composer require jbzoo/markdown Usage Rendering Table ?php declare(strict_types=1); use JBZoo\Markdown\Table; echo (new

Dec 26, 2021

Gruik ! An open-source markdown note-taking web app. [ABANDONED PROJECT]

What is Gruik ? It's a free & open-source note-taking service. A space where you can store notes, tutorials, code snippets... by writing them in markd

Mar 31, 2022

PHP Markdown & Extra

PHP Markdown & Extra An updated and stripped version of the original PHP Markdown by Michel Fortin. Works quite well with PSR-0 autoloaders and is Com

Jan 18, 2022

A simple regex-based Markdown parser in PHP

Slimdown A simple regex-based Markdown parser in PHP. Supports the following elements (and can be extended via Slimdown::add_rule()): Headers Links Bo

Jul 27, 2022

PHP based Markdown documentation viewer

PHP based viewer for Markdown files, to view them with fenced code highlighting and navigation.

Mar 31, 2022

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very usefull when you're sending emails.

CssToInlineStyles class Installation CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline style

Aug 11, 2022

Flarum Post Comments - A Flarum extension.

Flarum Post Comments A Flarum extension. Make sure to comment on the answers and list the comments below the answers. Installation Install with compos

Jul 3, 2022

Sync Wordpress Pages and Posts (even custom post types + fields) from static Markdown + YAML files

Sync Markdown Files to WordPress Posts and Pages Static site generators let you use a revision-controlled tree of markdown files to make a site, but d

Jun 14, 2022

A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

Install Install via composer. $ composer require olliecodes/laravel-etched-blade Once installed you'll want to publish the config. $ php artisan vendo

Jul 5, 2021

Cecil is a CLI application that merges plain text files (written in Markdown), images and Twig templates to generate a static website.

Cecil is a CLI application that merges plain text files (written in Markdown), images and Twig templates to generate a static website.

Cecil is a CLI application that merges plain text files (written in Markdown), images and Twig templates to generate a static website.

Jul 28, 2022

Cecil is a CLI application that merges plain text files (written in Markdown), images and Twig templates to generate a static website.

Cecil is a CLI application that merges plain text files (written in Markdown), images and Twig templates to generate a static website.

Cecil is a CLI application that merges plain text files (written in Markdown), images and Twig templates to generate a static website.

Jul 28, 2022

Parser for Markdown and Markdown Extra derived from the original Markdown.pl by John Gruber.

PHP Markdown PHP Markdown Lib 1.9.0 - 1 Dec 2019 by Michel Fortin https://michelf.ca/ based on Markdown by John Gruber https://daringfireball.net/ Int

Aug 5, 2022

Parser for Markdown and Markdown Extra derived from the original Markdown.pl by John Gruber.

PHP Markdown PHP Markdown Lib 1.9.0 - 1 Dec 2019 by Michel Fortin https://michelf.ca/ based on Markdown by John Gruber https://daringfireball.net/ Int

Aug 5, 2022

Run your WP site on github pages, php innovation award winner https://www.phpclasses.org/package/12091-PHP-Make-a-WordPress-site-run-on-GitHub-pages.html

Run your WP site on github pages, php innovation award winner  https://www.phpclasses.org/package/12091-PHP-Make-a-WordPress-site-run-on-GitHub-pages.html

Gitpress Run wordpress directly on github pages Gitpress won the innovation award for may 2021 Read more about this https://naveen17797.github.io/gitp

Apr 8, 2022

Create cryptographically secure pseudo-random numbers, and manage big integers

laminas-math This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering

Jul 19, 2022

Docbook Tool for static documentation generation from Markdown files

Roave Docbook Tool Static HTML and PDF generator tool for generating documentation from Markdown files. Generates a deployable HTML file from Markdown

Aug 1, 2022

Laravel static site/blog generator with markdown support.

Katana static site & blog generator PHP static site & blog generator with markdown support. Using the power of laravel's Blade templating engine. Kata

Jun 14, 2022
Comments
  • 1. Compatibility issue with blomstra/flarum-ext-fontawesome

    I'm not sure how this extension can interfere but for some reason flarum-pages-generator stops working when blomstra/flarum-ext-fontawesome is enabled.

    Reviewed by iamdarkle at 2022-07-16 12:09
  • 2. FoF Sitemap doesn't detect generated pages

    When checking that Google Search Console had correctly removed the old fof/pages links I noticed that the new ones from flarum-pages-generator were not appearing and I confirmed this by looking at the sitemap.xml, it seems that fof/sitemap is not able to detect the pages generated through flarum-pages-generator.

    Reviewed by iamdarkle at 2021-08-31 03:01
Docbook Tool for static documentation generation from Markdown files

Roave Docbook Tool Static HTML and PDF generator tool for generating documentation from Markdown files. Generates a deployable HTML file from Markdown

Aug 1, 2022
A PHP tool to generate templateable markdown documentation from the docblocks or type-hints of your codebase.

Roster Installation To install, simply require the package using composer: composer require

Sep 8, 2021
Convert HTML to Markdown with PHP

HTML To Markdown for PHP Library which converts HTML to Markdown for your sanity and convenience. Requires: PHP 7.2+ Lead Developer: @colinodell Origi

Aug 11, 2022
Easily add routes to your Laravel app by creating Markdown or Blade files

Laravel Pages This package lets you create pages using Markdown or Blade without having to worry about creating routes or controllers yourself. Essent

Jul 6, 2022
Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.
Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.

league/commonmark league/commonmark is a highly-extensible PHP Markdown parser created by Colin O'Dell which supports the full CommonMark spec and Git

Aug 6, 2022
A highly configurable markdown renderer and Blade component for Laravel
A highly configurable markdown renderer and Blade component for Laravel

A highly configurable markdown renderer and Blade component for Laravel This package contains: a Blade component that can render markdown a highly con

Aug 13, 2022
Symfony 5 bundle to easily create dynamic subpages with Markdown. Useful for help sections and wikis.

MarkdownWikiBundle This bundle allows you to create rich subpages in a Symfony project using Markdown. Pages are stored in a file cache and sourced fr

Apr 26, 2022
A super lightweight Markdown parser for PHP projects and applications.

A speedy Markdown parser for PHP applications. This is a super lightweight Markdown parser for PHP projects and applications. It has a rather verbose

May 31, 2022
Better Markdown Parser in PHP
Better Markdown Parser in PHP

Parsedown Better Markdown Parser in PHP - Demo. Features One File No Dependencies Super Fast Extensible GitHub flavored Tested in 5.3 to 7.3 Markdown

Aug 11, 2022
Render colored Markdown contents on console terminal
Render colored  Markdown contents on console terminal

cli-markdown Render colored markdown contents on console terminal Preview run demo by php example/demo.php Features support auto render color on termi

Jan 27, 2022