Browse Source

Improve parsing of [method ...] tags

Also improve some code display.
Rémi Verschelde 9 years ago
parent
commit
0f11b322b3
2 changed files with 19 additions and 27 deletions
  1. 17 25
      doc/base/classes.xml
  2. 2 2
      doc/tools/makerst.py

+ 17 - 25
doc/base/classes.xml

@@ -1780,7 +1780,7 @@
 			<argument index="0" name="with" type="AABB">
 			<argument index="0" name="with" type="AABB">
 			</argument>
 			</argument>
 			<description>
 			<description>
-			Return the intersection between two [AABB]s. An empty AABB (size 0,0,0) is returned on failure.
+			Return the intersection between two [AABB]. An empty AABB (size 0,0,0) is returned on failure.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="intersects">
 		<method name="intersects">
@@ -2102,7 +2102,7 @@
 	</brief_description>
 	</brief_description>
 	<description>
 	<description>
 	An Animation resource contains data used to animate everything in the engine. Animations are divided into tracks, and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track.
 	An Animation resource contains data used to animate everything in the engine. Animations are divided into tracks, and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track.
-        Animations are just data containers, and must be added to odes such as an [AnimationPlayer] or [AnimationTreePlayer] to be played back.
+	Animations are just data containers, and must be added to odes such as an [AnimationPlayer] or [AnimationTreePlayer] to be played back.
 	</description>
 	</description>
 	<methods>
 	<methods>
 		<method name="add_track">
 		<method name="add_track">
@@ -5925,7 +5925,7 @@
 			<return type="bool">
 			<return type="bool">
 			</return>
 			</return>
 			<description>
 			<description>
-			Return true of this is the current camera (see [method Camera2D.make_current]).
+			Return true of this is the current camera (see [method make_current]).
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_limit">
 		<method name="set_limit">
@@ -7339,7 +7339,7 @@
 			</argument>
 			</argument>
 			<description>
 			<description>
 			Set the array of points forming the polygon.
 			Set the array of points forming the polygon.
-			When editing the point list via the editor, depending on [method get_build_mode], it has to be a list of points (for [code]build_mode[/code]=0), or a list of lines (for [code]build_mode[/code]=1). In the second case, the even elements of the array define the start point of the line, and the odd elements the end point.
+			When editing the point list via the editor, depending on [method get_build_mode], it has to be a list of points (for [code]build_mode==0[/code]), or a list of lines (for [code]build_mode==1[/code]). In the second case, the even elements of the array define the start point of the line, and the odd elements the end point.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="get_polygon" qualifiers="const">
 		<method name="get_polygon" qualifiers="const">
@@ -7353,14 +7353,14 @@
 			<argument index="0" name="build_mode" type="int">
 			<argument index="0" name="build_mode" type="int">
 			</argument>
 			</argument>
 			<description>
 			<description>
-			Set whether the polygon is to be a [ConvexPolygon2D] ([code]build_mode[/code]=0), or a [ConcavePolygon2D] ([code]build_mode[/code]=1).
+			Set whether the polygon is to be a [ConvexPolygon2D] ([code]build_mode==0[/code]), or a [ConcavePolygon2D] ([code]build_mode==1[/code]).
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="get_build_mode" qualifiers="const">
 		<method name="get_build_mode" qualifiers="const">
 			<return type="int">
 			<return type="int">
 			</return>
 			</return>
 			<description>
 			<description>
-			Return whether the polygon is a [ConvexPolygon2D] ([code]build_mode[/code]=0), or a [ConcavePolygon2D] ([code]build_mode[/code]=1).
+			Return whether the polygon is a [ConvexPolygon2D] ([code]build_mode==0[/code]), or a [ConcavePolygon2D] ([code]build_mode==1[/code]).
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="set_trigger">
 		<method name="set_trigger">
@@ -12909,19 +12909,13 @@ verify_host will check the SSL identity of the host if set to true.
 			<argument index="3" name="body" type="String" default="&quot;&quot;">
 			<argument index="3" name="body" type="String" default="&quot;&quot;">
 			</argument>
 			</argument>
 			<description>
 			<description>
-			Sends a request to the connected host. The url is the what is normally behind the hostname, i.e:
-http://somehost.com/index.php
-url would be "index.php"
-
-Headers are HTTP request headers
-
-To create a POST request with query strings to push to the server, do:
-var fields = {"username" : "user",
-                       "password" : "pass"}
-var queryString = httpClient.query_string_from_dict(fields)
-var headers = ["Content-Type: application/x-www-form-urlencoded",
-		   	             "Content-Length: " + str(queryString.length())]
-var result = httpClient.request(httpClient.METHOD_POST, "index.php", headers, queryString)
+			Sends a request to the connected host. The url is what is normally behind the hostname, i.e. in [code]http://somehost.com/index.php[/code], url would be "index.php".
+			Headers are HTTP request headers.
+			To create a POST request with query strings to push to the server, do::
+			    var fields = {"username" : "user", "password" : "pass"}
+			    var queryString = httpClient.query_string_from_dict(fields)
+			    var headers = ["Content-Type: application/x-www-form-urlencoded", "Content-Length: " + str(queryString.length())]
+			    var result = httpClient.request(httpClient.METHOD_POST, "index.php", headers, queryString)
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="send_body_text">
 		<method name="send_body_text">
@@ -13028,12 +13022,10 @@ var result = httpClient.request(httpClient.METHOD_POST, "index.php", headers, qu
 			<argument index="0" name="fields" type="Dictionary">
 			<argument index="0" name="fields" type="Dictionary">
 			</argument>
 			</argument>
 			<description>
 			<description>
-			Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary.
-
-var fields = {"username": "user", "password": "pass"}
-String queryString = httpClient.query_string_from_dict(fields)
-
-returns:= "username=user&amp;password=pass"
+			Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary, e.g.::
+			    var fields = {"username": "user", "password": "pass"}
+			    String queryString = httpClient.query_string_from_dict(fields)
+			    returns:= "username=user&amp;password=pass"
 			</description>
 			</description>
 		</method>
 		</method>
 	</methods>
 	</methods>

+ 2 - 2
doc/tools/makerst.py

@@ -166,9 +166,9 @@ def rstize_text(text,cclass):
 
 
 				if param.find('.') != -1:
 				if param.find('.') != -1:
 					(class_param, method_param) = param.split('.')
 					(class_param, method_param) = param.split('.')
-					tag_text = ':ref:`'+class_param+'.'+method_param+'<' + class_param.lower() + '_' + method_param + '>`'
+					tag_text = ':ref:`'+class_param+'.'+method_param+'<class_' + class_param + '_' + method_param + '>`'
 				else:
 				else:
-					tag_text = ':ref:`' + param + '<' + cclass +"_"+ param + '>`'
+					tag_text = ':ref:`' + param + '<class_' + cclass +"_"+ param + '>`'
 			elif cmd.find('image=') == 0:
 			elif cmd.find('image=') == 0:
 				tag_text = "" #'![](' + cmd[6:] + ')'
 				tag_text = "" #'![](' + cmd[6:] + ')'
 			elif cmd.find('url=') == 0:
 			elif cmd.find('url=') == 0: