Difference between revisions of "Help (API)"

From ComputerCraft Wiki
Jump to: navigation, search
(Updated to API overview v2)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
The Help API allows you to mess around with the help files.
 
The Help API allows you to mess around with the help files.
  
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;">
+
{{API table|Help|image=Grid disk.png|2=
<tr><td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;">
+
[[File:Grid_disk.png|24px]]&nbsp;&nbsp;
+
Help (API)
+
</td></tr>
+
  
<tr><td style="width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;">Method Name</td><td style="background: #E0E0E0; padding: .4em; font-weight:bold;">Description</td></tr>
+
{{API table/row
 +
|[[help.path]]()|{{Type|string}} path
 +
|Returns the list of locations the API will look in for help files.
 +
|odd}}
  
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[help.path]]()</td>
+
{{API table/row
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the path the help API has been set to </td></tr>
+
|[[help.setPath]]({{type|string}} path)|{{Type|nil}}
 +
|Sets the list of locations the API will look in for help files.
 +
|}}
  
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[help.setPath]]([[string (type)|string]] path)</td>
+
{{API table/row
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the path of the API to ''path''</td></tr>
+
|[[help.lookup]]({{Type|string}} topic)|{{Type|string}}/{{type|nil}} path
 +
|Returns the path to the file containing the help page for <var>topic</var>, or {{type|nil}} if the topic cannot be found.
 +
|odd}}
  
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[help.lookup]]([[string (type)|string]] topic)</td>
+
{{API table/row
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Looks up the help file for ''topic''</td></tr>
+
|[[help.topics]]()|{{Type|table}} topics
 +
|Returns a list of all available help topics.
 +
|}}
  
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[help.topics]]()</td>
+
{{API table/row
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns a table of valid help topics</td></tr>
+
|[[help.completeTopic]]({{Type|string}} topic prefix)|{{Type|table}} topic suffixes
 +
|Returns a list of suffixes that can be concatenated with the prefix to get valid topic titles. ''Requires CC 1.74 or later.''
 +
|odd}}
  
 
+
}}
</table>
+
  
  
 
[[Category:APIs]]
 
[[Category:APIs]]

Latest revision as of 05:56, 31 July 2015

The Help API allows you to mess around with the help files.

Grid disk.png  Help (API)
Function Return values Description
help.path() string path Returns the list of locations the API will look in for help files.
help.setPath(string path) nil Sets the list of locations the API will look in for help files.
help.lookup(string topic) string/nil path Returns the path to the file containing the help page for topic, or nil if the topic cannot be found.
help.topics() table topics Returns a list of all available help topics.
help.completeTopic(string topic prefix) table topic suffixes Returns a list of suffixes that can be concatenated with the prefix to get valid topic titles. Requires CC 1.74 or later.