New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript handler #636
Comments
For me, it's packages in a mono repo (example), then in each package all exported functions incl. their signatures, as well as interfaces, types and exported variables. So, taking one of my projects, basically the top-level export:
Modules are essentially packages, if they have
Sounds perfect.
Nice feature, don't know if it's necessary for the handler.
Sounds great as well. |
Also in related prior work for research: Typedoc. It's good, but having something that integrates with mkdocs would be awesome |
I don't know the internals of mkdocstrings and how handlers work, but I think the I have a TypeScript project that has existing typedoc-based documentation (hosted online here). And here attached docs.json is the JSON output from typedoc. (I ran Maybe this is helpful here? |
That is super helpful, thanks a lot! I came across Typedoc 3 weeks ago, when someone pointed me to it in this tsdocs issue, but didn't get time to try it yet. It looks exactly like the kind of tool a mkdocstrings handler could use 🙂 |
I'm curious if you have an idea of how big a lift this is to implement? I'd love having both python and TS api docs in a single mkdocs-based website instead of having to switch between mkdocs and typedoc Is there something I can help with outside of digging into a full handler implementation? |
@kylebarron Here's my experience:
If you're willing to help, I can give you collaboration access to the relevant repositories, and we'll chat there in issues, and in return I can give you free access to Insiders. Let me know what you think (feel free to drop me a message on Gitter/Matrix or at pawamoy@pm.me) 🙂 |
@samuelcolvin on what repository of yours could I test the handler? |
It was FastUI, but I haven't got around to writing them yet. Sorry. |
No worries, just wanted to make sure. Docstrings are not the most difficult part anyway. I'll start testing on FastUI 🙂 |
@samuelcolvin I've published a first prototype. Insiders have gained access to it. If you want to test it on FastUI: # Enter your local clone.
cd FastUI
# Prepare a Python virtualenv.
python -m venv .venv
. .venv/bin/activate
python -m pip install mkdocs mkdocs-material mkdocstrings
# If using PyPI Insiders (https://pawamoy.github.io/pypi-insiders/):
pypi-insiders server start
pypi-insiders repos add pawamoy-insiders/griffe-typedoc:griffe-typedoc
pypi-insiders repos add pawamoy-insiders/mkdocstrings-typescript:mkdocstrings-typescript
pypi-insiders repos update
python -m pip install mkdocstrings-typescript
# Else:
python -m pip install git+ssh://git@github.com/pawamoy-insiders/griffe-typedoc
python -m pip install git+ssh://git@github.com/pawamoy-insiders/mkdocstrings-typescript --no-deps Then apply these changes: pydantic/FastUI@main...pawamoy:FastUI:typedoc (or add a remote pointing to my fork and pull my branch locally), install |
@squidfunk you can follow a similar approach for your |
Keep in mind this is a very early prototype, the rendered docs are super raw 😅 If you want to tweak things locally, install both mkdocstrings-typescript and griffe-typedoc in editable mode, as usual. |
Is your feature request related to a problem? Please describe.
Opening for visibility.
Describe the solution you'd like
A TypeScript handler.
Additional context
Could use api-extractor
@squidfunk @samuelcolvin could you describe what objects you would like to document in API refs? Do you have examples of API refs for TypeScript libraries that I could draw inspiration from? For example, looking at sp-core-library, I see that we should document classes (+ methods and properties), interfaces (+ methods and properties), type aliases, enumerations (+ fields). Maybe also "modules" and "variables"?
Also, could let me know if API Extractor would fit your workflow/projects? If not, I can write an extractor in Python (I actually already started), but that will take more time.
Also also, it would be great if experienced TypeScript devs could share documents about file layouts and conventions regarding TypeScript packaging and exposing public APIs 🙂
Notes to myself
The text was updated successfully, but these errors were encountered: