Pyolian doc generator: update wrt name API changes

Argh, this has been difficult... hopefully I have done
this right
This commit is contained in:
Davide Andreoli 2018-03-17 11:37:13 +01:00
parent 35316db2f0
commit 2cb896dfab
9 changed files with 51 additions and 51 deletions

View File

@ -1,6 +1,6 @@
<!--(include)-->doc_macros.include<!--(end)-->#!
~~Title: ${alias.full_name}$~~
====== ${alias.full_name}$ (alias) ======
~~Title: ${alias.name}$~~
====== ${alias.name}$ (alias) ======
${BEST_SUMMARY(obj=alias)}$

View File

@ -1,6 +1,6 @@
<!--(include)-->doc_macros.include<!--(end)-->#!
~~Title: ${cls.full_name}$~~
====== ${cls.full_name}$ (${CLS_TYPE}$) ======
~~Title: ${cls.name}$~~
====== ${cls.name}$ (${CLS_TYPE}$) ======
${BEST_SUMMARY(obj=cls)}$

View File

@ -1,6 +1,6 @@
<!--(include)-->doc_macros.include<!--(end)-->#!
~~Title: ${enum.full_name}$~~
====== ${enum.full_name}$ (enum) ======
~~Title: ${enum.name}$~~
====== ${enum.name}$ (enum) ======
${BEST_SUMMARY(obj=enum)}$
@ -23,7 +23,7 @@ ${OBJECT_STATIC_CONTENT(obj=enum, section='fields')}$
<code>
enum {
<!--(for field in enum.enum_fields)-->
${field.name}$: ${field.value.serialize}$,
${field.name}$: ${field.value.serialize}$
<!--(end)-->
}
</code>
@ -35,5 +35,5 @@ typedef enum {
<!--(for field in enum.enum_fields)-->
${field.c_name}$ = ${field.value.serialize}$,
<!--(end)-->
} ${enum.full_name.replace('.', '_')}$;
} ${enum.name.replace('.', '_')}$;
</code>

View File

@ -125,7 +125,7 @@ interface#!
<!--(for n in cls.namespaces)-->
:${n.lower()}$#!
<!--(end)-->
:${cls.name.lower()}$|${cls.full_name}$]]
:${cls.short_name.lower()}$|${cls.name}$]]
<!--(end)-->
#!##############################################################################
#!#### EVENT_LINK(cls, ev) ###################################################
@ -135,9 +135,9 @@ interface#!
<!--(for n in cls.namespaces)-->
:${n.lower()}$#!
<!--(end)-->
:${cls.name.lower()}$#!
:${cls.short_name.lower()}$#!
:event#!
:${ev.name.lower().replace(',','_')}$|${ev.name}$]]
:${ev.short_name.lower().replace(',','_')}$|${ev.name}$]]
<!--(end)-->
#!##############################################################################
#!#### TYPEDECL_LINK(typedecl) ###############################################
@ -147,7 +147,7 @@ interface#!
<!--(for n in typedecl.namespaces)-->
:${n.lower()}$#!
<!--(end)-->
:${typedecl.name.lower()}$|${typedecl.full_name}$]]
:${typedecl.short_name.lower()}$|${typedecl.name}$]]
<!--(end)-->
#!##############################################################################
#!#### TYPE_LINK(type) #######################################################
@ -157,7 +157,7 @@ interface#!
<!--(for n in type.namespaces)-->
:${n.lower()}$#!
<!--(end)-->
:${type.name.lower()}$|${type.full_name}$]]
:${type.short_name.lower()}$|${type.name}$]]
<!--(end)-->
#!##############################################################################
#!#### FUNC_LINK(func) #######################################################
@ -172,7 +172,7 @@ interface#!
<!--(else)-->
:property#!
<!--(end)-->
:${func.name}$|${func.name}$]]
:${func.short_name}$|${func.short_name}$]]
<!--(end)-->
#!##############################################################################
#!#### FUNC_SCOPE(func) ######################################################
@ -253,7 +253,7 @@ interface#!
<!--(if i == 0)-->
^ parameters ^ type ^ description ^
<!--(end)-->
|${PARAM_DIRECTION_TAG(param=par)}$ **${par.name}$**|${par.type.full_name}$ #!
|${PARAM_DIRECTION_TAG(param=par)}$ **${par.name}$**|${par.type.name}$ #!
|${BEST_SUMMARY(obj=par)}$ ${BEST_DESCRIPTION(obj=par)}$|
<!--(else)-->
**This function do not accept any parameter.**
@ -262,7 +262,7 @@ interface#!
<!--(if func.method_return_type)-->
${setvar("obj", "func.return_documentation(Eolian_Function_Type.METHOD)")}$#!
^ return ^ description ^
|**${func.method_return_type.full_name}$**|${BEST_SUMMARY(obj=obj)}$ ${BEST_DESCRIPTION(obj=obj)}$|
|**${func.method_return_type.name}$**|${BEST_SUMMARY(obj=obj)}$ ${BEST_DESCRIPTION(obj=obj)}$|
<!--(else)-->
**This function do not return anything.**
<!--(end)-->
@ -277,14 +277,14 @@ ${setvar("obj", "func.return_documentation(Eolian_Function_Type.METHOD)")}$#!
<!--(if i == 0)-->
^ values ^ type ^ description ^
<!--(end)-->
|**${val.name}$**|${val.type.full_name}$|${BEST_SUMMARY(obj=val)}$|
|**${val.name}$**|${val.type.name}$|${BEST_SUMMARY(obj=val)}$|
<!--(end)-->
<!--(for i, key in enumerate(func.getter_keys or func.setter_keys))-->
<!--(if i == 0)-->
^ keys ^ type ^ description ^
<!--(end)-->
|**${key.name}$**|${key.type.full_name}$|${BEST_SUMMARY(obj=key)}$|
|**${key.name}$**|${key.type.name}$|${BEST_SUMMARY(obj=key)}$|
<!--(end)-->
<!--(end)-->
@ -296,19 +296,19 @@ ${setvar("obj", "func.return_documentation(Eolian_Function_Type.METHOD)")}$#!
(#!
<!--(if impl.is_property)-->
<!--(for i, val in enumerate(impl.function.getter_values or impl.function.setter_values))-->
${', ' if i else ''}$${val.type.name}$#!
${', ' if i else ''}$${val.type.short_name}$#!
<!--(end)-->
<!--(elif impl.is_method)-->
<!--(for i, param in enumerate(impl.function.parameters))-->
${', ' if i else ''}$#!
//${param.type.name}$// ''${param.direction.name.lower()}$'' **${param.name}$**#!
//${param.type.short_name}$// ''${param.direction.name.lower()}$'' **${param.short_name}$**#!
<!--(end)-->
<!--(end)-->
) #!
${IMPLEMENT_TAGS}$ #!
<!--(if impl.is_method)-->
<!--(if impl.function.method_return_type)-->
=> //${impl.function.method_return_type.name}$// #!
=> //${impl.function.method_return_type.short_name}$// #!
<!--(else)-->
=> //None// #!
<!--(end)-->

View File

@ -1,6 +1,6 @@
<!--(include)-->doc_macros.include<!--(end)-->#!
~~Title: ${struct.full_name}$~~
====== ${struct.full_name}$ (struct) ======
~~Title: ${struct.name}$~~
====== ${struct.name}$ (struct) ======
${BEST_SUMMARY(obj=struct)}$
@ -21,7 +21,7 @@ ${OBJECT_STATIC_CONTENT(obj=struct, section='fields')}$
===== Signature =====
<code>
struct ${struct.full_name}$ {
struct ${struct.name}$ {
<!--(for field in struct.struct_fields)-->
${field.name}$: ${field.type.name}$,
<!--(end)-->
@ -31,9 +31,9 @@ struct ${struct.full_name}$ {
===== C Signature =====
<code>
typedef struct _${struct.full_name.replace('.', '_')}$ {
typedef struct _${struct.name.replace('.', '_')}$ {
<!--(for field in struct.struct_fields)-->
${field.name}$: **TODO (issue with Typedecl.c_type need Unit)**,
<!--(end)-->
} ${struct.full_name.replace('.', '_')}$;
} ${struct.name.replace('.', '_')}$;
</code>

View File

@ -41,7 +41,7 @@ _choices = ['start', 'classes', 'enums', 'structs', 'aliases']
parser.add_argument('--step', '-s', metavar='STEP', default=None,
choices=_choices,
help='A single step to run (default to all), '
'valid choises: '+ ', '.join(_choices))
'valid choices: '+ ', '.join(_choices))
args = parser.parse_args()
@ -72,7 +72,7 @@ def page_path_for_object(obj):
path = ['data', 'pages', 'develop', 'api']
for ns in obj.namespaces:
path.append(ns.lower())
output_file = obj.name.lower() + '.txt'
output_file = obj.short_name.lower() + '.txt'
return os.path.join(args.root_path, *path, output_file)
@ -132,30 +132,30 @@ if args.step in ('start', None):
if args.step in ('classes', None):
t = Template('doc_class.template')
for cls in eolian_db.classes:
if cls.full_name.startswith(args.namespace):
if cls.name.startswith(args.namespace):
output_file = page_path_for_object(cls)
t.render(output_file, args.verbose, cls=cls.full_name)
t.render(output_file, args.verbose, cls=cls.name)
# render a page for each Enum
if args.step in ('enums', None):
t = Template('doc_enum.template')
for enum in eolian_db.enums:
if enum.full_name.startswith(args.namespace):
if enum.name.startswith(args.namespace):
output_file = page_path_for_object(enum)
t.render(output_file, args.verbose, enum=enum.full_name)
t.render(output_file, args.verbose, enum=enum.name)
# render a page for each Struct
if args.step in ('structs', None):
t = Template('doc_struct.template')
for struct in eolian_db.structs:
if struct.full_name.startswith(args.namespace):
if struct.name.startswith(args.namespace):
output_file = page_path_for_object(struct)
t.render(output_file, args.verbose, struct=struct.full_name)
t.render(output_file, args.verbose, struct=struct.name)
# render a page for each Alias
if args.step in ('aliases', None):
t = Template('doc_alias.template')
for alias in eolian_db.aliases:
if alias.full_name.startswith(args.namespace):
if alias.name.startswith(args.namespace):
output_file = page_path_for_object(alias)
t.render(output_file, args.verbose, alias=alias.full_name)
t.render(output_file, args.verbose, alias=alias.name)

View File

@ -8,7 +8,7 @@
<!--(for n in cls.namespaces)-->
:${n.lower()}$#!
<!--(end)-->
:${cls.name.lower()}$|${cls.name}$]]
:${cls.short_name.lower()}$|${cls.short_name}$]]
<!--(end)-->
#!##############################################################################
@ -19,7 +19,7 @@
<!--(for n in typedecl.namespaces)-->
:${n.lower()}$#!
<!--(end)-->
:${typedecl.name.lower()}$|${typedecl.name}$]]
:${typedecl.short_name.lower()}$|${typedecl.short_name}$]]
<!--(end)-->
#!##############################################################################

View File

@ -1,12 +1,12 @@
================================================================================
Class: ${cls.full_name}$
Class: ${cls.name}$ (${cls.short_name}$)
================================================================================
Class type: ${cls.type}$
Base Class: ${cls.base_class.full_name if cls.base_class else None}$
Inherits: ${', '.join([i.full_name for i in cls.inherits])}$
Hierarchy: ${' => '.join([i.full_name for i in cls.hierarchy])}$
InheritsFull: ${', '.join([i.full_name for i in cls.inherits_full])}$
Base Class: ${cls.base_class.name if cls.base_class else None}$
Inherits: ${', '.join([i.name for i in cls.inherits])}$
Hierarchy: ${' => '.join([i.name for i in cls.hierarchy])}$
InheritsFull: ${', '.join([i.name for i in cls.inherits_full])}$
Namespace: ${cls.namespace}$
Namespaces: ${list(cls.namespaces)}$
File: ${cls.file}$
@ -40,7 +40,7 @@ Properties:
Implements:
===========
<!--(for i in cls.implements)-->
* ${i.full_name}$
* ${i.name}$
<!--(else)-->
no implements available
<!--(end)-->

View File

@ -6,7 +6,7 @@ Namespace: ${namespace.name}$ ${namespace.namespaces}$
Regular Classes:
================
<!--(for cls in namespace.regulars)-->
* ${cls.full_name}$
* ${cls.name}$
<!--(else)-->
no classes available
<!--(end)-->
@ -14,7 +14,7 @@ Regular Classes:
Abstract Classes:
================
<!--(for cls in namespace.abstracts)-->
* ${cls.full_name}$
* ${cls.name}$
<!--(else)-->
no classes available
<!--(end)-->
@ -22,7 +22,7 @@ Abstract Classes:
Mixins:
=======
<!--(for cls in namespace.mixins)-->
* ${cls.full_name}$
* ${cls.name}$
<!--(else)-->
no classes available
<!--(end)-->
@ -30,7 +30,7 @@ Mixins:
Interfaces:
===========
<!--(for cls in namespace.interfaces)-->
* ${cls.full_name}$
* ${cls.name}$
<!--(else)-->
no classes available
<!--(end)-->
@ -38,7 +38,7 @@ Interfaces:
Aliases:
========
<!--(for typedecl in namespace.aliases)-->
* ${typedecl.full_name}$
* ${typedecl.name}$
<!--(else)-->
no alias available
<!--(end)-->
@ -46,7 +46,7 @@ Aliases:
Structs:
========
<!--(for typedecl in namespace.structs)-->
* ${typedecl.full_name}$
* ${typedecl.name}$
<!--(for field in typedecl.struct_fields)-->
${field.type.name}$ ${field.name}$
<!--(end)-->
@ -57,7 +57,7 @@ Structs:
Enums:
======
<!--(for typedecl in namespace.enums)-->
* ${typedecl.full_name}$
* ${typedecl.name}$
<!--(for field in typedecl.enum_fields)-->
${field.c_name}$ = ${field.value.serialize}$
<!--(end)-->