diff --git a/i2p2www/formatters.py b/i2p2www/formatters.py index fd8006d5..2f03f5b5 100644 --- a/i2p2www/formatters.py +++ b/i2p2www/formatters.py @@ -37,6 +37,7 @@ _escape_html_table = { kinds = { 't': 'type', 's': 'struct', + 'm': 'msg', } def escape_html(text, table=_escape_html_table): @@ -715,6 +716,10 @@ class I2PHtmlFormatter(Formatter): if tagsfile and ttype in Token.Name.Class: filename, kind = self._lookup_ctag(value) + # Handle message types + if not kind and value.endswith('Message'): + value = value[:-7] + filename, kind = self._lookup_ctag(value) if kind: base, filename = os.path.split(filename) if base: diff --git a/i2p2www/lexers.py b/i2p2www/lexers.py index e369a0d4..9e1220fb 100644 --- a/i2p2www/lexers.py +++ b/i2p2www/lexers.py @@ -12,14 +12,16 @@ class DataSpecLexer(RegexLexer): (r'(\s+)([\+|])', bygroups(Text, Text), 'content'), (r'(\s*)(~)', bygroups(Text, Generic.Strong), 'content'), (r'(\s*)([\w=;]+)(\s[\w=;]+)*(\s)(::)(\s)', bygroups(Text, Name.Tag, Name.Tag, Text, Operator, Text)), - (r'(\s*)`((?:[A-Z][a-z]+)(?:[A-Z][a-z]*)*)`', bygroups(Text, Name.Class)), + (r'(\s*)`((?:[A-Z][a-z0-9]+)(?:[A-Z][a-z0-9]*)*)(\.)(.*)`', bygroups(Text, Name.Class, Operator, Name.Tag)), + (r'(\s*)`((?:[A-Z][a-z0-9]+)(?:[A-Z][a-z0-9]*)*)`', bygroups(Text, Name.Class)), (r'(\s*)([A-Z]{2,})', bygroups(Text, Name.Constant)), (r'(\s*)([\[\]])', bygroups(Text, Punctuation)), (r'(\s*)(\$\w+)', bygroups(Text, Name.Tag)), + (r'(\s*)(0x[0-9a-f]+)', bygroups(Text, Number.Hex)), (r'(\s*)([0-9]+)(\+)?', bygroups(Text, Number, Punctuation)), (r'(-)([0-9]+)', bygroups(Punctuation, Number)), - (r'(\s*)(->|<=|>=|\*)', bygroups(Text, Operator)), - (r'(\s*)([\w()-=\'<>]+)', bygroups(Text, Comment)), + (r'(\s*)(->|<=|>=|\*|\^)', bygroups(Text, Operator)), + (r'(\s*)([\w()-=\'<>?]+)', bygroups(Text, Comment)), ], 'boundary': [ (r'-{3,}\+$', Text, '#pop'), diff --git a/i2p2www/pages/site/docs/api/i2pcontrol.html b/i2p2www/pages/site/docs/api/i2pcontrol.html index a45e0f3b..7b3ae3df 100644 --- a/i2p2www/pages/site/docs/api/i2pcontrol.html +++ b/i2p2www/pages/site/docs/api/i2pcontrol.html @@ -16,12 +16,30 @@ Parameters are only provided in a named way (maps). {%- endtrans %}

{% trans %}JSON-RPC 2 format{% endtrans %}

-
 {{ _('Request:') }}
-{"id":"id", "method":"Method-name","params":{"Param-key-1":"param-value-1", "Param-key-2":"param-value-2", "Token":"**actual token**"}, "jsonrpc":"2.0"}
+{% highlight lang='json' %}
+{
+  "id": "id",
+  "method": "Method-name",
+  "params": {
+    "Param-key-1": "param-value-1",
+    "Param-key-2": "param-value-2",
+    "Token": "**actual token**"
+  },
+  "jsonrpc": "2.0"
+}
+{% endhighlight %}
 {{ _('Response:') }}
-{"id":"id","result":{"Result-key-1":"result-value-1","Result-key-2":"result-value-2"},"jsonrpc":"2.0"}
-
+{% highlight lang='json' %} +{ + "id": "id", + "result": { + "Result-key-1": "result-value-1", + "Result-key-2": "result-value-2" + }, + "jsonrpc": "2.0" +} +{% endhighlight %}