diff --git a/BattleGroundMethods.h b/BattleGroundMethods.h index 83dc33f..f70184d 100644 --- a/BattleGroundMethods.h +++ b/BattleGroundMethods.h @@ -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) { diff --git a/CreatureMethods.h b/CreatureMethods.h index 266fa94..1c33266 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -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) { diff --git a/PlayerMethods.h b/PlayerMethods.h index 25cc9ff..e9d728f 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -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) { diff --git a/UnitMethods.h b/UnitMethods.h index df6cf58..116cd68 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -1298,7 +1298,7 @@ namespace LuaUnit * }; * * - * @return MovementGeneratorType movementType + * @return [MovementGeneratorType] movementType */ int GetMovementType(Eluna* /*E*/, lua_State* L, Unit* unit) { diff --git a/docs/ElunaDoc/__main__.py b/docs/ElunaDoc/__main__.py index 85cbdba..f04d73c 100644 --- a/docs/ElunaDoc/__main__.py +++ b/docs/ElunaDoc/__main__.py @@ -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 diff --git a/docs/ElunaDoc/parser.py b/docs/ElunaDoc/parser.py index 7b92ac6..3871f2c 100644 --- a/docs/ElunaDoc/parser.py +++ b/docs/ElunaDoc/parser.py @@ -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 += '

Valid numbers: integers from {0} to {1}.

'.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.""" diff --git a/docs/ElunaDoc/static/main.js b/docs/ElunaDoc/static/main.js index 1e85037..7e3720c 100644 --- a/docs/ElunaDoc/static/main.js +++ b/docs/ElunaDoc/static/main.js @@ -678,7 +678,7 @@ if (rootPath == '../') { var sidebar = $('.sidebar'); var div = $('
').attr('class', 'block crate'); - div.append($('

').text('Crates')); + div.append($('

').text('All Classes')); var crates = []; for (var crate in rawSearchIndex) { diff --git a/docs/ElunaDoc/templates/_base.html b/docs/ElunaDoc/templates/_base.html index e3fdc3c..a0eb7ff 100644 --- a/docs/ElunaDoc/templates/_base.html +++ b/docs/ElunaDoc/templates/_base.html @@ -99,6 +99,7 @@ +
Generated on {{ currdate }}
©2015 - Eluna Lua Engine
diff --git a/docs/ElunaDoc/templates/class.html b/docs/ElunaDoc/templates/class.html index 3999ca2..93ce464 100644 --- a/docs/ElunaDoc/templates/class.html +++ b/docs/ElunaDoc/templates/class.html @@ -16,6 +16,10 @@ {%- endblock %} +{% block sidebar %} +{% endblock %} + + {% block content %} {{ current_class.description|parse_links }}