nuxt-themes / docus

Write beautiful documentations with Nuxt and Markdown.
https://docus.dev
MIT License
1.54k stars 157 forks source link

Code Group not working in production #975

Open YesidMarin opened 1 year ago

YesidMarin commented 1 year ago

Hello,

I have this component in local but when I release it in prod it doesn't work. I can't copy the code and it's not formatted.

image Screenshot 2023-09-03 at 21 44 07
MangMax commented 1 year ago

I seem to have the same problem and it doesn't work in the development environment

collinped commented 1 year ago

Happened to me as well with version v1.14.6, ended up rolling back a couple of versions.

mathieunicolas commented 1 year ago

Yup, it happens to me as well. It doesn't work in dev and in prod.

@collinped , could you tell me which version did you use to get it work again ? I tried few roll backs and I can't make it work again ^^'

collinped commented 1 year ago

@mathieunicolas I rolled back to 1.14.3

mathieunicolas commented 1 year ago

@mathieunicolas I rolled back to 1.14.3

Thanks for your answer. I tried with 1.14.3 and I still have the bad behaviour, I don't understand where it comes from.

  "devDependencies": {
    "@nuxt-themes/docus": "1.14.3",
    "@nuxt/devtools": "^0.8.3",
    "nuxt": "^3.7.1",
    "rehype-katex": "^6.0.3",
    "remark-math": "^5.1.1"
  },

I deleted the node_modules and .nuxt folders, and... same problem in all my code-group components. What's wrong ? My nuxt version ?

Anyway, quick and dirty fix by adding a global CSS rule that seems to work :

code > span {
    display: block;
}

edit: less dirty fix :

code > span {
    white-space: pre-wrap;
}
Barbapapazes commented 1 year ago

seems related to https://www.npmjs.com/package/@nuxt-themes/elements but the repo is not opened. 🥲

mathieunicolas commented 1 year ago

alert components are broken too ? below the output for the following code :

::alert{type="info"}
Lorsque l'on affecte une valeur à une variable, il faut toujours penser au type que l'on va créer.

Par exemple, l'expression `var = 42` va créer un **entier** égal à 42. En revanche, l'expression `var = "42"` va créer une **chaîne de caractères** composée des caractères `4` et `2`.

Les fonctions `int()` et `str()` permettent de modifier le type d'une variable.
::

image

@Atinux do you have any clue for this bug ?

atinux commented 1 year ago

I am sorry about this, we are in the migration to remove all sub dependencies in order to migrate to pure TailwindCSS.

I know @bdrtsky is working on it, what is the ETA?

mathieunicolas commented 1 year ago

I am sorry about this, we are in the migration to remove all sub dependencies in order to migrate to pure TailwindCSS.

I know @bdrtsky is working on it, what is the ETA?

Thanks for answering, and don't be sorry !! You're doing an amazing work and huge thanks for that ! Is moving docus to tailwind in the list as well ? I was starting to think a docus remake with tailwind could be useful, and then I've seen things for Docus v2, is there a milestone somewhere if we want to help ?