use tildeverse/wiki

This commit is contained in:
Ben Harris 2019-07-03 01:17:59 -04:00
parent 981c5b067e
commit dcf9d79563
Signed by untrusted user: ben
GPG Key ID: 4E0AF802FFF7960C
4 changed files with 79 additions and 72 deletions

View File

@ -1,11 +1,11 @@
{ {
"require": { "require": {
"mnapoli/front-yaml": "^1.6", "tildeverse/wiki": "dev-master"
"michelf/php-markdown": "^1.8"
}, },
"autoload": { "repositories": [
"psr-4": { {
"Rfcs\\": "src/" "type": "vcs",
"url": "https://tildegit.org/ben/tildewiki"
} }
} ]
} }

114
composer.lock generated
View File

@ -1,23 +1,23 @@
{ {
"_readme": [ "_readme": [
"This file locks the dependencies of your project to a known state", "This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "f693531fd51bd92297c17d6a290a6f16", "content-hash": "3ab3df15c4e40417f427b37691e83088",
"packages": [ "packages": [
{ {
"name": "erusev/parsedown", "name": "erusev/parsedown",
"version": "1.7.1", "version": "1.7.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/erusev/parsedown.git", "url": "https://github.com/erusev/parsedown.git",
"reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1" "reference": "6d893938171a817f4e9bc9e86f2da1e370b7bcd7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/erusev/parsedown/zipball/92e9c27ba0e74b8b028b111d1b6f956a15c01fc1", "url": "https://api.github.com/repos/erusev/parsedown/zipball/6d893938171a817f4e9bc9e86f2da1e370b7bcd7",
"reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1", "reference": "6d893938171a817f4e9bc9e86f2da1e370b7bcd7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -50,53 +50,51 @@
"markdown", "markdown",
"parser" "parser"
], ],
"time": "2018-03-08T01:11:30+00:00" "time": "2019-03-17T18:48:37+00:00"
}, },
{ {
"name": "michelf/php-markdown", "name": "erusev/parsedown-extra",
"version": "1.8.0", "version": "0.7.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/michelf/php-markdown.git", "url": "https://github.com/erusev/parsedown-extra.git",
"reference": "01ab082b355bf188d907b9929cd99b2923053495" "reference": "0db5cce7354e4b76f155d092ab5eb3981c21258c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/01ab082b355bf188d907b9929cd99b2923053495", "url": "https://api.github.com/repos/erusev/parsedown-extra/zipball/0db5cce7354e4b76f155d092ab5eb3981c21258c",
"reference": "01ab082b355bf188d907b9929cd99b2923053495", "reference": "0db5cce7354e4b76f155d092ab5eb3981c21258c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.0" "erusev/parsedown": "~1.4"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
"psr-4": { "psr-0": {
"Michelf\\": "Michelf/" "ParsedownExtra": ""
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"BSD-3-Clause" "MIT"
], ],
"authors": [ "authors": [
{ {
"name": "Michel Fortin", "name": "Emanuil Rusev",
"email": "michel.fortin@michelf.ca", "email": "hello@erusev.com",
"homepage": "https://michelf.ca/", "homepage": "http://erusev.com"
"role": "Developer"
},
{
"name": "John Gruber",
"homepage": "https://daringfireball.net/"
} }
], ],
"description": "PHP Markdown", "description": "An extension of Parsedown that adds support for Markdown Extra.",
"homepage": "https://michelf.ca/projects/php-markdown/", "homepage": "https://github.com/erusev/parsedown-extra",
"keywords": [ "keywords": [
"markdown" "markdown",
"markdown extra",
"parsedown",
"parser"
], ],
"time": "2018-01-15T00:49:33+00:00" "time": "2015-11-01T10:19:22+00:00"
}, },
{ {
"name": "mnapoli/front-yaml", "name": "mnapoli/front-yaml",
@ -135,16 +133,16 @@
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
"version": "v1.9.0", "version": "v1.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19" "reference": "82ebae02209c21113908c229e9883c419720738a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19", "reference": "82ebae02209c21113908c229e9883c419720738a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -156,7 +154,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.9-dev" "dev-master": "1.11-dev"
} }
}, },
"autoload": { "autoload": {
@ -189,20 +187,20 @@
"polyfill", "polyfill",
"portable" "portable"
], ],
"time": "2018-08-06T14:22:27+00:00" "time": "2019-02-06T07:57:58+00:00"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v4.1.3", "version": "v4.3.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "46bc69aa91fc4ab78a96ce67873a6b0c148fd48c" "reference": "c60ecf5ba842324433b46f58dc7afc4487dbab99"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/46bc69aa91fc4ab78a96ce67873a6b0c148fd48c", "url": "https://api.github.com/repos/symfony/yaml/zipball/c60ecf5ba842324433b46f58dc7afc4487dbab99",
"reference": "46bc69aa91fc4ab78a96ce67873a6b0c148fd48c", "reference": "c60ecf5ba842324433b46f58dc7afc4487dbab99",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -221,7 +219,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "4.1-dev" "dev-master": "4.3-dev"
} }
}, },
"autoload": { "autoload": {
@ -248,13 +246,45 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2018-07-26T11:24:31+00:00" "time": "2019-04-06T14:04:46+00:00"
},
{
"name": "tildeverse/wiki",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://tildegit.org/ben/tildewiki",
"reference": "751eb64c383cb7c6ec643eaf683b88aa1de351ea"
},
"require": {
"erusev/parsedown-extra": "^0.7.1",
"mnapoli/front-yaml": "^1.6"
},
"type": "library",
"autoload": {
"psr-4": {
"Tildeverse\\Wiki\\": "src/"
}
},
"license": [
"GPLv3"
],
"authors": [
{
"name": "Ben Harris",
"email": "ben@tilde.team"
}
],
"description": "parsedown extensions for tilde wikis",
"time": "2019-07-03T05:06:34+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": [], "stability-flags": {
"tildeverse/wiki": 20
},
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": [], "platform": [],

View File

@ -1,7 +1,7 @@
<?php <?php
include __DIR__.'/../vendor/autoload.php'; include __DIR__.'/../vendor/autoload.php';
$parser = Rfcs\MDParser::factory(); $parser = Tildeverse\Wiki\Parser::factory();
if (isset($_GET["number"])) { if (isset($_GET["number"])) {
$num = $_GET["number"]; $num = $_GET["number"];

View File

@ -1,23 +0,0 @@
<?php
namespace Rfcs;
use Mni\FrontYAML;
use Mni\FrontYAML\Markdown;
use Michelf\MarkdownExtra;
class MDParser implements Markdown\MarkdownParser {
public function __construct() {
$this->mdparser = new MarkdownExtra();
$this->mdparser->header_id_func = function ($header) {
return preg_replace('/[^a-z0-9]/', '-', strtolower($header));
};
}
public function parse($markdown) {
return $this->mdparser->transform($markdown);
}
public static function factory() {
return new FrontYAML\Parser(null, new MDParser());
}
}