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

feat: Vuepress 2 support #41

Open
tomatopickle opened this issue Nov 16, 2021 · 26 comments · May be fixed by #47
Open

feat: Vuepress 2 support #41

tomatopickle opened this issue Nov 16, 2021 · 26 comments · May be fixed by #47
Assignees
Labels
enhancement New feature or request

Comments

@tomatopickle
Copy link

Is your feature request related to a problem? Please describe.
I really like this plugin, but I've switched to Vuepress 2. Can you please make this plugin Vuepress 2 compatible?

Thanks

@tomatopickle tomatopickle added the enhancement New feature or request label Nov 16, 2021
@BuptStEve
Copy link
Owner

BuptStEve commented Nov 17, 2021

OK, I'll try it...

$ npm i -D vuepress-plugin-demo-code@next
# OR
$ pnpm i -D vuepress-plugin-demo-code@next
# OR
$ yarn add -D vuepress-plugin-demo-code@next

BuptStEve added a commit that referenced this issue Dec 7, 2021
BREAKING CHANGE: remove vuepress-plugin-code-copy
"You cannot use other plugins in your plugin anymore, which avoids lots of
potential issues caused by plugin nesting. If your plugin depends on other plugins, you should list
them in the docs."

fix #41
BuptStEve added a commit that referenced this issue Dec 7, 2021
BREAKING CHANGE: remove vuepress-plugin-code-copy
"You cannot use other plugins in your plugin anymore, which avoids lots of
potential issues caused by plugin nesting. If your plugin depends on other plugins, you should list
them in the docs."

fix #41
@tomatopickle
Copy link
Author

Does this support Vuepress 2 now?

@BuptStEve
Copy link
Owner

Does this support Vuepress 2 now?

Yeah, try this one~

$ npm i -D vuepress-plugin-demo-code@next
# OR
$ yarn add -D vuepress-plugin-demo-code@next

@jtommy
Copy link

jtommy commented Mar 29, 2022

@BuptStEve it doesn't work properly, is it a stable version?

@BuptStEve
Copy link
Owner

@BuptStEve it doesn't work properly, is it a stable version?

what's wrong with it? Please provide some pictures or a demo?
It's not a stable version, because vuepress@2 is in beta version.

@jtommy
Copy link

jtommy commented Apr 2, 2022

@BuptStEve
The path separator doesn't look good for windows OS

 Plugin: vite:import-analysis
  File: C:/Users/Walter/Github/oruga/packages/docs-next/.vuepress/.temp/internal/clientAppEnhances.js
  3  |  import clientAppEnhance2 from 'C:/Users/Walter/Github/oruga/packages/docs-next/node_modules/@vuepress/plugin-theme-data/lib/client/clientAppEnhance.js'
  4  |  import clientAppEnhance3 from 'C:/Users/Walter/Github/oruga/packages/docs-next/node_modules/@vuepress/theme-default/lib/client/clientAppEnhance.js'
  5  |  import clientAppEnhance4 from 'C:\Users\Walter\Github\oruga\packages\docs-next\node_modules\vuepress-plugin-demo-code\src\enhanceAppFile.js'     
     |                                 ^
  6  |  import clientAppEnhance5 from 'C:/Users/Walter/Github/oruga/packages/docs-next/.vuepress/clientAppEnhance.ts'

and fiixing it manually

image

@BuptStEve
Copy link
Owner

@jtommy
Well, I get it. I'll fix this ASAP.
Because there are too many breaking changes in Vuepress's beta version, such as this:

image

@jtommy
Copy link

jtommy commented Apr 3, 2022

Thanks. What Vuepress 2 version are you supporting at the moment?

@BuptStEve
Copy link
Owner

BuptStEve commented Apr 3, 2022

@jtommy 2.0.0-beta.27

I just make it compatible with 2.0.0-beta.37, please wait a moment.

Please try this one~ [email protected]

@BuptStEve BuptStEve pinned this issue Apr 3, 2022
@jtommy
Copy link

jtommy commented Apr 6, 2022

@BuptStEve 2.0.0-beta.38

Uncaught SyntaxError: The requested module '/@fs/C:/Users/Walter/Github/oruga/packages/docs-next/node_modules/codesandbox-import-utils/lib/api/define.js' does not provide an export named 'getParameters'

SyntaxError: The requested module '/@fs/C:/Users/Walter/Github/oruga/packages/docs-next/node_modules/escape-html/index.js' does not provide an export named 'default' (at highlight.js:2:8)

It looks like all import from external libs are broken, probably due to Vite

@BuptStEve
Copy link
Owner

@jtommy Maybe add this for now~

// config.js
{
  // ...
  bundlerConfig: {
    viteOptions: {
        optimizeDeps: {
            include: [
                'prismjs',
                'escape-html',
                'codesandbox-import-utils/lib/api/define'
            ],
        }
    }
  }
}

@BuptStEve
Copy link
Owner

@jtommy I just publish this version: [email protected]

@jtommy
Copy link

jtommy commented Apr 7, 2022

@BuptStEve thanks. I found the same workaround after my last message.
Your last version is ok but you are setting Vue 2, why?

Anyway, I don't think I to be able to use your plugin because in the Vuepress 2.x there is a limit of a script for each .md

@BuptStEve
Copy link
Owner

@jtommy I'll use Vue3 as default in next commit. It's fine that you won't use it, every package suits it's own scenario.

@jtommy
Copy link

jtommy commented Apr 7, 2022

Or you might add a config to allow us to customize the Vue CDN.

I think the major part of components doc needs to show more than one example for each page (.MD).

@BuptStEve
Copy link
Owner

@jtommy [email protected] add vueVersion~
The feature "more than one <script>" is not that easy with current code.

@jtommy
Copy link

jtommy commented Apr 7, 2022

Any workaround to meet the need?

@bobobabab
Copy link

bobobabab commented Apr 19, 2022

使用了没效果是怎么回事,v2.0.0-beta.38, [email protected]

@BuptStEve
Copy link
Owner

使用了没效果是怎么回事,v2.0.0-beta.38, [email protected]

27c7477c-7266-44c8-8ca0-7b104bc53de7
image

@bobobabab
Copy link

bobobabab commented Apr 21, 2022

[email protected] 加了template 预览效果显示不出来,需要怎么处理?

@BuptStEve
Copy link
Owner

@bobobabab 给个复现仓库看看?

@bobobabab
Copy link

@BuptStEve
image
image
image

@BuptStEve
Copy link
Owner

@bobobabab template display: none; 了?

@bobobabab
Copy link

@BuptStEve 是的 要配置么还是直接css改

@giserMao
Copy link

@BuptStEve vuepress2.0.0 beta4 改变了plugins的引入方式,这边有计划做适配吗

BuptStEve added a commit that referenced this issue May 5, 2022
BREAKING CHANGE: remove vuepress-plugin-code-copy
"You cannot use other plugins in your plugin anymore, which avoids lots of
potential issues caused by plugin nesting. If your plugin depends on other plugins, you should list
them in the docs."

fix #41
@BuptStEve BuptStEve linked a pull request May 5, 2022 that will close this issue
BuptStEve added a commit that referenced this issue May 5, 2022
BREAKING CHANGE: remove vuepress-plugin-code-copy
"You cannot use other plugins in your plugin anymore, which avoids lots of
potential issues caused by plugin nesting. If your plugin depends on other plugins, you should list
them in the docs."

fix #41
BuptStEve added a commit that referenced this issue May 5, 2022
BREAKING CHANGE: remove vuepress-plugin-code-copy
"You cannot use other plugins in your plugin anymore, which avoids lots of
potential issues caused by plugin nesting. If your plugin depends on other plugins, you should list
them in the docs."

fix #41
@bobobabab
Copy link

vuepress2.x support copy button?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
5 participants