wrap text and trim trailing whitespace

This commit is contained in:
Ben Harris 2019-06-19 19:41:45 -04:00
parent 113bf4f9a7
commit a67920bedb
Signed by untrusted user: ben
GPG Key ID: 4E0AF802FFF7960C
7 changed files with 443 additions and 454 deletions

View File

@ -1,82 +0,0 @@
<?php
include __DIR__.'/../vendor/autoload.php';
$parser = Rfcs\MDParser::factory();
if (isset($_GET["number"])) {
$num = $_GET["number"];
} elseif (count($_GET) == 1) {
$num = array_keys($_GET)[0];
} else {
$num = "";
}
$filename = "rfc{$num}.md";
if (file_exists($filename)) {
$document = $parser->parse(file_get_contents($filename));
$yml = $document->getYAML();
$content = $document->getContent();
$title = $yml['title'] ?? 'invalid';
$author = htmlspecialchars($yml['author']);
$description = "Draft {$yml['number']}: {$yml['title']} by {$author}";
include __DIR__.'/../header.php';
?>
<a href=".">&lt; back to list</a>
<h1>RFC <?=$yml['number']?>: <?=$yml['title']?></h1>
<p>Author: <?=$author?>
<br />
<?php if (isset($yml['updates'])) { ?>
Updates:
<?php
$arr = explode(", ", $yml['updates']);
foreach ($arr as $num) {
echo "<a href='/rfcs/?{$num}'>{$num}</a>";
if (next($arr)) {
echo ", ";
}
}
?>
<br />
<?php };?>
<?php if (isset($yml['updated-by'])) { ?>
Updated by:
<?php
$arr = explode(", ",$yml['updated-by']);
foreach ($arr as $num) {
echo "<a href='/rfcs/?{$num}'>{$num}</a>";
if (next($arr)) {
echo ", ";
}
}?>
<br />
<?php } ?>
<?=$content?>
<?php
// we need to list the rfcs
} else {
$title="Draft List";
$description="A list of Tildeverse RFCs.";
include __DIR__.'/../header.php';
?>
<h1>Draft List</h1>
<ul>
<?php foreach (glob("*.md") as $rfc) {
$num = substr(basename($rfc,".md"),3);
$yml = $parser->parse(file_get_contents($rfc))->getYAML();
?>
<li><a href="/rfcs/?<?=$num?>">RFC <?=$num?>: <?=$yml['title']?></a></li>
<?php } ?>
</ul>
<?php } ?>
<?php include __DIR__.'/../footer.php'; ?>

View File

@ -12,8 +12,7 @@
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="/"><i class="fa fa-home"></i> Home</a></li>
<li><a href="/rfcs/"><i class="fa fa-file-text"></i> RFC list</a></li>
<li><a href="/drafts/"><i class="fa fa-pencil-square"></i> Drafts</a></li>
<li><a href="/rfcs/"><i class="fa fa-file-text"></i> RFCs</a></li>
<li><a href="https://tildegit.org/tildeverse/rfcs"><i class="fa fa-code-fork"></i> Git</a></li>
</ul>
</div>

View File

@ -28,7 +28,8 @@
<h1>RFC <?=$yml['number']?>: <?=$yml['title']?></h1>
<p>Author: <?=$author?>
<p>Author: <?=$author?></p>
<p>Status: <?=$yml["status"]?></p>
<br />
<?php if (isset($yml['updates'])) { ?>
@ -66,14 +67,30 @@
$title="RFC List";
$description="A list of Tildeverse RFCs.";
include __DIR__.'/../header.php';
foreach (glob("*.md") as $rfc) {
$rfcs[] = [
"num" => substr(basename($rfc, ".md"), 3),
"yml" => $parser->parse(file_get_contents($rfc))->getYAML(),
];
}
?>
<h1>RFC List</h1>
<ul>
<?php foreach (glob("*.md") as $rfc) {
$num = substr(basename($rfc,".md"),3);
$yml = $parser->parse(file_get_contents($rfc))->getYAML();
<?php foreach ($rfcs as $rfc) {
if ($rfc["yml"]["status"] !== "Accepted") continue;
?>
<li><a href="/rfcs/?<?=$num?>">RFC <?=$num?>: <?=$yml['title']?></a></li>
<li><a href="/rfcs/?<?=$rfc["num"]?>">RFC <?=$rfc["num"]?>: <?=$rfc["yml"]['title']?></a></li>
<?php } ?>
</ul>
<h1>Drafts</h1>
<ul>
<?php foreach ($rfcs as $draft) {
if ($draft["yml"]["status"] === "Accepted") continue;
?>
<li><a href="/rfcs/?<?=$draft["num"]?>">Draft <?=$draft["num"]?>: <?=$draft["yml"]["title"]?></a></li>
<?php } ?>
</ul>

View File

@ -4,9 +4,12 @@ number: 0
author: Robert Miles <khuxkm@tilde.team>
status: Accepted
---
## Abstract
This RFC defines the format used by an RFC. RFCs in this system are stored as Markdown files with YAML front-matter. RFC files MAY be stored with any extension commonly used by markdown files.
This RFC defines the format used by an RFC. RFCs in this system are stored
as Markdown files with YAML front-matter. RFC files MAY be stored with any
extension commonly used by markdown files.
This RFC also defines the semantics of how the RFC system will work.
@ -14,13 +17,18 @@ This RFC also defines the semantics of how the RFC system will work.
The front-matter MUST contain the following key-value pairs:
- `title`: The title of the document. Standards documents should be titled in the format `Standards X: Y` where X is the standards number and Y is the title of the standard. ([See below for an explanation of standards.](#types-of-documents))
- `title`: The title of the document. Standards documents should be
titled in the format `Standards X: Y` where X is the standards number
and Y is the title of the standard. ([See below for an explanation of
standards.](#types-of-documents))
- `number`: The canonical number of the RFC. Starts at 0 (this document) and counts up in decimal.
- `number`: The canonical number of the RFC. Starts at 0 (this document)
and counts up in decimal.
- `author`: The author of the document. May contain email.
- `status`: The status of this document. Should be `Accepted` or `Proposed`. (Rejected documents are not made a part of the repository.)
- `status`: The status of this document. Should be `Accepted` or
`Proposed`. (Rejected documents are not made a part of the repository.)
The front-matter MAY contain the following key-value pairs:
@ -28,40 +36,56 @@ The front-matter MAY contain the following key-value pairs:
- `updated-by`: A comma-seperated list of RFCs that update this RFC.
Note that the two lists should be added to in sequence; if RFC 2 updates RFC 1, then RFC 2 needs to have 1 in its `updates` and RFC 1 needs 2 in its `updated-by`.
Note that the two lists should be added to in sequence; if RFC 2 updates
RFC 1, then RFC 2 needs to have 1 in its `updates` and RFC 1 needs 2 in its
`updated-by`.
## Semantics of the RFC System
The RFC system for tilde boxes will be hosted at https://rfc.tildeverse.org/ and on the tildeverse gitea as [tildeverse/rfcs](https://tildegit.org/tildeverse/rfcs).
The RFC system for tilde boxes will be hosted at
https://rfc.tildeverse.org/ and on the tildeverse gitea as
[tildeverse/rfcs](https://tildegit.org/tildeverse/rfcs).
### Types of Documents
RFC documents are simply requests. They are for simple things like defining how something should work or how something should be done.
RFC documents are simply requests. They are for simple things like defining
how something should work or how something should be done.
Standards documents are like mandates. They require something. For example, this document requires a would-be submitter to follow this
format for RFCs. A Standards document can be amended by RFC documents, and any RFC documents in violation of a Standards document,
unless otherwise stated within the Standards document, are invalid.
Standards documents are like mandates. They require something. For example,
this document requires a would-be submitter to follow this format for RFCs. A
Standards document can be amended by RFC documents, and any RFC documents
in violation of a Standards document, unless otherwise stated within the
Standards document, are invalid.
### Procedural Section
Every RFC and Standards document should end with a procedural information section (id tagged as [#procedures](#procedures)).
Every RFC and Standards document should end with a procedural information
section (id tagged implicitly as [#procedural-section](#procedural-section)).
There are 2 sub-sections to the procedural info section:
- Security Considerations (tagged [#security](#security)) - If there are any security reasons/concerns for the document, they MUST be subsections of this.
- Security Considerations (tagged implicitly as
[#security-considerations](#security-considerations)) - If there are any
security reasons/concerns for the document, they MUST be subsections of this.
- Configuration Considerations (tagged [#config](#config)) - For example, if configs need to be changed due to the RFC.
- Configuration Considerations (tagged implicitly as
[#configuration-considerations](#configuration-considerations)) - For example,
if configs need to be changed due to the RFC.
### Submission guidelines
An RFC should be submitted as a PR to the [git repo](https://tildegit.org/tildeverse/rfcs). RFCs MUST come with a draft name.
An RFC should be submitted as a PR to the [git
repo](https://tildegit.org/tildeverse/rfcs). RFCs MUST come with a draft name.
For example, a draft name for an RFC to make tilde.chat allow IRC connections without SSL could be `draft-tilde-chat-without-ssl`.
For example, a draft name for an RFC to make tilde.chat allow IRC connections
without SSL could be `draft-tilde-chat-without-ssl`.
The only time an RFC can omit the number tag in its front-matter is when it is a draft. Drafts do not have numbers and are of the
status `Proposed`. If or when an RFC is accepted, it will be given a number (at which time it MUST be renamed `rfcX.md`, where X is
the number). The status MUST be changed to `Accepted` and the number tag MUST contain the assigned number. When the former draft
meets these requirements, the PR will be merged.
The only time an RFC can omit the number tag in its front-matter is when it
is a draft. Drafts do not have numbers and are of the status `Proposed`. If
or when an RFC is accepted, it will be given a number (at which time it MUST
be renamed `rfcX.md`, where X is the number). The status MUST be changed to
`Accepted` and the number tag MUST contain the assigned number. When the
former draft meets these requirements, the PR will be merged.
## Procedural Information
@ -71,4 +95,5 @@ There are no security considerations to this document.
### Configuration Considerations
A subdomain of tildeverse.org has been provisioned for the RFC project, and a repo has been created, in accordance with this document.
A subdomain of tildeverse.org has been provisioned for the RFC project,
and a repo has been created, in accordance with this document.

View File

@ -2,23 +2,43 @@
title: Remembering A Dear Friend Forever
number: 1
author: Robert Miles <khuxkm@tilde.team>
status: Approved
status: Accepted
---
## Abstract
tilde.town member [abraxas](//tilde.town/~abraxas/) passed away in a motorcycle accident recently. He shall be missed.
tilde.town member [abraxas](https://tilde.town/~abraxas/) passed away in a motorcycle
accident recently. He shall be missed.
## Clacks-Overhead
In Sir Terry Pratchett's Discworld series, the clacks are a series of semaphore towers loosely based on the concept of the telegraph. Invented by an artificer named Robert Dearheart, the towers could send messages "at the speed of light" using standardized codes. When Dearheart's son John died due to an accident while working on a clacks tower, Dearheart inserted John's name into the overhead of the clacks with a "GNU" in front of it (meaning, basically, to send it on, unlogged, and turning around at the end of the line) as a way to memorialize his son forever (or for at least as long as the clacks are standing.) (explanation paraphrased and plagiarized from [GNU Terry Pratchett](https://gnuterrypratchett.com/))
In Sir Terry Pratchett's Discworld series, the clacks are a series of semaphore
towers loosely based on the concept of the telegraph. Invented by an artificer
named Robert Dearheart, the towers could send messages "at the speed of light"
using standardized codes. When Dearheart's son John died due to an accident
while working on a clacks tower, Dearheart inserted John's name into the
overhead of the clacks with a "GNU" in front of it (meaning, basically, to send
it on, unlogged, and turning around at the end of the line) as a way to
memorialize his son forever (or for at least as long as the clacks are
standing.) (explanation paraphrased and plagiarized from
[GNU Terry Pratchett](https://gnuterrypratchett.com/))
Sir Terry Pratchett himself passed away a few years ago. To commemorate him on the web, the users of the DiscWorld subreddit came up with the idea of a non-standard HTTP header, `X-Clacks-Overhead`, which, much like the overhead it simulates, is virtually invisible unless you're working with HTTP and looking at headers.
Sir Terry Pratchett himself passed away a few years ago. To commemorate him on
the web, the users of the DiscWorld subreddit came up with the idea of a
non-standard HTTP header, `X-Clacks-Overhead`, which, much like the overhead it
simulates, is virtually invisible unless you're working with HTTP and looking
at headers.
In this spirit, I propose that we honor our dear friend abraxas, a true townie, through putting `GNU ~abraxas` in the `X-Clacks-Overhead` header.
In this spirit, I propose that we honor our dear friend abraxas, a true townie,
through putting `GNU ~abraxas` in the `X-Clacks-Overhead` header.
> 'We keep that name moving in the Overhead,' he said, and it seemed to Princess that the wind in the shutter arrays above her blew more forlornly, and the everlasting clicking of the shutters grew more urgent. 'He'd never have wanted to go home. He was a real linesman. His name is in the code, in the wind in the rigging and the shutters. **Haven't you ever heard the saying "A man's not dead while his name is still spoken"?'**
> 'We keep that name moving in the Overhead,' he said, and it seemed to
> Princess that the wind in the shutter arrays above her blew more forlornly,
> and the everlasting clicking of the shutters grew more urgent. 'He'd never
> have wanted to go home. He was a real linesman. His name is in the code, in
> the wind in the rigging and the shutters. **Haven't you ever heard the saying
> "A man's not dead while his name is still spoken"?'**
>
> -- <cite>Sir Terry Pratchett, Going Postal</cite>
> <cite>Sir Terry Pratchett, Going Postal</cite>
## Procedural Information
@ -28,4 +48,6 @@ There are no security considerations to this document.
### Configuration Considerations
Conforming tildes must add a configuration block to their web server to serve the message. Examples for most servers can be found [here](http://www.gnuterrypratchett.com/#servers).
Conforming tildes must add a configuration block to their web server to serve
the message. Examples for most servers can be found
[here](http://www.gnuterrypratchett.com/#servers).

View File

@ -6,27 +6,33 @@ number: 2
---
## Abstract
IRC bots are programs that communicate with users through Internet Relay Chat. These bots can do a wide assortment of things,
from getting weather information to running games. We accept IRC bots on tilde.chat, but we ask that any prospective bot operator
follow these rules.
IRC bots are programs that communicate with users through Internet Relay Chat.
These bots can do a wide assortment of things, from getting weather information
to running games. We accept IRC bots on tilde.chat, but we ask that any
prospective bot operator follow these rules.
### `!botlist` command
The botlist command is our answer to not knowing the functions a bot provides.
All conformant bots MUST respond to `!botlist` with: (examples from [minerbot2](https://tildegit.org/khuxkm/minerbot2), my personal IRC bot)
All conformant bots MUST respond to `!botlist` with: (examples from
[minerbot2](https://tildegit.org/khuxkm/minerbot2), my personal IRC bot)
- Maintainer (e.x.; "Maintainer: khuxkm@tilde.team")
- Small description (optional) (e.x.; "A utility bot that does some other cool things too!")
- Small description (optional) (e.x.; "A utility bot that does some other cool
things too!")
- Command list (e.x; "Commands: !foo !bar")
For conformance with [previous standards on other tilde boxes](https://tilde.town/wiki/bots/ircbots.html), bots SHOULD also respond to `!rollcall` with at least the command list.
For conformance with [previous standards on other tilde
boxes](https://tilde.town/wiki/socializing/irc/list-of-bots.html), bots SHOULD
also respond to `!rollcall` with at least the command list.
Please note that the prefix of `!` is constant: no matter the usual prefix of the bot, it MUST respond to `!botlist` and/or `!rollcall` with the given prefix.
Please note that the prefix of `!` is constant: no matter the usual prefix of
the bot, it MUST respond to `!botlist` and/or `!rollcall` with the given prefix.
### Usermode +B
All bots on tilde.chat must set usermode +B on or near connect.
All bots on tilde.chat MUST set usermode +B on or near connect.
## Procedural Information
@ -36,8 +42,10 @@ There are no security considerations to this document.
### Configuration Considerations
IRC bots on tilde.chat MUST be updated to follow the botlist convention and set usermode +B on connect.
IRC bots on tilde.chat MUST be updated to follow the botlist convention and set
usermode +B on connect.
For bots on tilde.chat coming from tilde.town, maintainer info must be added, as well as an alias from "!botlist" to "!rollcall".
For bots on tilde.chat coming from tilde.town, maintainer info must be added,
as well as an alias from "!botlist" to "!rollcall".
Bots made with [teambot](https://tildegit.org/team/teambot) will be updated to set usermode +B.

View File

@ -2,7 +2,7 @@
title: "Tilde Center Specification"
number: 3
author: Austin Ewens <aewens@tilde.center>
status: Approved
status: Accepted
---
## Abstract