PHPackages                             ernestdefoe/gh-readme - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ernestdefoe/gh-readme

ActiveFlarum-extension[Utility &amp; Helpers](/categories/utility)

ernestdefoe/gh-readme
=====================

Paste a GitHub repo URL into the Flarum composer and the URL is auto-replaced with the rendered README markdown.

2.0.1(3w ago)033—9.1%MITPHPPHP ^8.2CI passing

Since May 17Pushed 1w agoCompare

[ Source](https://github.com/ernestdefoe/gh-readme)[ Packagist](https://packagist.org/packages/ernestdefoe/gh-readme)[ RSS](/packages/ernestdefoe-gh-readme/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

GitHub README Paste — Flarum 2 extension
========================================

[](#github-readme-paste--flarum-2-extension)

[![Floxum](https://camo.githubusercontent.com/d6cf6ac68d4ec16bea12c15491fba348451b035575bccb18b813373af1e871c4/68747470733a2f2f666c6f78756d2e636f6d2f657874656e73696f6e2f65726e6573746465666f652f67682d726561646d652f62616467652f6e616d65)](https://floxum.com/extension/ernestdefoe/gh-readme)[![Version](https://camo.githubusercontent.com/d625ed282d7db6dfa98be0f7edd6cabab808f1c9a4a9bec401dfedada1834fc4/68747470733a2f2f666c6f78756d2e636f6d2f657874656e73696f6e2f65726e6573746465666f652f67682d726561646d652f62616467652f686967686573742d76657273696f6e)](https://floxum.com/extension/ernestdefoe/gh-readme)[![Downloads](https://camo.githubusercontent.com/c587a72fa9259924245fd60febe745cd0bd41ff5fd9dcdb6437fc98f2aa5e815/68747470733a2f2f666c6f78756d2e636f6d2f657874656e73696f6e2f65726e6573746465666f652f67682d726561646d652f62616467652f646f776e6c6f616473)](https://floxum.com/extension/ernestdefoe/gh-readme)[![Review](https://camo.githubusercontent.com/a70cf45fb7fdf894849c78cb60076048fb0418433cc521dc385b49194f4a8a61/68747470733a2f2f666c6f78756d2e636f6d2f657874656e73696f6e2f65726e6573746465666f652f67682d726561646d652f62616467652f726576696577)](https://floxum.com/extension/ernestdefoe/gh-readme)[![License](https://camo.githubusercontent.com/eb891a0bb715ce4c435b4a02fb3b7db2b62a8884bd3e0caf0f1751ca8fe07432/68747470733a2f2f666c6f78756d2e636f6d2f657874656e73696f6e2f65726e6573746465666f652f67682d726561646d652f62616467652f6c6963656e7365)](https://floxum.com/extension/ernestdefoe/gh-readme)

Paste a GitHub repo URL into the Flarum composer and the URL is **auto-replaced** with the rendered README markdown.

How it works
------------

[](#how-it-works)

1. User pastes `https://github.com/owner/repo` into any composer (new discussion, reply, edit, private message).
2. The frontend recognizes it as a GitHub repo root URL and intercepts the paste.
3. It calls `POST /api/gh-readme/fetch` on the Flarum backend.
4. The backend fetches `https://api.github.com/repos/{owner}/{repo}/readme`, decodes the base64 payload, rewrites relative image / link / anchor URLs against the repo's HEAD branch on `raw.githubusercontent.com`, and returns the processed markdown.
5. The frontend replaces the URL in the composer with the README markdown. The user can edit freely from there.

Subsequent pastes of the same repo are served from a 10-minute server-side cache so a popular forum doesn't burn GitHub's rate limit.

### Works with both composer types

[](#works-with-both-composer-types)

ComposerBehavior**Default Flarum** (textarea + `flarum/markdown`)URL replaced inline by the markdown source. The post renders as formatted markdown at display time. A visible italic "Loading…" marker shows in the textarea during the fetch.**`fof/rich-text`** (Tiptap WYSIWYG)URL replaced by rich nodes — headings, paragraphs, lists, code blocks, blockquotes, images all appear formatted in the composer immediately. A toast notification shows during the fetch (no inline marker — finding a specific text node inside a ProseMirror document is brittle).Detection is automatic via the presence of `editor.editor` on the active driver. No setting needed.

Install
-------

[](#install)

```
composer require ernestdefoe/gh-readme
php flarum cache:clear
```

Then enable in **Admin → Extensions → GitHub README Paste**.

[`flarum/markdown`](https://github.com/flarum/markdown) is a `suggest` dep — without it the inserted markdown ends up in the post but renders as plain text rather than formatted headings/lists/code blocks.

Configure
---------

[](#configure)

**Admin → Extensions → GitHub README Paste:**

- **GitHub Personal Access Token** *(optional)* — raises GitHub's API rate limit from 60/hour-per-IP (unauth) to 5000/hour. No scopes required for public repos.
- **Cache duration (minutes)** — how long the server caches each README before refetching. Default 10. Clamped 1–60.

URL shapes accepted
-------------------

[](#url-shapes-accepted)

URLBehavior`https://github.com/owner/repo`✅ expanded`https://github.com/owner/repo/`✅ expanded`https://github.com/owner/repo.git`✅ expanded (strips `.git`)`https://www.github.com/owner/repo`✅ expanded`https://github.com/owner/repo/tree/main`❌ left as-is (use the root URL)`https://github.com/owner/repo/blob/main/file.md`❌ left as-is (file links, not repos)`http://github.com/owner/repo`❌ rejected (must be https)`https://gitlab.com/owner/repo`❌ not GitHubSecurity notes
--------------

[](#security-notes)

- Strict URL allowlist (`github.com` host only).
- Owner/repo regex-allowlisted to GitHub's own charset.
- The backend never fetches the user-supplied URL directly — it constructs the API call from validated owner/repo segments. SSRF surface is the GitHub API host only.
- Response body capped at 2 MB.
- 10s connect + 15s total request timeout.
- TLS verification on.
- Endpoint requires an authenticated Flarum actor; throttled by Flarum's standard per-actor API throttler.

Support
-------

[](#support)

Questions, bug reports, and feature requests:

- **Support forum:**
- **Issues:**

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance97

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

23d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c9978664264055711c21fbcf73c937f758df771d9cb40f6a25370b10123e7abc?d=identicon)[ernestdefoe](/maintainers/ernestdefoe)

---

Top Contributors

[![ernestdefoe](https://avatars.githubusercontent.com/u/24905286?v=4)](https://github.com/ernestdefoe "ernestdefoe (7 commits)")

---

Tags

composergithubflarumreadmeflarum-extension

### Embed Badge

![Health badge](/badges/ernestdefoe-gh-readme/health.svg)

```
[![Health](https://phpackages.com/badges/ernestdefoe-gh-readme/health.svg)](https://phpackages.com/packages/ernestdefoe-gh-readme)
```

###  Alternatives

[fof/upload

The file upload extension for the Flarum forum with insane intelligence.

191185.4k17](/packages/fof-upload)[flarum-lang/russian

Russian language pack for Flarum.

12127.5k](/packages/flarum-lang-russian)[fof/byobu

Well integrated, advanced private discussions.

61112.4k10](/packages/fof-byobu)[fof/sitemap

Generate a sitemap

1896.4k2](/packages/fof-sitemap)[fof/webhooks

Automatically notify Discord, Slack, and Microsoft Teams when events happen on your Flarum forum.

2519.4k](/packages/fof-webhooks)[datlechin/flarum-link-preview

Automatically display a rich preview of the link contents.

1717.1k](/packages/datlechin-flarum-link-preview)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
