[Development] Documenting JavaScript with QDoc

Aleix Pol aleixpol at kde.org
Thu Apr 17 13:07:12 CEST 2014


On Thu, Apr 17, 2014 at 12:38 PM, Milian Wolff <milian.wolff at kdab.com>wrote:

> Hello!
>
> I'm trying to add documentation to the JavaScript API of QWebChannel. It
> is a
> fundamental part of this module and as such, I think proper documentation
> is
> crucial.
>
> So far, I have not found a way to get qdoc to generate a page for my .js
> file
> for me. Can it? Or do I have to create a separate .qdoc file, and - if so -
> what commands to I need to use in that file?
>
> I tried something like this:
>
> /*!
>     \title Qt WebChannel JavaScript API
>     \page javascript.html
>
>     To communicate with a QWebChannel or WebChannel, any HTML client must
> use
> and setup the
>     JavaScript API provided by \c qwebchannel.js.
> */
>
> /*!
>   \qmltype foo
>
>   asdfsadf
> */
>
> /*!
>   \qmlmethod bool foo::test();
>
>   foo bar
> */
>
> On the javascript.html page, I then cannot see anything about foo nor
> foo::test... Is there maybe a module out there which documents "pure" .js
> files? In QtDeclarative, I only found documentation for  .cpp/.qml
> functions
> so far. Even things like qsTr are actually documentation for a .cpp method
> which gets renamed using \qmlmethod...
>
> Hope anyone can help me here. The only potential workaround I could think
> of
> so far would be adding a dummy .cpp file for the documentation of the .js
> API
> of the QWebChannel.
>
> Thanks
>
> --
> Qt Developer Days 2014 - October 6 - 8 at BCC, Berlin
>
> Milian Wolff | milian.wolff at kdab.com | Software Engineer
> KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
> Tel. Germany +49-30-521325470, Sweden (HQ) +46-563-540090
> KDAB - Qt Experts - Platform-independent software solutions
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>

FWIW, I think we already did something similar for Doxygen, you definitely
want to be able to document it.

Aleix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140417/01b0fa0e/attachment.html>


More information about the Development mailing list