evilmartians / astro-typedoc Goto Github PK
View Code? Open in Web Editor NEWA tool for building astro-based documentation sites using Typescript types definitions and TSDocs.
License: MIT License
A tool for building astro-based documentation sites using Typescript types definitions and TSDocs.
License: MIT License
I'm going to build an Astro project to learn key features using their official tutorial:
https://docs.astro.build/en/tutorial/0-introduction/
TODO:
Now, the code works with a single entry point.
It's possible for code to have multiple of them, and we should check how to handle it the right way.
We may want to split navigation to avoid possible confusion, for example.
This task is for checking what can go wrong and fixing it.
Decide in which format config should be, its fields and options.
Can be dirty on early stage, but should be stable and documented later.
Document how to work with integration, config fields, etc.
Prepare testing environments for following things:
Astro/starlight environment. To make sure pages are generating the right way
Stub TypeScript project. To have some controlled playground with typed project
Nanostores site environment. To have some less-controlled playground with real typed project
Add markdown content from typedoc-plugin-markdown
to astro pages of types.
Now, frontmatter is hardcoded.
We need to make it configurable, because potential user may want to pass some additional data to use it in templates.
Astro uses YAML for frontmatters, so we'll need some Pojo to YAML library.
And find a good place to put it, mostly likely in page generating stage.
So API may look like this:
const astroTypedoc = initAstroTypedoc(config)
const reflections = await astroTypedoc.getReflections()
await astroTypedoc.generateDocs({
reflections,
outputFolder: 'src/pages/docs',
frontmatter: {
layout: resolve(__dirname, './layouts/CustomLayout.astro')
}
})
There is a solution that seems to be close to what we want:
https://starlight-typedoc-example.vercel.app/
I need to check how it works, and is there any possibility that we could improve this one to get what we want.
TODO:
Integration should be able to generate navigation based on documented entities.
Also, we need to make sure that links in .md
are all working and not leading to .md
files
We have 3 potential user cases:
Now docs are looking like plain unstyled HTML, which seems raw.
This issue is for adding a some default styled layout which doesn't hurt viewer's eyes.
Basically, task is about creating an Astro layout template, and pass its path as a default layout
field in generated docs frontmatter.
Good intro to docs is the key to open source project promotion. We should add it after adding good styling out-of-the-box.
npm install
and other simple steps to install the toolBuild Astro plugin for generating pages based on exported types.
They may have no content but should have their own URL.
TypeDoc seems to be a good candidate for generating documentation from type definitions and TSDoc comments.
I need to check its input formats, output formats, and restrictions.
TODO:
ai
's scriptsStarlight is astro-based tool for documentation sites.
I need to check what it's capable of, plugins system, alternatives.
TODO:
Now integration works only with untouched TypeDoc reflections tree.
We need to make sure it will work if we change something in it.
The task is also about finding the best way to modify a tree: it can be tree-walker-callback, which is passed as a parameter to integration or some utility function that will generate a tree first, allow the user to modify it, and then integration consumes the modified tree.
Basically, user should be able to pass typedoc config into the integration config.
Generated navigation should follow Starlight API:
type SidebarItem = {
label: string;
translations?: Record<string, string>;
} & (
| { link: string }
| { items: SidebarItem[]; collapsed?: boolean }
| {
autogenerate: { directory: string; collapsed?: boolean };
collapsed?: boolean;
}
);
It either will be a separate utility like in starlight-typedoc
or just implicit under the hood thing that will work out of the box by default.
Check if there are any issues related to v2-v3 versions of Astro and fix them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.