Giter VIP home page Giter VIP logo

astro-typedoc's People

Contributors

tatarianbarbarian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

astro-typedoc's Issues

Add support for multiple entrypoints

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.

  • Adapt navigation - #36
  • Make sure cross-module/cross-project links work - #37
  • Fix folder names for Astro to make pages work - #38

Define config format

Decide in which format config should be, its fields and options.
Can be dirty on early stage, but should be stable and documented later.

  • Add config reference
  • Document config in readme file
  • Define the types for the config if needed/common practice

Prepare testing environments

Prepare testing environments for following things:

  1. Astro/starlight environment. To make sure pages are generating the right way

  2. Stub TypeScript project. To have some controlled playground with typed project

  3. Nanostores site environment. To have some less-controlled playground with real typed project

Add ability to modify frontmatter

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')
  }
})

Cross-page navigation generator

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

Create additional test environments for layout use cases

We have 3 potential user cases:

  1. User which use this utility to create site with API docs
  2. User which integrates API docs as a site section -- uses default layout partly
  3. User which integrates API docs as a site section -- with completely custom layout and styles, but still can reuse some of the default styles

Create default theme for docs

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.

  • Navigation sidebar
  • Header
  • Search
  • Doc page styles
  • Themization variables
  • Guide on theming in Readme
  • Mobile version

Add good intro to `README.md`

Good intro to docs is the key to open source project promotion. We should add it after adding good styling out-of-the-box.

  • Check out my slides about open source promotion
  • Add screenshot which will explain tool only by image (TypeDoc example in a classic Starlight design)
  • Improve the first sentence which describe the tool
  • Add npm install and other simple steps to install the tool

Typedoc: research

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:

  • Go through docs
  • Run TypeDoc on some TS projects
  • Check outputs
  • Try modifying outputs
  • Check ai's scripts

Try Starlight

Starlight is astro-based tool for documentation sites.

I need to check what it's capable of, plugins system, alternatives.


TODO:

  • Go through docs
  • Check for alternatives
  • Check integrations and how easy/hard they to add

Generate docs for modified TypeDoc reflections tree

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.

Make navigation starlight-compatible

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.

Make sure Astro v3 is supported

Check if there are any issues related to v2-v3 versions of Astro and fix them.

  • Run integration on v3 Astro site
  • Check for errors
  • Fix errors if present or close issue if everything is fine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.