forked from enlightenment/efl
pyolian: improve the doc generation
This commit is contained in:
parent
a32735e9a7
commit
94b6ad8448
|
@ -2,51 +2,70 @@
|
||||||
~~Title: EFL Reference~~
|
~~Title: EFL Reference~~
|
||||||
{{page>:develop:api-include:reference:general&nouser&nolink&nodate}}
|
{{page>:develop:api-include:reference:general&nouser&nolink&nodate}}
|
||||||
|
|
||||||
<!--(for ns in nspaces)-->
|
====== Python-EFL documentation preview ======
|
||||||
<!--(if ns.name.startswith('Efl'))-->
|
This is just a work in progress for the future development of the
|
||||||
===== ${ns.name}$ =====
|
Python-EFL Unified API.
|
||||||
|
|
||||||
<!--(for i, cls in enumerate(ns.regulars))-->
|
Pratically there is nothing python related currently in this documentation,
|
||||||
<!--(if i == 0)-->
|
so it can be considered valid for all languages.
|
||||||
^ Classes ^^
|
|
||||||
<!--(end)-->
|
|
||||||
| ${CLS_LINK}$ | ${BEST_SUMMARY(obj=cls)}$ |
|
^** Some numbers just for information **^^
|
||||||
<!--(end)-->
|
<!--(for label, val in totals)-->
|
||||||
#!
|
| ${label}$ | **${val}$** |
|
||||||
<!--(for i, cls in enumerate(ns.interfaces))-->
|
<!--(end)-->
|
||||||
<!--(if i == 0)-->
|
|
||||||
^ Interfaces ^^
|
|
||||||
<!--(end)-->
|
<!--(for ns in nspaces)-->
|
||||||
| ${CLS_LINK}$ | ${BEST_SUMMARY(obj=cls)}$ |
|
===== ${ns.name}$ (namespace) =====
|
||||||
<!--(end)-->
|
|
||||||
#!
|
<!--(for i, cls in enumerate(sorted(ns.regulars)))-->
|
||||||
<!--(for i, cls in enumerate(ns.mixins))-->
|
<!--(if i == 0)-->
|
||||||
<!--(if i == 0)-->
|
^ Regular Classes ^^
|
||||||
^ Mixins ^^
|
<!--(end)-->
|
||||||
<!--(end)-->
|
| ${CLS_LINK}$ | ${BEST_SUMMARY(obj=cls)}$ |
|
||||||
| ${CLS_LINK}$ | ${BEST_SUMMARY(obj=cls)}$ |
|
<!--(end)-->
|
||||||
<!--(end)-->
|
#!
|
||||||
#!
|
<!--(for i, cls in enumerate(sorted(ns.abstracts)))-->
|
||||||
<!--(for i, typedecl in enumerate(ns.aliases))-->
|
<!--(if i == 0)-->
|
||||||
<!--(if i == 0)-->
|
^ Abstract Classes ^^
|
||||||
^ Aliases ^^
|
<!--(end)-->
|
||||||
<!--(end)-->
|
| ${CLS_LINK}$ | ${BEST_SUMMARY(obj=cls)}$ |
|
||||||
| ${TYPEDECL_LINK}$ | ${BEST_SUMMARY(obj=typedecl)}$ |
|
<!--(end)-->
|
||||||
<!--(end)-->
|
#!
|
||||||
#!
|
<!--(for i, cls in enumerate(sorted(ns.mixins)))-->
|
||||||
<!--(for i, typedecl in enumerate(ns.structs))-->
|
<!--(if i == 0)-->
|
||||||
<!--(if i == 0)-->
|
^ Mixins ^^
|
||||||
^ Structures ^^
|
<!--(end)-->
|
||||||
<!--(end)-->
|
| ${CLS_LINK}$ | ${BEST_SUMMARY(obj=cls)}$ |
|
||||||
| ${TYPEDECL_LINK}$ | ${BEST_SUMMARY(obj=typedecl)}$ |
|
<!--(end)-->
|
||||||
<!--(end)-->
|
#!
|
||||||
#!
|
<!--(for i, cls in enumerate(sorted(ns.interfaces)))-->
|
||||||
<!--(for i, typedecl in enumerate(ns.enums))-->
|
<!--(if i == 0)-->
|
||||||
<!--(if i == 0)-->
|
^ Interfaces ^^
|
||||||
^ Enumerations ^^
|
<!--(end)-->
|
||||||
<!--(end)-->
|
| ${CLS_LINK}$ | ${BEST_SUMMARY(obj=cls)}$ |
|
||||||
| ${TYPEDECL_LINK}$ | ${BEST_SUMMARY(obj=typedecl)}$ |
|
<!--(end)-->
|
||||||
<!--(end)-->
|
#!
|
||||||
|
<!--(for i, typedecl in enumerate(sorted(ns.aliases)))-->
|
||||||
|
<!--(if i == 0)-->
|
||||||
|
^ Aliases ^^
|
||||||
|
<!--(end)-->
|
||||||
|
| ${TYPEDECL_LINK}$ | ${BEST_SUMMARY(obj=typedecl)}$ |
|
||||||
|
<!--(end)-->
|
||||||
|
#!
|
||||||
|
<!--(for i, typedecl in enumerate(sorted(ns.structs)))-->
|
||||||
|
<!--(if i == 0)-->
|
||||||
|
^ Structures ^^
|
||||||
|
<!--(end)-->
|
||||||
|
| ${TYPEDECL_LINK}$ | ${BEST_SUMMARY(obj=typedecl)}$ |
|
||||||
|
<!--(end)-->
|
||||||
|
#!
|
||||||
|
<!--(for i, typedecl in enumerate(sorted(ns.enums)))-->
|
||||||
|
<!--(if i == 0)-->
|
||||||
|
^ Enumerations ^^
|
||||||
|
<!--(end)-->
|
||||||
|
| ${TYPEDECL_LINK}$ | ${BEST_SUMMARY(obj=typedecl)}$ |
|
||||||
|
<!--(end)-->
|
||||||
|
|
||||||
<!--(end)-->
|
|
||||||
<!--(end)-->
|
<!--(end)-->
|
||||||
|
|
|
@ -79,8 +79,34 @@ def page_path_for_object(obj):
|
||||||
# render the main start.txt page
|
# render the main start.txt page
|
||||||
if args.step in ('start', None):
|
if args.step in ('start', None):
|
||||||
t = Template('doc_start.template')
|
t = Template('doc_start.template')
|
||||||
|
|
||||||
|
nspaces = [ ns for ns in eolian_db.all_namespaces
|
||||||
|
if ns.name.startswith(args.namespace) ]
|
||||||
|
|
||||||
|
tot_classes = tot_regulars = tot_abstracts = tot_mixins = tot_ifaces = 0
|
||||||
|
for ns in nspaces:
|
||||||
|
for cls in ns.classes:
|
||||||
|
tot_classes += 1
|
||||||
|
if cls.type == eolian.Eolian_Class_Type.REGULAR:
|
||||||
|
tot_regulars += 1
|
||||||
|
elif cls.type == eolian.Eolian_Class_Type.ABSTRACT:
|
||||||
|
tot_abstracts += 1
|
||||||
|
elif cls.type == eolian.Eolian_Class_Type.MIXIN:
|
||||||
|
tot_mixins += 1
|
||||||
|
elif cls.type == eolian.Eolian_Class_Type.INTERFACE:
|
||||||
|
tot_ifaces += 1
|
||||||
|
totals = [
|
||||||
|
('Namespaces', len(nspaces)),
|
||||||
|
('ALL Classes', tot_classes),
|
||||||
|
('Regular classes', tot_regulars),
|
||||||
|
('Abstract classes', tot_abstracts),
|
||||||
|
('Mixins', tot_mixins),
|
||||||
|
('Interfaces', tot_ifaces),
|
||||||
|
]
|
||||||
|
|
||||||
output_file = os.path.join(args.root_path,'data','pages','develop','api','start.txt')
|
output_file = os.path.join(args.root_path,'data','pages','develop','api','start.txt')
|
||||||
t.render(output_file, args.verbose, nspaces=eolian_db.all_namespaces)
|
t.render(output_file, args.verbose, nspaces=nspaces, totals=totals)
|
||||||
|
|
||||||
|
|
||||||
# render a page for each Class
|
# render a page for each Class
|
||||||
if args.step in ('classes', None):
|
if args.step in ('classes', None):
|
||||||
|
|
|
@ -318,6 +318,13 @@ class EolianBaseObject(object):
|
||||||
return self.name == other
|
return self.name == other
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def __gt__(self, other):
|
||||||
|
if isinstance(other, EolianBaseObject):
|
||||||
|
if hasattr(self, 'full_name'):
|
||||||
|
return self.full_name > other.full_name
|
||||||
|
elif hasattr(self, 'name'):
|
||||||
|
return self.name > other.name
|
||||||
|
|
||||||
def __hash__(self):
|
def __hash__(self):
|
||||||
return self._obj.value
|
return self._obj.value
|
||||||
|
|
||||||
|
@ -479,7 +486,11 @@ class Namespace(object):
|
||||||
return "<eolian.Namespace '{0._name}'>".format(self)
|
return "<eolian.Namespace '{0._name}'>".format(self)
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return self.name == other.name
|
if isinstance(other, Namespace):
|
||||||
|
return self.name == other.name
|
||||||
|
if isinstance(other, str):
|
||||||
|
return self.name == other
|
||||||
|
raise TypeError('Namespace can only compare with Namespace or str')
|
||||||
|
|
||||||
def __lt__(self, other):
|
def __lt__(self, other):
|
||||||
return self.name < other.name
|
return self.name < other.name
|
||||||
|
@ -509,6 +520,12 @@ class Namespace(object):
|
||||||
if c.type == Eolian_Class_Type.REGULAR and
|
if c.type == Eolian_Class_Type.REGULAR and
|
||||||
c.namespace == self._name]
|
c.namespace == self._name]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def abstracts(self):
|
||||||
|
return [ c for c in self._unit.all_classes
|
||||||
|
if c.type == Eolian_Class_Type.ABSTRACT and
|
||||||
|
c.namespace == self._name]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def mixins(self):
|
def mixins(self):
|
||||||
return [ c for c in self._unit.all_classes
|
return [ c for c in self._unit.all_classes
|
||||||
|
|
Loading…
Reference in New Issue