After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 683046 - Add mallard documentation for GJS
Add mallard documentation for GJS
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-08-30 17:10 UTC by Giovanni Campagna
Modified: 2015-02-07 16:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Namespace: fix appending of nodes (4.77 KB, patch)
2012-08-30 17:11 UTC, Giovanni Campagna
committed Details | Review
Ast: Add parent to Fields (4.03 KB, patch)
2012-08-30 17:11 UTC, Giovanni Campagna
committed Details | Review
Add documentation for enumeration members (23.26 KB, patch)
2012-08-30 17:11 UTC, Giovanni Campagna
committed Details | Review
MallardWriter: support cross-references across namespaces (4.36 KB, patch)
2012-08-30 17:11 UTC, Giovanni Campagna
committed Details | Review
MallardWriter: don't fail if a language doesn't have a specific template (1.38 KB, patch)
2012-08-30 17:12 UTC, Giovanni Campagna
reviewed Details | Review
Add documentation for gjs JS bindings (35.31 KB, patch)
2012-08-30 17:12 UTC, Giovanni Campagna
none Details | Review
Expand on the documentation tests (37.38 KB, patch)
2012-08-30 17:12 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2012-08-30 17:10:33 UTC
My plan was to wait 3.7.1 before making this public, but seeing that other people are working on it, and to avoid stepping on each other toes, here it is what I obtained so far.
It can be considered ready for review, although it's just a first start on the bigger feature of decent JS docs.
Comment 1 Giovanni Campagna 2012-08-30 17:11:22 UTC
Created attachment 222955 [details] [review]
Namespace: fix appending of nodes

Traverse appended nodes for methods, so that namespace.symbols contains
all known symbols and not just global functions.
Also, ensure that all relevant nodes are appended when parsing GIRs.
Comment 2 Giovanni Campagna 2012-08-30 17:11:31 UTC
Created attachment 222956 [details] [review]
Ast: Add parent to Fields

Properties have it, there is no reason for Field not to, and in this
way mallard docs can treat a field almost like a property.
Comment 3 Giovanni Campagna 2012-08-30 17:11:40 UTC
Created attachment 222957 [details] [review]
Add documentation for enumeration members

Enum members were Annotated in the AST, and most code already assumed
they could have docs. What was missing was reading the docs from the
comment blocks and writing them in the XML.
Comment 4 Giovanni Campagna 2012-08-30 17:11:48 UTC
Created attachment 222958 [details] [review]
MallardWriter: support cross-references across namespaces

Look in included namespaces when resolving a cross-reference.
Comment 5 Giovanni Campagna 2012-08-30 17:12:03 UTC
Created attachment 222959 [details] [review]
MallardWriter: don't fail if a language doesn't have a specific template

Different languages have different level of support for the docs, and
thus some may miss one template if recently add. If that's the case,
silently fall back to the default template.
Comment 6 Giovanni Campagna 2012-08-30 17:12:12 UTC
Created attachment 222960 [details] [review]
Add documentation for gjs JS bindings

Add the necessary templates and a MallardFormatter subclass
to handle JS bindings.
The docs are intentionally specific to gjs, as they make some assumption
on the way the binding presents the API, such as which function arguments
are in or out, which fields are writable, which structures
can be constructed with operator new, etc.
Comment 7 Giovanni Campagna 2012-08-30 17:12:20 UTC
Created attachment 222961 [details] [review]
Expand on the documentation tests

Add tests for complex function signatures (including arrays and
callbacks), for enumerations and for static methods.
Add JS reference files.
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-10-18 17:49:29 UTC
Review of attachment 222957 [details] [review]:

Looks good.
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-10-18 17:49:38 UTC
Review of attachment 222956 [details] [review]:

Makes sense.
Comment 10 Jasper St. Pierre (not reading bugmail) 2012-10-18 17:50:44 UTC
Review of attachment 222958 [details] [review]:

Yep.
Comment 11 Jasper St. Pierre (not reading bugmail) 2012-10-18 17:52:27 UTC
Review of attachment 222959 [details] [review]:

I'm not sure it's not an error to do this. I'd also like to see templates in subdirectories, so +0 on this patch.
Comment 12 Jasper St. Pierre (not reading bugmail) 2012-10-18 17:55:05 UTC
Review of attachment 222960 [details] [review]:

I'd really like to clean up the doctool architecture before landing something like this. This was written before doctool was scrapped and templates were introduced, but I still think achieving an architecture like this would be useful:

https://github.com/magcius/gobject-introspection/commit/3d36e1f8a0d08311669023a72a2441775471ec28
Comment 13 Jasper St. Pierre (not reading bugmail) 2012-10-18 17:56:07 UTC
Review of attachment 222961 [details] [review]:

Would you mind dropping the JS stuff for now and pushing this early?
Comment 14 Giovanni Campagna 2012-10-18 20:05:20 UTC
(In reply to comment #13)
> Review of attachment 222961 [details] [review]:
> 
> Would you mind dropping the JS stuff for now and pushing this early?

Ok. What about patch 222955?
Comment 15 Jasper St. Pierre (not reading bugmail) 2012-10-18 20:07:18 UTC
I was hoping to defer to Colin or Johan to review that one. On a brief look, it's fine, but they have more knowledge of the hairy scanner code than I.
Comment 16 Colin Walters 2012-10-28 14:03:53 UTC
Review of attachment 222955 [details] [review]:

Looks correct to me.
Comment 17 Giovanni Campagna 2012-10-28 17:49:55 UTC
Attachment 222955 [details] pushed as 9ff28e6 - Namespace: fix appending of nodes
Attachment 222956 [details] pushed as b7e230a - Ast: Add parent to Fields
Attachment 222957 [details] pushed as d893890 - Add documentation for enumeration members
Attachment 222958 [details] pushed as 7fc2e9d - MallardWriter: support cross-references across namespaces
Attachment 222961 [details] pushed as ce4a25d - Expand on the documentation tests
Comment 18 Colin Walters 2013-04-04 20:41:29 UTC
Is there anything left from this bug?
Comment 19 Jasper St. Pierre (not reading bugmail) 2013-04-04 20:44:22 UTC
Not really, I'd say.
Comment 20 André Klapper 2015-02-07 16:47:03 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]