3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

Add extbans docs (#498)

This commit is contained in:
James Lu 2017-08-24 01:07:50 -07:00
parent b214a8f4c0
commit 7230aaa7df
3 changed files with 240 additions and 18 deletions

View File

@ -0,0 +1,33 @@
Extban / IRCd,charybdis,InspIRCd,UnrealIRCd
ban_account,$a:,R:,~a:
ban_account_legacy,,,~R:
ban_all_opers,$o,,
ban_all_registered,$a,,
ban_all_ssl,$z,,
ban_banshare,$j:,,
ban_blockcaps,,B:,
ban_blockcolor,,c:,
ban_certfp,,z:,~S:
ban_extgecos,$x:,,
ban_inchannel,$c:,j:,~c:
ban_invites,,A:,
ban_noctcp,,C:,
ban_nojoins,,,~j:
ban_nokicks,,Q:,
ban_nonick,,N:,~n:
ban_nonotice,,T:,
ban_not_account,$~a:,,
ban_not_banshare,$~j:,,
ban_not_extgecos,$~x:,,
ban_not_inchannel,$~c:,,
ban_not_opers,$~o,,
ban_not_realname,$~r:,,
ban_not_server,$~s:,,
ban_not_ssl,$~z,,
ban_opertype,,O:,~O:
ban_partmsgs,,p:,
ban_realname,$r:,r:,~r:
ban_server,$s:,s:,
ban_stripcolor,,S:,
ban_unregistered_matching,,U:,
quiet,+q (cmode),m:,~q:
1 Extban / IRCd charybdis InspIRCd UnrealIRCd
2 ban_account $a: R: ~a:
3 ban_account_legacy ~R:
4 ban_all_opers $o
5 ban_all_registered $a
6 ban_all_ssl $z
7 ban_banshare $j:
8 ban_blockcaps B:
9 ban_blockcolor c:
10 ban_certfp z: ~S:
11 ban_extgecos $x:
12 ban_inchannel $c: j: ~c:
13 ban_invites A:
14 ban_noctcp C:
15 ban_nojoins ~j:
16 ban_nokicks Q:
17 ban_nonick N: ~n:
18 ban_nonotice T:
19 ban_not_account $~a:
20 ban_not_banshare $~j:
21 ban_not_extgecos $~x:
22 ban_not_inchannel $~c:
23 ban_not_opers $~o
24 ban_not_realname $~r:
25 ban_not_server $~s:
26 ban_not_ssl $~z
27 ban_opertype O: ~O:
28 ban_partmsgs p:
29 ban_realname $r: r: ~r:
30 ban_server $s: s:
31 ban_stripcolor S:
32 ban_unregistered_matching U:
33 quiet +q (cmode) m: ~q:

180
docs/modelists/extbans.html Normal file
View File

@ -0,0 +1,180 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name=viewport content="width=device-width, initial-scale=1">
<head>
<title>Support Extbans for PyLink Relay</title>
<style>
html {
background-color: white;
}
.note {
color: #555555;
}
/* (╮°-°)╮┳━┳ */
table, th, td {
border: 1px solid black;
}
td, th {
text-align: center;
padding: 3px;
}
td:first-child, th[scope="row"] {
text-align: left;
}
/* Table cells */
.tablecell-yes {
background-color: #A7F2A5
}
.tablecell-no {
background-color: #F08496
}
.tablecell-na {
background-color: #F0F0F0
}
.tablecell-planned, .tablecell-yes2 {
background-color: #92E8DF
}
.tablecell-partial {
background-color: #EDE8A4
}
.tablecell-special {
background-color: #DCB1FC
}
.tablecell-caveats {
background-color: #F0C884
}
.tablecell-caveats2 {
background-color: #ED9A80
}
.tablecell-no-padding {
padding: initial;
}
</style>
</head>
<body>
<table><tr>
<th scope="col">Extban / IRCd</th>
<th scope="col">charybdis</th>
<th scope="col">InspIRCd</th>
<th scope="col">UnrealIRCd</th>
</tr>
<tr>
<th scope="row">ban_account</th>
<td class="tablecell-yes">$a:<span class="note">data</span></td><td class="tablecell-yes">R:<span class="note">data</span></td><td class="tablecell-yes">~a:<span class="note">data</span></td></tr>
<tr>
<th scope="row">ban_account_legacy</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td><td class="tablecell-yes">~R:<span class="note">data</span></td></tr>
<tr>
<th scope="row">ban_all_opers</th>
<td class="tablecell-yes2">$o</td><td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_all_registered</th>
<td class="tablecell-yes2">$a</td><td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_all_ssl</th>
<td class="tablecell-yes2">$z</td><td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_banshare</th>
<td class="tablecell-yes">$j:<span class="note">data</span></td><td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_blockcaps</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-yes">B:<span class="note">data</span></td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_blockcolor</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-yes">c:<span class="note">data</span></td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_certfp</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-yes">z:<span class="note">data</span></td><td class="tablecell-yes">~S:<span class="note">data</span></td></tr>
<tr>
<th scope="row">ban_extgecos</th>
<td class="tablecell-yes">$x:<span class="note">data</span></td><td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_inchannel</th>
<td class="tablecell-yes">$c:<span class="note">data</span></td><td class="tablecell-yes">j:<span class="note">data</span></td><td class="tablecell-yes">~c:<span class="note">data</span></td></tr>
<tr>
<th scope="row">ban_invites</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-yes">A:<span class="note">data</span></td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_noctcp</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-yes">C:<span class="note">data</span></td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_nojoins</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td><td class="tablecell-yes">~j:<span class="note">data</span></td></tr>
<tr>
<th scope="row">ban_nokicks</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-yes">Q:<span class="note">data</span></td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_nonick</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-yes">N:<span class="note">data</span></td><td class="tablecell-yes">~n:<span class="note">data</span></td></tr>
<tr>
<th scope="row">ban_nonotice</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-yes">T:<span class="note">data</span></td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_not_account</th>
<td class="tablecell-yes">$~a:<span class="note">data</span></td><td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_not_banshare</th>
<td class="tablecell-yes">$~j:<span class="note">data</span></td><td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_not_extgecos</th>
<td class="tablecell-yes">$~x:<span class="note">data</span></td><td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_not_inchannel</th>
<td class="tablecell-yes">$~c:<span class="note">data</span></td><td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_not_opers</th>
<td class="tablecell-yes2">$~o</td><td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_not_realname</th>
<td class="tablecell-yes">$~r:<span class="note">data</span></td><td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_not_server</th>
<td class="tablecell-yes">$~s:<span class="note">data</span></td><td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_not_ssl</th>
<td class="tablecell-yes2">$~z</td><td class="tablecell-na note">n/a</td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_opertype</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-yes">O:<span class="note">data</span></td><td class="tablecell-yes">~O:<span class="note">data</span></td></tr>
<tr>
<th scope="row">ban_partmsgs</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-yes">p:<span class="note">data</span></td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_realname</th>
<td class="tablecell-yes">$r:<span class="note">data</span></td><td class="tablecell-yes">r:<span class="note">data</span></td><td class="tablecell-yes">~r:<span class="note">data</span></td></tr>
<tr>
<th scope="row">ban_server</th>
<td class="tablecell-yes">$s:<span class="note">data</span></td><td class="tablecell-yes">s:<span class="note">data</span></td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_stripcolor</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-yes">S:<span class="note">data</span></td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">ban_unregistered_matching</th>
<td class="tablecell-na note">n/a</td><td class="tablecell-yes">U:<span class="note">data</span></td><td class="tablecell-na note">n/a</td></tr>
<tr>
<th scope="row">quiet</th>
<td class="tablecell-special">+q<br><span class="note">(cmode)</span></td><td class="tablecell-yes">m:<span class="note">data</span></td><td class="tablecell-yes">~q:<span class="note">data</span></td></tr>
</table>
</body>
</html>

View File

@ -11,13 +11,38 @@ os.chdir(os.path.dirname(__file__))
FILES = {
'user-modes.csv': 'Supported User Modes for PyLink',
'channel-modes.csv': 'Supported Channel Modes for PyLink'
'channel-modes.csv': 'Supported Channel Modes for PyLink',
'extbans.csv': 'Support Extbans for PyLink Relay',
}
def _write(outf, text):
print(text, end='')
outf.write(text)
def _format(articlename, text):
# More formatting
if text:
if 'modes' in articlename:
text = '+' + text
try:
text, note = text.split(' ', 1)
except ValueError:
if text.endswith('*'):
text = '<td class="tablecell-yes2">%s</td>' % text
elif 'extbans' in articlename:
if text.endswith(':'):
text = '<td class="tablecell-yes">%s<span class="note">data</span></td>' % text
else: # Arg-less extban
text = '<td class="tablecell-yes2">%s</td>' % text
else:
text = '<td class="tablecell-yes">%s</td>' % text
else:
text = '%s<br><span class="note">%s</span>' % (text, note)
text = '<td class="tablecell-special">%s</td>' % text
else:
text = '<td class="tablecell-na note">n/a</td>'
return text
for fname, title in FILES.items():
outfname = os.path.splitext(fname)[0] + '.html'
print('Generating HTML for %s to %s:' % (fname, outfname))
@ -119,23 +144,7 @@ td:first-child, th[scope="row"] {
elif colidx == 0:
text = '<th scope="row">%s</th>\n' % coltext
else:
# More formatting
if coltext:
coltext = '+' + coltext
try:
coltext, note = coltext.split(' ', 1)
except ValueError:
if coltext.endswith('*'):
text = '<td class="tablecell-yes2">%s</td>' % coltext
else:
text = '<td class="tablecell-yes">%s</td>' % coltext
else:
coltext = '%s<br><span class="note">%s</span>' % (coltext, note)
text = '<td class="tablecell-special">%s</td>' % coltext
else:
text = '<td class="tablecell-na note">n/a</td>'
text = _format(fname, coltext)
_write(outf, text)
_write(outf, "</tr>\n")