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

Overview

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:


   
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

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

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

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

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

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

PHP based Markdown documentation viewer

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

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

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

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

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

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.

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.

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

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

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

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

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

A Magento 2 module that allows for creating discrete PDP (Product Detail Pages) page layouts for customers landing on the site from a PPC (Pay Per Click) link/ad by allowing routing to the same pages using a `/ppc/` prefix in the URL path.
A Magento 2 module that allows for creating discrete PDP (Product Detail Pages) page layouts for customers landing on the site from a PPC (Pay Per Click) link/ad by allowing routing to the same pages using a `/ppc/` prefix in the URL path.

A Magento 2 module that allows for creating discrete PDP (Product Detail Pages) page layouts for customers landing on the site from a PPC (Pay Per Click) link/ad by allowing routing to the same pages using a `/ppc/` prefix in the URL path.

Comments
  • Compatibility issue with blomstra/flarum-ext-fontawesome

    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.

    opened by iamdarkle 2
  • FoF Sitemap doesn't detect generated pages

    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.

    opened by iamdarkle 3
Releases(0.1)
Owner
Clark Winkelmann
Webdesign, open source and electric car enthusiast
Clark Winkelmann
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

Roave, LLC 40 Dec 14, 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

Jordan LeDoux 14 Sep 25, 2022
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

The League of Extraordinary Packages 1.5k Jan 3, 2023
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

ARCHTECH 104 Nov 12, 2022
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

The League of Extraordinary Packages 2.4k Dec 29, 2022
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

Spatie 230 Jan 7, 2023
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

Gigadrive UG 3 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

Ryan Chandler 15 Nov 8, 2022
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

Emanuil Rusev 14.3k Dec 28, 2022
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

PHPComLab 6 Sep 29, 2022