mozilla / sphinx-js

Autodoc-style extraction into Sphinx for your JS project
https://pypi.python.org/pypi/sphinx-js/
MIT License
282 stars 81 forks source link

Cross-linking for argument types in typescript #130

Open Luthaf opened 4 years ago

Luthaf commented 4 years ago

Hi, and thanks a lot for this package! I am using it to document a typescript project, and I have a feature request.


Code like this


interface Person {
   age: number;
   city: string;
}

class Bar {
    private drinks: string[] = [];
}

/**
 * get_out description
 * @param  person description
 * @param  bar    description
 */
function get_out(person: Person, bar: Bar) {}
.. js:autoclass:: Person

.. js:autoclass:: Bar

.. js:autofunction:: get_out

currently renders as

screenshot

It would greatly improve navigation if the types of parameters (index.Person and index.Bar) where links to the documentation for the type.

Is it currently possible to do this?

Thanks for your time

erikrose commented 4 years ago

I'm about 80% sure that we would have to take over the low-level rendering of functions, interfaces, etc., where we currently use the bits Sphinx provides for free. I'm not against that, but it would be a bit of a project. I welcome any who want to undertake it; I agree it's an eminently sane feature.

erikrose commented 4 years ago

Now I'm 100% sure, for what that's worth. :-)