This commit is contained in:
Ben Harris 2018-08-30 01:40:29 -04:00
parent ce303b283f
commit 3e045fa968
Signed by untrusted user: ben
GPG Key ID: 4E0AF802FFF7960C
8 changed files with 484 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
stats.json
vendor/

6
composer.json Normal file
View File

@ -0,0 +1,6 @@
{
"require": {
"michelf/php-markdown": "^1.8",
"mnapoli/front-yaml": "^1.6"
}
}

261
composer.lock generated Normal file
View File

@ -0,0 +1,261 @@
{
"_readme": [
"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#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "d6a1ecb21bac8642fb0b75ee1e70eced",
"packages": [
{
"name": "erusev/parsedown",
"version": "1.7.0",
"source": {
"type": "git",
"url": "https://github.com/erusev/parsedown.git",
"reference": "6678d59be48c4be64eaca6ce70bea48a09488cc2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/erusev/parsedown/zipball/6678d59be48c4be64eaca6ce70bea48a09488cc2",
"reference": "6678d59be48c4be64eaca6ce70bea48a09488cc2",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35"
},
"type": "library",
"autoload": {
"psr-0": {
"Parsedown": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Emanuil Rusev",
"email": "hello@erusev.com",
"homepage": "http://erusev.com"
}
],
"description": "Parser for Markdown.",
"homepage": "http://parsedown.org",
"keywords": [
"markdown",
"parser"
],
"time": "2018-02-28T11:41:37+00:00"
},
{
"name": "michelf/php-markdown",
"version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/michelf/php-markdown.git",
"reference": "01ab082b355bf188d907b9929cd99b2923053495"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/01ab082b355bf188d907b9929cd99b2923053495",
"reference": "01ab082b355bf188d907b9929cd99b2923053495",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Michelf\\": "Michelf/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Michel Fortin",
"email": "michel.fortin@michelf.ca",
"homepage": "https://michelf.ca/",
"role": "Developer"
},
{
"name": "John Gruber",
"homepage": "https://daringfireball.net/"
}
],
"description": "PHP Markdown",
"homepage": "https://michelf.ca/projects/php-markdown/",
"keywords": [
"markdown"
],
"time": "2018-01-15T00:49:33+00:00"
},
{
"name": "mnapoli/front-yaml",
"version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/mnapoli/FrontYAML.git",
"reference": "24070ace8b741247bb3161cbb38ecc541268b296"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mnapoli/FrontYAML/zipball/24070ace8b741247bb3161cbb38ecc541268b296",
"reference": "24070ace8b741247bb3161cbb38ecc541268b296",
"shasum": ""
},
"require": {
"erusev/parsedown": "~1.0",
"php": ">=5.4.0",
"symfony/yaml": "~2.1|^3.0|^4.0"
},
"require-dev": {
"league/commonmark": "~0.7",
"phpunit/phpunit": "~4.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Mni\\FrontYAML\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"time": "2017-10-29T19:29:55+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
},
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"time": "2018-08-06T14:22:27+00:00"
},
{
"name": "symfony/yaml",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "b832cc289608b6d305f62149df91529a2ab3c314"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/b832cc289608b6d305f62149df91529a2ab3c314",
"reference": "b832cc289608b6d305f62149df91529a2ab3c314",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/polyfill-ctype": "~1.8"
},
"conflict": {
"symfony/console": "<3.4"
},
"require-dev": {
"symfony/console": "~3.4|~4.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2018-08-18T16:52:46+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}

37
wiki/README.md Normal file
View File

@ -0,0 +1,37 @@
# tilde.chat wiki
hi there, welcome to our wiki!
to contribute to the wiki:
* [fork the repo](https://git.tildeverse.org/repo/fork/53)
* clone the repo to your local machine (or your public_html folder on the tilde.team box for live testing)
```sh
git clone git@tilde.chat:tildeverse/tilde.chat
```
* create a new branch for your page
```sh
git checkout -b my-new-page
```
* if you want to add a new page, copy `template.md` into your new page!
```sh
cp template.md my-new-page.md
```
* edit as needed!
* commit your changes and [create a pull request](https://git.tildeverse.org/tildeverse/tilde.chat/pulls) :)
```sh
git add --all
git commit -m "added my-new-page"
git push origin my-new-page # this should match the branch name you created earlier
```
* create a pull request on the [site](https://git.tildeverse.org/tildeverse/tilde.chat) repo
thanks!~
ps. if you have any questions, ask on irc! (preferably in #meta)

87
wiki/index.php Normal file
View File

@ -0,0 +1,87 @@
<?php
require __DIR__.'/../vendor/autoload.php';
$additional_head = "
<style>
:target:before {
content:\"\";
display:block;
height:90px; /* fixed header height*/
margin:-90px 0 0; /* negative fixed header height */
}
</style>
<meta property='og:type' content='website'>
<meta property='og:site_name' content='tilde.chat wiki'>
";
class MDParser implements Mni\FrontYAML\Markdown\MarkdownParser {
public function __construct() {
$this->mdparser = new Michelf\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);
}
}
$parser = new Mni\FrontYAML\Parser(null, new MDParser());
if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {
$title = "tilde.chat~wiki";
$additional_head .= "
<meta property='og:title' content='$title'>
<meta property='og:url' content='https://tilde.chat{$_SERVER['REQUEST_URI']}'>
<meta property='og:description' content='tilde.chat wiki'>
";
include __DIR__.'/../header.php';
// render wiki index ?>
<h1>tilde.chat wiki</h1>
<p>welcome to the tilde.chat wiki!</p>
<p>if you want to contribute, check out the
<a href="https://git.tildeverse.org/tildeverse/tilde.chat/src/branch/master/wiki">source</a> and open a PR!
</p>
<hr>
<h3>pages:</h3>
<?php
foreach (glob("pages/*.md") as $page) {
$yaml = $parser->parse(file_get_contents($page))->getYAML();
if (!$yaml["published"]) continue; ?>
<a href="?page=<?=basename($page, ".md")?>"><?=$yaml["title"]?></a><br>
<?php }
} else {
$pg = $parser->parse(file_get_contents("pages/{$_GET["page"]}.md"));
$yml = $pg->getYAML();
$title = $yml['title'] . " | tilde.chat~wiki";
$description = $yml['description'] ?? "tilde.chat wiki article {$yml['title']}";
$additional_head .= "
<meta property='og:title' content='$title'>
<meta property='og:url' content='https://tilde.chat{$_SERVER['REQUEST_URI']}'>
<meta property='og:description' content='$description'>
";
include __DIR__.'/../header.php';
// show a single page ?>
<a href=".">&lt; ~wiki</a>
<hr>
<?=str_replace("<table", '<table class="table table-striped"', $pg->getContent())?>
<hr>
<a href="https://git.tildeverse.org/tildeverse/tilde.chat/src/branch/master/wiki/pages/<?=$_GET["page"]?>.md">
<i class="fa fa-edit"></i> source
</a>
<?php }
include __DIR__.'/../footer.php';

42
wiki/pages/bots.md Normal file
View File

@ -0,0 +1,42 @@
---
author: ~cmccabe
published: true
title: cool irc bots
description: information about irc bots on tilde.chat
category:
- main
---
# tilde.team irc bots
you might have seen some bots lurking about in chat. this page is intended to be a common place for documentation.
bots should be well behaved and efficient with system resources. if you see a bot that is not, please remind the botmaster about this and/or notify an admin. naughty bots can make the system less enjoyable for everyone, and we all have to work together to police them.
## rules and etiquette for tilde.chat irc bots
your bot must respond to !botlist with the following information:
- your system username (as creator/botmaster) - so we can contact you if the bot misbehaves
- one line description of the bot's functionality
- list of the bots public commands
be conservative about automatically re-connecting to the server or channel.
if your bot's code is not yet stable, keep it in the #bots channel and do testing there.
## tilde.team bot starter kit
[khuxkm](https://khuxkm.tilde.team) is hard at work developing a starter kit framework in python that you can use to build your own irc bot. find the [source here](https://git.tildeverse.org/team/teambot). it's installed globally on ~team, so get coding!
## add your bot to the list below
follow the example of sedbot when you add your bot in a PR to the wiki
* sedbot
- botmaster: [~ben](https://ben.tilde.team)
- short description: sent a typo in chat? fix it up with a sed expression and sedbot will try to correct it
- list of functions:
+ s/needle/replace/flags
+ most regex character classes match here
+ flags include `g` and `i`
- [source](https://git.tildeverse.org/ben/sedbot)

32
wiki/pages/etiquette.md Normal file
View File

@ -0,0 +1,32 @@
---
author: ~ben
published: false
title: irc etiquette
description: some guidelines for chatiquette
category:
- main
---
# guidelines
some rules adapted from: https://github.com/fizerkhan/irc-etiquette
## no flooding/spamming/trolling in main channels
multiline messages belong in a pastebin. feel free to use https://ttm.sh (`echo text here | curl -F'file=@-;filename=stdin.txt'`) or https://paste.tildeverse.org for a graphical pastebin.
if you have a need to spam many lines or abuse the figlet feature of tildebot, please do so in the appropriate channel (#chaos or #shitposting).
## don't be lazy - read the documentation
if people tell you to read the documentation then you should do so. never say: "i'm too lazy. come on. you all know what i need to do. just tell me what i need to do." this will get you ignored for all eternity. however you can expect to be told where to find the documentation. but if you get an url then get it and read it. if the documentation is too technical or you don't understand certain sections then say: "i have now read chapter 3.1 of the url you gave me and i understand how virtual domains work in general. but how would i use both virtual and non-virtual domains together?"
## unintended rudeness
sometimes you may feel that others are rude. you may get a response like "reinstall the package. restart the service. read the /usr/share/doc/mysoftware/readme." although this is a very brief reply it is likely not meant to be rude. irc is often like human interaction without all the friendly bits. other people have probably answered your question a dozen of times today and they just want to help you solve the problem - not become close friends with you. don't be offended by it. the people don't mean it.
## try to not repeat yourself
asking the same question every minute is annoying. if anyone in the channel isn't paying attention then they will neither read you the second and third time. and those who came back from lunch or sleep will likely see in their "lastlog" what has happened lately. this is too demanding.
# consequences
* first offenses will be handled with a kick from the channel with an explanation of the undesirable channel. at this point, it's acceptable to rejoin.
* second offenses will be handled with a 1 hour tempban. following the tempban, an irc/chan op will check in and let you know what kinds of behaviors to avoid.
* third offenses will be the same as second, but with a 24 hour tempban period.
if the undesirable behavior continues, further methods (up to and including a permanent ban) will be discussed among the op team.

18
wiki/pages/irc.md Normal file
View File

@ -0,0 +1,18 @@
---
author: ~ben
published: true
title: irc
description: irc information
category:
- main
---
# [tildeverse irc](https://tilde.chat)
hi tildizens!
the tilde.chat irc network is available at tilde.chat:+6697 (with ssl)
this is the beginning of the [tilde.chat](https://tilde.chat) irc federation! more info on that site.
there is an instance of [thelounge](https://thelounge.chat) webchat at [irc.tilde.team](https://web.tilde.chat) if you don't already have your own client.