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

Section content option path is relative to the project root (and should be relative to config file location) #137

Closed
mik01aj opened this issue Apr 29, 2016 · 2 comments

Comments

@mik01aj
Copy link
Collaborator

mik01aj commented Apr 29, 2016

From README:

  • sections

    Type: Array

    Allows components to be grouped into sections with a title and optional overview content. Sections can also be content only, with no associated components (for example, a textual introduction). A section definition consists of:

    • name - the title of the section.
    • content (optional) - location of a Markdown file containing the overview content.
    • components (optional) - a string or function providing a list of components. The same rules apply as for the root components option.

    Configuring a guide with a textual introduction section, then a UI section would look like:

    module.exports = {
      // ...
      sections: [
        {name: 'Introduction', content: 'docs/introduction.md'},
        {name: 'UI Components', content: 'docs/ui.md', components: 'lib/components/ui/*.js'}
      ]
    }

The 2 path options (content and components) handle path inconsistently. With components (as well as other config options, e.g. styleguideDir) the path is relative to the config file. The content path is relative to the webpack context (project root in this case). Often it means the same, but not when the config is not in the project root.

Related source line: https://github.com/sapegin/react-styleguidist/blob/a12accff15e8f42fc779f8e9faa277fbea4bc0d3/loaders/styleguide.loader.js#L62

CC @paulj

@mik01aj
Copy link
Collaborator Author

mik01aj commented Apr 29, 2016

Maybe doing path.resolve(section.content) would be enough?

@mik01aj
Copy link
Collaborator Author

mik01aj commented Jul 18, 2016

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants