json: implement {help} template
authorGregory Szorc <gregory.szorc@gmail.com>
Wed, 01 Apr 2015 22:24:03 -0700
changeset 24591 517f3e190a5d
parent 24590 0bb733dfcabe
child 24592 d7cf8102bf09
json: implement {help} template We should consider add HTML rendering of the RST into the response as a follow-up. I attempted to do this, but there was an empty array returned by the rstdoc() template function. Not sure what's going on. Will deal with it later.
mercurial/templates/json/map
tests/test-hgweb-json.t
--- a/mercurial/templates/json/map	Wed Apr 01 22:16:05 2015 -0700
+++ b/mercurial/templates/json/map	Wed Apr 01 22:24:03 2015 -0700
@@ -92,6 +92,9 @@
   "topic": {topic|json},
   "summary": {summary|json}
   }'
-help = '"not yet implemented"'
+help = '\{
+  "topic": {topic|json},
+  "rawdoc": {doc|json}
+  }'
 filenodelink = ''
 filenolink = ''
--- a/tests/test-hgweb-json.t	Wed Apr 01 22:16:05 2015 -0700
+++ b/tests/test-hgweb-json.t	Wed Apr 01 22:24:03 2015 -0700
@@ -1003,4 +1003,7 @@
   $ request json-help/phases
   200 Script output follows
   
-  "not yet implemented"
+  {
+    "rawdoc": "Working with Phases\n*", (glob)
+    "topic": "phases"
+  }