Comments (10)
@mrmartineau Should it not have a trailing /
as it is a folder? Like this
export default {
theme: '../../src/docz-theme-fx/',
}
That works for me when I point to a custom theme that contains an index.js
:)
I think that will only work if the entry point is index.js
though, not sure if you will have to actually supply the index name if its a typescript file? Like -
export default {
theme: '../../src/docz-theme-fx/index.tsx',
}
from docz.
@Swapnull thanks for your help, but I still cannot get this to work. Neither adding a trailing slash, or the path to the full file works. Should the copy I created need compiling for it to work?
from docz.
Hey, Here is what I am doing - https://github.com/Swapnull/docz-test and that seems to work.
That was just a copy from the base version and then taking it out of typescript for ease :)
Not sure it needs compiling first? Hope that helps :)
from docz.
@Swapnull thanks again, but I tried using your version too and it still didn't work. Can you tell me if there's anything else that I should do beyond having the theme within my project and setting the correct path in the config?
from docz.
Hi @mrmartineau, as you can see in the Theming section on Project configuration, theme filepath need to be relative to your src
folder or the root folder of your project...
This is defined in webpack on resolve.modules
configuration:
https://github.com/pedronauck/docz/blob/master/packages/docz-core/src/bundlers/webpack/config.ts#L141-L143
So, if you pass a filepath on theme
, webpack will search this file on root,
src
, or node_modules
, but just project files will be parsed by loader, node_modules
will be rejected!
from docz.
Hi @pedronauck, I still cannot get this to work... when you mention src
above, the docs say to use source
instead, is that what you're referring to?
My config is as follows:
export default {
theme: 'src/docz-theme-fx',
source: './',
}
That config should work, right?
My project structure is as follows:
. (root)
- src
- components
- docz-theme-fx (this is a copy of the default theme with a few changes)
The value in root.jsx
is exactly the same as the value in the config, e.g.
import Theme from 'src/docz-theme-fx'
Can you show me an example of what the above line should look like with a custom theme?
from docz.
Hey @mrmartineau, can you provide a repo with minimal failing setup so I can take a look?
from docz.
@mrmartineau does it not need to be theme: 'src/docz-theme-fx/src/
? I thought it had to point to the src file inside the theme, assuming you copied the basic theme?
from docz.
@Swapnull adding src
to the path (like so: theme: 'src/docz-theme-fx/src
) was what was needed. Thank you.
I used the non-Typescript version that you created (above) and it is now working, but I had to install recompose
and lodash.merge
to get it to work fully.
The shame of it is, is that I wanted to update the <Playground>
component to have a themeable (or at the very least, a dark background), which I edited, but I realise that while the styles can be modified, no new props can be added to a theme without them being in docz core. @pedronauck am I correct in that assumption? If so, I will look at submitting a PR for it to go into core rather than my theme.
Thanks for your help guys
from docz.
You can path your own render
component like here @mrmartineau
https://github.com/pedronauck/docz/blob/master/packages/docz-theme-default/src/index.tsx#L19
from docz.
Related Issues (20)
- node_modules\.bin\gatsby HOT 3
- gh repo clone github/docs HOT 1
- Port not used from custom gatsby-config.js file
- Can't resolve '@emotion/core' HOT 9
- Error on first install. nError handler for invocation 'building-schema', error was 'TypeError: (0 , _buildASTSchema.getDescription) HOT 2
- Test out possibly breaking changes on security updates made from dependabot pull-requests HOT 3
- pnpm bare installs broken HOT 2
- What font is used in Docz image? HOT 3
- Error in setting up development environment HOT 4
- Release notes for 2.4.0 are missing HOT 1
- Multiple errors after installing docz HOT 11
- Error while initializing babel in docz HOT 3
- Can't resolve '@babel/runtime/helpers/esm/regeneratorRuntime'
- Error: Cannot find module 'typescript' docz HOT 2
- Add a visible notice on the documentation on why docz will not work
- Can we say that the project is Dead now? What are the alternatives? HOT 1
- how to use in react 18 HOT 4
- Error docz build
- When I try to run the project in the development environment, I get the following error: HOT 1
- An error occurred while accessing the file after local packaging.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docz.