Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Robert Miles | acabef963e |
23
README.md
23
README.md
|
@ -1,30 +1,37 @@
|
|||
# tildewiki
|
||||
# khcms-md
|
||||
|
||||
this is a small collection of parsedown extensions used across several tildeverse
|
||||
sites to power the wiki.
|
||||
this is a fork of [tildewiki](https://tildegit.org/ben/tildewiki) made for
|
||||
[khcms](https://tildegit.org/khuxkm/khcms). specifically, it removes the
|
||||
font awesome/fork awesome dependency by removing the automated header links
|
||||
(which, while awesome for a wiki, doesn't translate as well to website pages).
|
||||
|
||||
credit to ben for the code (since he wrote it and I just removed some lines).
|
||||
|
||||
## basic usage
|
||||
|
||||
1. add tildewiki as a vcs repository in composer.json
|
||||
you should just be able to use khcms. however, if you want to use this
|
||||
outside of the khcms project, you can follow these instructions:
|
||||
|
||||
1. add khcms-md as a vcs repository in composer.json
|
||||
```json
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://tildegit.org/ben/tildewiki"
|
||||
"url": "https://tildegit.org/khuxkm/khcms-md"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
1. require tildeverse/wiki in composer.json
|
||||
1. require khuxkm/khcms-md in composer.json
|
||||
```json
|
||||
"require": {
|
||||
"tildeverse/wiki": "dev-master"
|
||||
"khuxkm/khcms-md": "dev-master"
|
||||
}
|
||||
```
|
||||
|
||||
1. get an instance
|
||||
```php
|
||||
$parser = Tildeverse\Wiki\Parser::factory();
|
||||
$parser = Khuxkm\KHCMSMD\Parser::factory();
|
||||
```
|
||||
|
||||
1. parse stuff
|
||||
|
|
|
@ -1,17 +1,21 @@
|
|||
{
|
||||
"name": "tildeverse/wiki",
|
||||
"name": "khuxkm/khcms-md",
|
||||
"version": "0.0.1",
|
||||
"description": "parsedown extensions for tilde wikis",
|
||||
"description": "parsedown extensions for khcms-esque sites",
|
||||
"type": "library",
|
||||
"require": {
|
||||
"erusev/parsedown-extra": "^0.7.1",
|
||||
"mnapoli/front-yaml": "^1.6"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {"Tildeverse\\Wiki\\": "src/"}
|
||||
"psr-4": {"Khuxkm\\KHCMSMD\\": "src/"}
|
||||
},
|
||||
"license": "GPLv3",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Robert Miles",
|
||||
"email": "khuxkm@tilde.team"
|
||||
},
|
||||
{
|
||||
"name": "Ben Harris",
|
||||
"email": "ben@tilde.team"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
namespace Tildeverse\Wiki;
|
||||
namespace Khuxkm\KHCMSMD;
|
||||
|
||||
use Mni\FrontYAML;
|
||||
|
||||
class Parser implements FrontYAML\Markdown\MarkdownParser {
|
||||
public function __construct() {
|
||||
$this->mdparser = new WikiParsedown();
|
||||
$this->mdparser = new SiteParsedown();
|
||||
}
|
||||
|
||||
public function parse($markdown) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
namespace Tildeverse\Wiki;
|
||||
namespace Khuxkm\KHCMSMD;
|
||||
|
||||
class WikiParsedown extends \ParsedownExtra {
|
||||
class SiteParsedown extends \ParsedownExtra {
|
||||
protected function blockHeader($line) {
|
||||
$header = parent::blockHeader($line);
|
||||
|
||||
|
@ -12,10 +12,6 @@ class WikiParsedown extends \ParsedownExtra {
|
|||
$id = preg_replace('/[^a-z0-9]/', '-', strtolower($header['element']['text']));
|
||||
$header['element']['attributes']['id'] = $id;
|
||||
|
||||
$header['element']['text'] =
|
||||
'<small><a class="text-muted" href="#' . $id . '"><i class="fa fa-link"></i></a></small> '
|
||||
. $header['element']['text'];
|
||||
|
||||
return $header;
|
||||
}
|
||||
|
||||
|
@ -30,4 +26,4 @@ class WikiParsedown extends \ParsedownExtra {
|
|||
|
||||
return $table;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue