Skip to content

View Source #7

Open
Open
@jamiebuilds

Description

@jamiebuilds

What's up?

When statically deploying React Cosmos fixtures, it would be nice to be able to have a "View Source" button that displays the source code for the fixture within the Cosmos UI. This would make it a nicer tool for documenting component frameworks and such.

Mkay, tell me more...

Here's an example from the Atlaskit UI framework:

Screen Shot 2019-12-18 at 4 37 38 PM

Users of the documentation can look at code examples right next to the rendered version of the code.

But behind the scenes this is not the raw source code, it's actually be slightly preprocessed so that the imports are rewritten to be package names instead of relative paths.

- import Badge from "../src/index.tsx"
+ import Badge from "@atlaskit/badge"

So it would be good to provide some sort of hook to allow for arbitrary preprocessing of the source file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ported from main repoOld feature ideas ported from react-cosmos repository

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions