mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Enhance documentation
fix [] errors in types fix int not set as basetype add generated date to bottom of page Rename Crates to All Classes and remove it from the class view
This commit is contained in:
@@ -65,7 +65,7 @@ namespace LuaBattleGround
|
||||
/**
|
||||
* Returns the bracket ID of the specific [BattleGround].
|
||||
*
|
||||
* @return BattleGroundBracketId bracketId
|
||||
* @return [BattleGroundBracketId] bracketId
|
||||
*/
|
||||
int GetBracketId(Eluna* /*E*/, lua_State* L, BattleGround* bg)
|
||||
{
|
||||
@@ -127,7 +127,7 @@ namespace LuaBattleGround
|
||||
/**
|
||||
* Returns the type ID of the [BattleGround].
|
||||
*
|
||||
* @return BattleGroundTypeId typeId
|
||||
* @return [BattleGroundTypeId] typeId
|
||||
*/
|
||||
int GetTypeId(Eluna* /*E*/, lua_State* L, BattleGround* bg)
|
||||
{
|
||||
@@ -204,7 +204,7 @@ namespace LuaBattleGround
|
||||
/**
|
||||
* Returns the winning team of the specific [BattleGround].
|
||||
*
|
||||
* @return Team team
|
||||
* @return [Team] team
|
||||
*/
|
||||
int GetWinner(Eluna* /*E*/, lua_State* L, BattleGround* bg)
|
||||
{
|
||||
@@ -215,7 +215,7 @@ namespace LuaBattleGround
|
||||
/**
|
||||
* Returns the status of the specific [BattleGround].
|
||||
*
|
||||
* @return BattleGroundStatus status
|
||||
* @return [BattleGroundStatus] status
|
||||
*/
|
||||
int GetStatus(Eluna* /*E*/, lua_State* L, BattleGround* bg)
|
||||
{
|
||||
|
||||
@@ -86,8 +86,8 @@ namespace LuaCreature
|
||||
* Returns `true` if the [Creature] can assist `friend` in combat against `enemy`,
|
||||
* and returns `false` otherwise.
|
||||
*
|
||||
* @param Unit friend : the Unit we will be assisting
|
||||
* @param Unit enemy : the Unit that we would attack if we assist `friend`
|
||||
* @param [Unit] friend : the Unit we will be assisting
|
||||
* @param [Unit] enemy : the Unit that we would attack if we assist `friend`
|
||||
* @param bool checkFaction = true : if `true`, the [Creature] must be the same faction as `friend` to assist
|
||||
* @return bool canAssist
|
||||
*/
|
||||
@@ -440,7 +440,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Returns the default movement type for this [Creature].
|
||||
*
|
||||
* @return MovementGeneratorType defaultMovementType
|
||||
* @return [MovementGeneratorType] defaultMovementType
|
||||
*/
|
||||
int GetDefaultMovementType(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
{
|
||||
@@ -451,7 +451,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Returns the aggro range of the [Creature] for `target`.
|
||||
*
|
||||
* @param Unit target
|
||||
* @param [Unit] target
|
||||
* @return float aggroRange
|
||||
*/
|
||||
int GetAggroRange(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
@@ -474,7 +474,7 @@ namespace LuaCreature
|
||||
* If this is smaller than the minimum aggro range set in the config file,
|
||||
* that is used as the aggro range instead.
|
||||
*
|
||||
* @param Unit target
|
||||
* @param [Unit] target
|
||||
* @return float attackDistance
|
||||
*/
|
||||
int GetAttackDistance(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
@@ -488,7 +488,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Returns the [Group] that can loot this [Creature].
|
||||
*
|
||||
* @return Group lootRecipientGroup : the group or `nil`
|
||||
* @return [Group] lootRecipientGroup : the group or `nil`
|
||||
*/
|
||||
int GetLootRecipientGroup(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
{
|
||||
@@ -503,7 +503,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Returns the [Player] that can loot this [Creature].
|
||||
*
|
||||
* @return Player lootRecipient : the player or `nil`
|
||||
* @return [Player] lootRecipient : the player or `nil`
|
||||
*/
|
||||
int GetLootRecipient(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
{
|
||||
@@ -793,7 +793,7 @@ namespace LuaCreature
|
||||
* These are used to control whether the NPC is a vendor, can repair items,
|
||||
* can give quests, etc.
|
||||
*
|
||||
* @return NPCFlags npcFlags
|
||||
* @return [NPCFlags] npcFlags
|
||||
*/
|
||||
int GetNPCFlags(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
{
|
||||
@@ -827,7 +827,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Sets the [Creature]'s NPC flags to `flags`.
|
||||
*
|
||||
* @param NPCFlags flags
|
||||
* @param [NPCFlags] flags
|
||||
*/
|
||||
int SetNPCFlags(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
{
|
||||
@@ -868,7 +868,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Sets the [Creature]'s death state to `deathState`.
|
||||
*
|
||||
* @param DeathState deathState
|
||||
* @param [DeathState] deathState
|
||||
*/
|
||||
int SetDeathState(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
{
|
||||
@@ -998,7 +998,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Sets the default movement type of the [Creature].
|
||||
*
|
||||
* @param MovementGeneratorType type
|
||||
* @param [MovementGeneratorType] type
|
||||
*/
|
||||
int SetDefaultMovementType(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
{
|
||||
@@ -1144,7 +1144,7 @@ namespace LuaCreature
|
||||
/**
|
||||
* Make the [Creature] attack `target`.
|
||||
*
|
||||
* @param Unit target
|
||||
* @param [Unit] target
|
||||
*/
|
||||
int AttackStart(Eluna* /*E*/, lua_State* L, Creature* creature)
|
||||
{
|
||||
|
||||
@@ -886,7 +886,7 @@ namespace LuaPlayer
|
||||
/**
|
||||
* Returns the [Player]s current [BattleGround] type ID
|
||||
*
|
||||
* @return BattleGroundTypeId typeId
|
||||
* @return [BattleGroundTypeId] typeId
|
||||
*/
|
||||
int GetBattlegroundTypeId(Eluna* /*E*/, lua_State* L, Player* player)
|
||||
{
|
||||
@@ -917,7 +917,7 @@ namespace LuaPlayer
|
||||
* Returns the [Player]s reputation rank of faction specified
|
||||
*
|
||||
* @param uint32 faction
|
||||
* @return ReputationRank rank
|
||||
* @return [ReputationRank] rank
|
||||
*/
|
||||
int GetReputationRank(Eluna* /*E*/, lua_State* L, Player* player)
|
||||
{
|
||||
@@ -1117,7 +1117,7 @@ namespace LuaPlayer
|
||||
* Returns the status of the [Player]s [Quest] specified by entry ID
|
||||
*
|
||||
* @param uint32 questId
|
||||
* @return QuestStatus questStatus
|
||||
* @return [QuestStatus] questStatus
|
||||
*/
|
||||
int GetQuestStatus(Eluna* /*E*/, lua_State* L, Player* player)
|
||||
{
|
||||
@@ -1154,7 +1154,7 @@ namespace LuaPlayer
|
||||
* Returns the quest level of the [Player]s [Quest] specified by object
|
||||
*
|
||||
* @param uint32 questId
|
||||
* @return QuestStatus questRewardStatus
|
||||
* @return [QuestStatus] questRewardStatus
|
||||
*/
|
||||
int GetQuestLevel(Eluna* /*E*/, lua_State* L, Player* player)
|
||||
{
|
||||
@@ -1188,7 +1188,7 @@ namespace LuaPlayer
|
||||
/**
|
||||
* Returns the [Player]s resting type
|
||||
*
|
||||
* @return RestType restType
|
||||
* @return [RestType] restType
|
||||
*/
|
||||
int GetRestType(Eluna* /*E*/, lua_State* L, Player* player)
|
||||
{
|
||||
@@ -1309,7 +1309,7 @@ namespace LuaPlayer
|
||||
/**
|
||||
* Returns the [Player]s GM Rank
|
||||
*
|
||||
* @return AccountTypes gmRank
|
||||
* @return [AccountTypes] gmRank
|
||||
*/
|
||||
int GetGMRank(Eluna* /*E*/, lua_State* L, Player* player)
|
||||
{
|
||||
@@ -1342,7 +1342,7 @@ namespace LuaPlayer
|
||||
/**
|
||||
* Returns the [Player]s current team ID
|
||||
*
|
||||
* @return PvpTeamIndex teamId
|
||||
* @return [PvpTeamIndex] teamId
|
||||
*/
|
||||
int GetTeam(Eluna* /*E*/, lua_State* L, Player* player)
|
||||
{
|
||||
@@ -1480,7 +1480,7 @@ namespace LuaPlayer
|
||||
/**
|
||||
* Returns the [Player]s game client locale
|
||||
*
|
||||
* @return LocaleConstant locale
|
||||
* @return [LocaleConstant] locale
|
||||
*/
|
||||
int GetDbcLocale(Eluna* /*E*/, lua_State* L, Player* player)
|
||||
{
|
||||
|
||||
@@ -1298,7 +1298,7 @@ namespace LuaUnit
|
||||
* };
|
||||
* </pre>
|
||||
*
|
||||
* @return MovementGeneratorType movementType
|
||||
* @return [MovementGeneratorType] movementType
|
||||
*/
|
||||
int GetMovementType(Eluna* /*E*/, lua_State* L, Unit* unit)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ from jinja2 import Environment, FileSystemLoader
|
||||
from typedecorator import params, returns
|
||||
from parser import ClassParser, MethodDoc
|
||||
import glob
|
||||
import time
|
||||
|
||||
|
||||
@returns([(str, FileType)])
|
||||
@@ -39,9 +40,10 @@ def make_renderer(template_path, link_parser_factory):
|
||||
template = env.get_template(template_name)
|
||||
static = make_static(level)
|
||||
root = make_root(level)
|
||||
currdate = time.strftime("%d/%m/%Y")
|
||||
|
||||
with open('build/' + output_path, 'w') as out:
|
||||
out.write(template.render(level=level, static=static, root=root, **kwargs))
|
||||
out.write(template.render(level=level, static=static, root=root, currdate=currdate, **kwargs))
|
||||
|
||||
return inner
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class ParameterDoc(object):
|
||||
self.description = ''
|
||||
|
||||
# If the data type is a C++ number, convert to Lua number and add range info to description.
|
||||
if self.data_type in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32']:
|
||||
if self.data_type in ['float', 'double', 'int', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32']:
|
||||
range = ParameterDoc.valid_ranges[self.data_type]
|
||||
if range:
|
||||
self.description += '<p><em>Valid numbers</em>: integers from {0} to {1}.</p>'.format(range[0], range[1])
|
||||
@@ -57,6 +57,9 @@ class ParameterDoc(object):
|
||||
elif self.data_type == 'int64' or self.data_type == 'uint64':
|
||||
self.data_type = '[' + self.data_type + ']'
|
||||
|
||||
elif not self.data_type in ['nil', 'boolean', 'number', 'string', 'table', 'function', '...'] and self.data_type[:1] != '[':
|
||||
print "Missing [] from data type `" + self.data_type + "`"
|
||||
|
||||
|
||||
class MethodDoc(object):
|
||||
"""The documentation data of an Eluna method."""
|
||||
|
||||
@@ -678,7 +678,7 @@
|
||||
if (rootPath == '../') {
|
||||
var sidebar = $('.sidebar');
|
||||
var div = $('<div>').attr('class', 'block crate');
|
||||
div.append($('<h2>').text('Crates'));
|
||||
div.append($('<h2>').text('All Classes'));
|
||||
|
||||
var crates = [];
|
||||
for (var crate in rawSearchIndex) {
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
<script src="{{ static('jquery.js') }}"></script>
|
||||
<script src="{{ static('main.js') }}"></script>
|
||||
<script async src="{{ root('search-index.js') }}"></script>
|
||||
<center>Generated on {{ currdate }}</center>
|
||||
<center>©2015 - Eluna Lua Engine</center>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
{%- endblock %}
|
||||
|
||||
|
||||
{% block sidebar %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{{ current_class.description|parse_links }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user