Skip to content
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

chore: add typedoc #82

Closed
wants to merge 9 commits into from
Closed

chore: add typedoc #82

wants to merge 9 commits into from

Conversation

ericjeker
Copy link
Contributor

Added typedoc.

TODO: add it in the build process in Github Actions.

@Shinigami92 Shinigami92 added p: 1-normal Nothing urgent s: on hold Blocked by something or frozen to avoid conflicts labels Jan 11, 2022
@Shinigami92 Shinigami92 force-pushed the migrate-to-typescript branch 6 times, most recently from 1705b9d to 23e4498 Compare January 14, 2022 20:33
@damienwebdev
Copy link
Member

damienwebdev commented Jan 15, 2022

@ericjeker now that the migrate-to-typescript is merged to main, could you rebase? I've changed your merge target to main.

@damienwebdev damienwebdev changed the base branch from migrate-to-typescript to main January 15, 2022 16:06
@Shinigami92 Shinigami92 added needs rebase There is a merge conflict and removed s: on hold Blocked by something or frozen to avoid conflicts labels Jan 15, 2022
@ericjeker
Copy link
Contributor Author

Not sure this still need to be merged as Jess already generated the docs with Vitepress and it probably needs to be integrated with Vitepress directly.

@damienwebdev
Copy link
Member

@ericjeker could you output a json document that is consumable by the docs? @JessicaSachs how would this work with Vitepress?

@JessicaSachs
Copy link
Contributor

JessicaSachs commented Jan 18, 2022

My dream is to be able to write human documentation in Markdown surrounding auto-generated typedocs that we export in json. I'm stuck without a computer, so forgive me for pseudocode and any typos.

To do this we need to:

  1. Import the raw json and create UI components from it
  2. Import these docs UI components throughout pages like guide/address.md

To do this, we can create N components for the API surface area and register them globally within the docs/components file. When you register components there, they become available globally in all Markdown files

// somewhere within docs
// setting up jsx is actually easy, but this is the only time we'll use raw render fn's so it's nbd
import { h } from 'vue'
import typedocs from './typedocs.json'
import CodePreview from './components/CodePreview.vue'

export const docComponents = {}

each(typedocs, (value, key) => {
  docComponents['Typegen' + key] = h(CodePreview, { doc: value })
})

Now write the CodePreview Vue component to create the correct td's and tr's with formatting.

Expected API:

---
title: API Guide
---

### Addresses

### Address API <Badge text="v3.3.0" type="tip" />
The address API is best used for (etc)

<TypegenAddress/>

### City

<!-- this is my next goal -->
<Playground namespace="address" />
....

I think this is a good approach. @antfu could you give me a sanity check? Am I missing something obvious?

@ericjeker
Copy link
Contributor Author

Hi guys,

I created another PR with a clean state as this PR was from an outdated branch: #207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs rebase There is a merge conflict p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants