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:
@@ -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