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

Integration with VitePress? #287

Closed
ericjeker opened this issue Jan 23, 2022 · 14 comments
Closed

Integration with VitePress? #287

ericjeker opened this issue Jan 23, 2022 · 14 comments
Labels
documentation Requires examples / documentation next Fix available in the '@next' release

Comments

@ericjeker
Copy link

VitePress has a different way of handling plugins. Plugins are now in Themes.

As we wanted to use TypeDoc and VitePress for the documentation of Faker.js, we were wondering what would be the best approach for that? Do you see this as a quick fix or should we create a new Vitepress theme by contributing to your repo maybe?

@tgreyuk
Copy link
Member

tgreyuk commented Jan 23, 2022

Sure will take a look...Without plugin life-cycle hooks it will make it more of a manual setup but can look into best way to integrate. Need to update the docs to explain properly how to extend the themes too.

@ericjeker
Copy link
Author

Hi Tom, just FYI, we were able to generate something automagically with a script here (thanks to @ST-DDT effort) but not sure if that's useful for you or if there is any way to integrate that back to your repo? It's indeed very manual-ish, as you said, as it seems there are no more hooks we can attach this to in Vitepress.

@emersonbottero
Copy link

It is possible to create vitepress plugin as vite/rollup plugins

@terwer
Copy link

terwer commented Apr 1, 2023

Any updates or is it possiable for vitepress?

@tgreyuk
Copy link
Member

tgreyuk commented May 13, 2023

If still of interest have created a theme that will preset options for use with VitePress and generate a sidebars file: https://github.com/tgreyuk/typedoc-plugin-markdown/tree/next/packages/typedoc-vitepress-theme#readme . Requires pre-release versions to be installed.

@tgreyuk tgreyuk added the next Fix available in the '@next' release label May 13, 2023
@ST-DDT
Copy link

ST-DDT commented May 14, 2023

Do you have screenshots or a demo deployment for reference purposes?

@tgreyuk
Copy link
Member

tgreyuk commented May 14, 2023

Do you have screenshots or a demo deployment for reference purposes?

I will set up a demo repo.

@tgreyuk tgreyuk added the documentation Requires examples / documentation label May 14, 2023
@wighawag
Copy link

wighawag commented Jul 5, 2023

Hi, I am interested in a demo too @tgreyuk

I tried setting up a repo according to instruction here: https://github.com/tgreyuk/typedoc-plugin-markdown/tree/next/packages/typedoc-vitepress-theme#readme

but I get

> fuzd-docs@0.0.0 publish-typedoc /home/wighawag/dev/github.com/wighawag/fuzd/docs
> typedoc --options typedoc.json

[info] Loaded plugin typedoc-plugin-markdown
[error] The plugin typedoc-vitepress-theme could not be loaded.
[error] TypeError: typedoc_plugin_markdown_1.MarkdownPluginOptionsReader is not a constructor
    at load (/home/wighawag/dev/github.com/wighawag/fuzd/node_modules/.pnpm/typedoc-vitepress-theme@1.0.0-next.0_typedoc-plugin-markdown@4.0.0-next.16/node_modules/typedoc-vitepress-theme/dist/index.js:46:27)
    at loadPlugins (/home/wighawag/dev/github.com/wighawag/fuzd/node_modules/.pnpm/typedoc@0.24.8_typescript@5.1.3/node_modules/typedoc/dist/lib/utils/plugins.js:31:23)
    at async Application.bootstrapWithPlugins (/home/wighawag/dev/github.com/wighawag/fuzd/node_modules/.pnpm/typedoc@0.24.8_typescript@5.1.3/node_modules/typedoc/dist/lib/application.js:102:9)
    at async run (/home/wighawag/dev/github.com/wighawag/fuzd/node_modules/.pnpm/typedoc@0.24.8_typescript@5.1.3/node_modules/typedoc/dist/lib/cli.js:56:5)

I guess typedoc-vitepress-theme is expecting a different version of typedoc-plugin-markdown as it try to import MarkdownPluginOptionsReader from the typedoc-plugin-markdown module

Is that a specifc version ?

@wighawag
Copy link

wighawag commented Aug 16, 2023

anyone could get that working ?

Edit: Actually for some reason, I was not on latest "next" version. after fixing this, I got it working. Thanks !

@duckception
Copy link

Hi, I am interested in a demo too @tgreyuk

I tried setting up a repo according to instruction here: https://github.com/tgreyuk/typedoc-plugin-markdown/tree/next/packages/typedoc-vitepress-theme#readme

but I get

> fuzd-docs@0.0.0 publish-typedoc /home/wighawag/dev/github.com/wighawag/fuzd/docs
> typedoc --options typedoc.json

[info] Loaded plugin typedoc-plugin-markdown
[error] The plugin typedoc-vitepress-theme could not be loaded.
[error] TypeError: typedoc_plugin_markdown_1.MarkdownPluginOptionsReader is not a constructor
    at load (/home/wighawag/dev/github.com/wighawag/fuzd/node_modules/.pnpm/typedoc-vitepress-theme@1.0.0-next.0_typedoc-plugin-markdown@4.0.0-next.16/node_modules/typedoc-vitepress-theme/dist/index.js:46:27)
    at loadPlugins (/home/wighawag/dev/github.com/wighawag/fuzd/node_modules/.pnpm/typedoc@0.24.8_typescript@5.1.3/node_modules/typedoc/dist/lib/utils/plugins.js:31:23)
    at async Application.bootstrapWithPlugins (/home/wighawag/dev/github.com/wighawag/fuzd/node_modules/.pnpm/typedoc@0.24.8_typescript@5.1.3/node_modules/typedoc/dist/lib/application.js:102:9)
    at async run (/home/wighawag/dev/github.com/wighawag/fuzd/node_modules/.pnpm/typedoc@0.24.8_typescript@5.1.3/node_modules/typedoc/dist/lib/cli.js:56:5)

I guess typedoc-vitepress-theme is expecting a different version of typedoc-plugin-markdown as it try to import MarkdownPluginOptionsReader from the typedoc-plugin-markdown module

Is that a specifc version ?

I was getting the same error with both the latest @next versions (next.36 version for the markdown plugin). Did some experimenting, and after downgrading the markdown plugin version I've managed to get it working:

"typedoc-vitepress-theme": "1.0.0-next.0",
"typedoc-plugin-markdown": "4.0.0-next.11"

@Swivelgames
Copy link

@tgreyuk This is a difficult question to ask because it often comes across as needy or demanding, but it's purely a strategic question. Dealing with next code is always precarious, and we're totally fine with accepting the risk of it. But I was curious if anyone could provide any insight into how stable typedoc-vitepress-theme is currently?

No one has a crystal ball, so the answer of "idfk" is totally an acceptable answer 😂 But are we anticipating any major changes / overhauls between now and whenever this makes it to an official 1.0 release? Or is it looking pretty stable for now?

Again, no rush. Loving the work that's being done here, and super excited to use it. We have an immediate need for it, so we're going to go ahead and start using it, and we can provide some "beta tester feedback" for anything that we run into to help contribute as we start playing around with it. But I was thinking about throwing some stories in our backlog to anticipate breaking changes if you think you might refactor major pieces of it 🙂👍

@tgreyuk
Copy link
Member

tgreyuk commented Jan 12, 2024

Hi @Swivelgames,

Thanks for asking the question and I'd like to say things are quite stable now after some recent breaking changes. The plugin simply breaking shouldn't happen again as there are some tests on the CI now. There may be a couple of option tweaks but that's about it. My main focus now is on stability and documentation, contributing guide etc.

It would be great if you could start using it and provide feedback. I can normally fix things pretty quickly and happy to look into any feature requests.

A couple of links of interest:

@am2222
Copy link

am2222 commented Mar 22, 2024

Thanks!
this worked for me

  "typedoc-plugin-markdown": "^4.0.0-next.54",
    "typedoc-vitepress-theme": "^1.0.0-next.8",

@tgreyuk
Copy link
Member

tgreyuk commented May 3, 2024

Released:

typedoc-plugin-markdown@4.0.0
typedoc-vitepress-theme@1.0.0

@tgreyuk tgreyuk closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Requires examples / documentation next Fix available in the '@next' release
Projects
None yet
Development

No branches or pull requests

9 participants