-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Notes are displaying from center of box. #7960
Comments
FYI |
Thanks for replying! Sorry, but can't actually use dev-versions. Can you give more information about release date? About month? |
@patrickteivas Next week (or possibly the week after to avoid conflicting with the Apple announcement, or if something unexpected comes up) |
Nice. Also tried
|
@patrickteivas Did you install the addon? See https://github.com/storybookjs/storybook/blob/next/addons/docs/README.md#installation |
@shilman of course :) Newly installed (or upgraded) packages list with versions
|
@patrickteivas all your First line of instructions:
|
My bad. Upgraded all packages to
Getting
Where exactly I have to register components? |
@patrickteivas Your syntax for vue MDX stories is wrong. See #7984 for full explanation, or https://raw.githubusercontent.com/storybookjs/storybook/next/examples/vue-kitchen-sink/src/stories/addon-docs.stories.mdx for examples cc @Aaron-Pool on vue-specific questions |
New
Still same error
Can't get, what I'm doing wrong. |
I'm not too familiar with Vue, but in
Wonder if you need to do this for |
It's test component I created, to match docs.
Tried, still same error. Btw, that would be weird, if I must register every component I'm writing docs on in |
Ok, @Aaron-Pool can you shed any light on this? |
Pretty early in the Eastern Time zone, so I'm not in front of a computer yet, but here are some thoughts: @shilman looks like his build is choking on jsx. I see he isn't using a a docs preset, and he isn't using the Babel react jsx plugin. So could it maybe just be that? On the Vue side, to ensure it isn't a component registration issue, you could change your story to this (leaving the rest of the file unchanged): <Story name="badge">
{{
components: { Badge },
template: '<badge :to="test-link" />',
}}
</Story> That's the more common way of registering components for stories. The Vue kitchen sink uses a global registration in the config because it's mostly a demo app. But, like I said, the error you're getting really makes me think it's more of a build issue than anything. So I don't expect changing your story to fix it. I'll dig into it more when I can get to a computer. |
Nope, still same error. |
Yeah, like I said, I figured it was a build issue and unrelated to component registration. I'll try to get back to you in a few hours. |
Ok @patrickteivas give this a shot.
module.exports = ['@storybook/addon-docs/vue/preset'];
const path = require('path');
module.exports = async ({ config }) => {
config.module.rules.unshift({
test: /\.s?css$/,
loaders: ['style-loader', 'css-loader', 'sass-loader'],
include: path.resolve(__dirname, '../')
});
return config;
}; Give that a whirl. If it doesn't work. I'll probably need a minimal reproduction repo to debug for you. |
@Aaron-Pool okay, now I have also good news :). |
@patrickteivas If you click the "canvas" tab rather than the "docs" tab, does the selected story render? Edit: Oh, wait, if your aliases aren't working it wouldn't be importing your component correctly. Which is probably why no stories are showing. You should just be able to add the following into your config.resolve =
resolve: {
alias: {
'@': path.dirname(path.resolve(__dirname)),
'~': path.dirname(path.resolve(__dirname))
}
} I'm guessing you knew how to do that though. Also, I think(?) that should solve the issue completely. So, I'm going to close this issue. Let me know if I need to reopen. |
Nope. I have only 1 story (That one I sent before) for the test and it's not displayed in the sidebar at all (So I see "loading" animation in the sidebar). |
@patrickteivas alright, well, if it's still not working, I probably need a minimal reproduction repo to debug. |
@Aaron-Pool I don't think I can fully reproduce situation, but here's my minimal repo with same problem. |
@patrickteivas thanks for the repro, I'll try to pull it down and debug when I get off work tonight. |
@patrickteivas k. FIxed it. You were using a deprecated story loading format. Also, the vue docs preset already contained the new Parameters you were adding. Basically, change your config to: import Vue from 'vue';
import { configure } from '@storybook/vue';
import { DocsPage, DocsContainer } from '@storybook/addon-docs/blocks';
import { action } from '@storybook/addon-actions';
Vue.component('nuxt-link', {
props: ['to'],
methods: {
log() {
action('link target')(this.to);
}
},
template: '<a href="#" @click.prevent="log()"><slot>NuxtLink</slot></a>'
});
// Remove this completely
/*
addParameters({
docs: {
container: DocsContainer,
page: DocsPage
}
});
*/
// And change this
/*
function loadStories() {
const req = require.context('../stories', true, /\.stories\.(js|mdx)$/);
req.keys().forEach((filename) => req(filename));
}
// configure(loadStories, module);
*/
// To this
configure(require.context('../stories', true, /\.stories\.(ts|mdx)$/), module); You'll theeeeennnn get the import { Story, Preview, Meta } from '@storybook/addon-docs/blocks';
import Logo from '../components/Logo';
<Meta title="Addon|Docs" />
<Story name="Logo">
{{
components: { Logo },
template: '<Logo />'
}}
</Story> Aaaaaaaannnnnddd theeeennn you're good 👍 |
@Aaron-Pool you're an angel 👼 |
@Aaron-Pool wow, that's really very impressive. I'm very thankful that you find time and patience to help me.
|
@patrickteivas no problem at all! And I think what you're seeing now is that the docs add-on content has a Max width, and you seem to have a pretty wide monitor. Typically for documentation though, a Max width is a good thing. You normally don't want text content to stretch more than 80 characters or else people will lose their place while reading. If this has a really negative impact on you, feel free to creat a feature request as a separate issue to adjust the docs max-width! Edit: In retrospect, that's probably the first thing I should have responded with. I came in to the conversation when you were trying to get docs-mode setup and sort of overlooked the original 😕 I apologize if that ended up taking more of your time than the original issue needed. |
I don't mean
FullHD.
No worries, you did well! I'm very thankful to you. |
@patrickteivas that's actually very helpful to know that an FHD monitor can make things look odd with the current layout settings. One of the most difficult things about testing software can be thinking about edge cases in user environments. Like I said, if you want to create a feature request issue to be able to set the docs content to align to the left (thanks for that clarification, btw), just so it's documented, that would be great! |
Big thanks to both of you, who helped me to set up |
Describe the bug
Notes are displaying from center of box.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Aligned to left.
Screenshots
Code snippets
Content of
test.stories.js
Content of
LinkMarkdown.md
System:
Additional context
Using Chrome.
The text was updated successfully, but these errors were encountered: