about summary refs log tree commit diff stats
path: root/.gitignore
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-08-30 00:06:27 +0200
committerbptato <nincsnevem662@gmail.com>2024-08-30 00:12:23 +0200
commit209210fe06be1c77da5c2fd0e2e17cfb4397a50b (patch)
tree7af9777a5c66c721b2c8c8ec010835fcc4b09c9c /.gitignore
parentb721c669670bfbf95672780bf473dc418c2d32be (diff)
downloadchawan-209210fe06be1c77da5c2fd0e2e17cfb4397a50b.tar.gz
md2html: support blockquote
+ update todo, readme
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions
c.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/bin/sh
# Adapter for the spartan protocol. See: spartan://mozz.us
# Requires netcat (nc).
#
# Usage: add the following line to your urimethodmap:
#
# spartan: /cgi-bin/spartan.cgi

if ! type nc >/dev/null 2>/dev/null
then	printf 'Cha-Control: ConnectionError 1 nc not found\n'
	exit 1
fi
MAPPED_URI_PORT=${MAPPED_URI_PORT:=300} # default port is 300
MAPPED_URI_PATH=${MAPPED_URI_PATH:=/} # needs / for root
if test "$REQUEST_METHOD" != POST && test "$MAPPED_URI_QUERY" = "input"
then	printf "Content-Type: text/html

<!DOCTYPE html>
<form method=POST action=\"$MAPPED_URI_PATH\">
Input text to upload:
<p>
<textarea name=q></textarea>
<p>
<input type=submit>
</form>"
	exit 0
fi
CONTENT_LENGTH=${CONTENT_LENGTH:+$(($CONTENT_LENGTH - 2))} # skip q=
CONTENT_LENGTH=${CONTENT_LENGTH:=0} # if missing, set to 0
{
	printf '%s %d\n' "$MAPPED_URI_HOST $MAPPED_URI_PATH" "$CONTENT_LENGTH"
	tail -c+3 # skip q=
} | nc "$MAPPED_URI_HOST" "$MAPPED_URI_PORT" 2>/dev/null | {
	IFS= read -r line
	case $line in
	'2 '*)	ctype=${line#2 }
		printf "Content-Type: %s\n\n" "$ctype"
		# Spartan does something very rude by extending text/gemini
		# for the spartan protocol only. Horrible hack to make it work:
		test "${ctype%
}" = "text/gemini" &&
			sed 's/^=: \([^ ]*\)/=> \1?input/' || cat ;;
	'3 '*)	printf "Status: 301\nLocation: %s\n" "${line#3 }" ;;
	'4 '*)	printf "Status: 403\n\n%s" "${line#4 }" ;;
	'5 '*)	printf "Status: 500\n\n%s" "${line#5 }" ;;
	*)	printf "Cha-Control: ConnectionError 1 malformed response\n"
	esac
}