Commits

Olemis Lang committed 36ae6d2

WikiFormatting in protocol provider docs rendered as HTML (looks nice !)

Comments (0)

Files changed (1)

t5437/t5437-protocol_api-r6141.diff

 new file mode 100644
 --- /dev/null
 +++ b/trunk/tracrpc/json_rpc.py
-@@ -0,0 +1,193 @@
+@@ -0,0 +1,194 @@
 +# -*- coding: utf-8 -*-
 +"""
 +License: BSD
 +from trac.perm import PermissionError
 +from trac.util.datefmt import utc
 +from trac.util.text import to_unicode
++from trac.wiki.formatter import wiki_to_html
 +
 +from tracrpc.api import IRPCProtocol, XMLRPCSystem
 +from tracrpc.util import exception_to_unicode
 +
 +class JsonRpcProtocol(Component):
 +    r"""
-+    ==== JSON-RPC example ====
++    === JSON-RPC example ===
 +    
 +    {{{
 +    user: ~ > cat body.json
 +    {"id": 123, "error": null, "result": "= Welcome to....
 +    }}}
 +    
-+    - JSON-RPC has no formalized type system, so a class-hint system is used
++      - JSON-RPC has no formalized type system, so a class-hint system is used
 +      for input and output of non-standard types:
-+      - `{"__jsonclass__": ["datetime", "YYYY-MM-DDTHH:MM:SS"]}` = DateTime (UTC)
-+      - `{"__jsonclass__": ["binary", "<base64-encoded>"]} = Binary
-+    - `"id"` is optional, and any marker value received with a
-+      request is returned with the response.
++        - `{"__jsonclass__": ["datetime", "YYYY-MM-DDTHH:MM:SS"]}` = !DateTime (UTC)
++        - `{"__jsonclass__": ["binary", "<base64-encoded>"]}` = Binary
++      - `"id"` is optional, and any marker value received with a
++        request is returned with the response.
 +    """
 +
 +    implements(IRPCProtocol)
 +        access to RPC using <tt>curl</tt> (with Content-Type and Body for POST request):</p>
 +      <div class="help">
 +        <div py:for="protocol in xmlrpc.protocols">
-+            ${protocol[2]}
++            ${wiki_to_html(context, protocol[2])}
 +        </div>
 +      </div>
 +
 new file mode 100644
 --- /dev/null
 +++ b/trunk/tracrpc/xml_rpc.py
-@@ -0,0 +1,155 @@
+@@ -0,0 +1,145 @@
 +# -*- coding: utf-8 -*-
 +"""
 +License: BSD
 +
 +class XmlRpcProtocol(Component):
 +    r"""
-+    ==== Calling Methods ====
-+    
-+    XML libraries for remote procedure calls and parsing 
-+    exists for all major languages and platforms - use a tested, 
-+    standard library for consistent results.
-+    
-+    The following is an example for illustration only, and shows 
-+    raw access to RPC using curl (with Content-Type and Body for 
-+    POST request):
-+    
-+    ==== XML-RPC example ====
++    === XML-RPC example ===
 +    {{{
 +    user: ~ > cat body.xml
 +    <?xml version="1.0"?>