-
Notifications
You must be signed in to change notification settings - Fork 679
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
Issues with custom themes (0.22) #1786
Comments
same , it results in empty script !! |
That theme is set up incorrectly, see #1741 (comment), because there are multiple installs of typedoc, as far as the rendering TypeDoc is concerned, the theme that extends the default theme is not inherited from the default theme and therefore shouldn't have the default assets created. Given that this is the third time that I know of that this has tripped people up... it's probably time I added a hack to detect it and print lots of warnings. The Google Analytics issue is definitely real - I totally missed this since I don't use it anywhere... easy fix at least, though looking at Google's page, the JS we're injecting is old... a change for the next minor version I think, since the new code only requires an ID, no site. Your hook workaround looks broken to me. You don't use the |
I just published 0.22.9, which fixes the google analytics issue, and adds a warning that will try to tell you if you're doing something that will cause your theme to break. I've also created https://github.com/Gerrit0/typedoc-custom-theme-demo, which shows a working example of hooks + custom themes. |
@Gerrit0 I've updated to TypeDoc 0.22.9 but the You can see it here: https://github.com/matteobruni/tsparticles/tree/72983dad4686ca84381b636642555a8073928064
Both uses 0.22.9 version, both has it as a dev dependency, the theme package.json has also the
I've not checked yet if the GA code is fine, or other things, since it's not working. I tried checking your repository but I don't find anything useful about this error since the dependencies are the same. |
Well, that warning at least confirms that what I thought was going wrong is what is going wrong. It doesn't matter if you're loading the same version of TypeDoc multiple times. It's still a problem to load it multiple times, so my initial comment still stands. If you're going to have a theme and a use of that theme in a single repo, you need to figure out some way to have only a single install of TypeDoc. Lerna might have options that make this possible, not sure... |
I've tried with local path like this:
and it's working fine. I'd like to know what is the difference, in this case the package is copied, with Lerna the package is a link to the folder. I was testing also hooks for achieve the same thing without a full theme but it's not working. You can see the code here: https://github.com/matteobruni/tsparticles/blob/typedoc-test-theme-2/utils/typedoc-theme/src/index.tsx It uses a hook to |
@matteobruni thanks that was the trick. Evidently its not possible to develop a custom theme without either npm packaging it or doing your trick which is less painful. I don't use Lerna but |
This is the relevant piece - the package is copied... but not the package's There's nothing that can really be done by TypeDoc to make this less of a problem as far as I know. |
Search terms
custom themes
Expected Behavior
Actual Behavior
Today I was migrating from 0.21.x to 0.22.x, and my custom theme (2 additional scripts, nothing more) needs a migration too.
I started from a sample theme found on GitHub (this) but it didn't worked. I tried checking the documentation here but also this wasn't working as expected.
Here are the errors found:
docs
folder when tested. The outputdocs
folder was containing only two.html
files. The default theme that was overridden generates a lot of additional files,.css
and.js
files included.analytics
property like in the documentation linked above, the issues were the same as the custom theme, but I noticed that also Google Analytics had issues since here and below all the'
characters will be replaced by the engine with the corresponding HTML escape value.JSX.Raw
like described in the documentation linked above the parent<script>
tag was empty.Steps to reproduce the bug
For testing the theme output you can just clone this repository
To see the invalid
docs
output these are the steps:cd typedoc-test-theme
yarn
ornpm i
yarn build
ornpm run build
cd demo
yarn
ornpm i
yarn build
ornpm run build
The
demo/docs
folder will have only twohtml
files instead of the full output.For testing the hooks output follow the steps described here in the hooks section.
Google Analytics seems broken in any test I've made, I've disabled it for now in my
tsconfig.json
and used my custom theme to readd it manually.Using the hooks I've found a workaround that can be seen here
You can also find more informations in the issue #1785, the required tags were the fix in that case.
Environment
The text was updated successfully, but these errors were encountered: