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

View Source #7

Open
jamiebuilds opened this issue Dec 19, 2019 · 0 comments
Open

View Source #7

jamiebuilds opened this issue Dec 19, 2019 · 0 comments
Labels
Ported from main repo Old feature ideas ported from react-cosmos repository

Comments

@jamiebuilds
Copy link

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.

@ovidiuch ovidiuch transferred this issue from react-cosmos/react-cosmos Jan 13, 2020
@ovidiuch ovidiuch added the Ported from main repo Old feature ideas ported from react-cosmos repository label Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ported from main repo Old feature ideas ported from react-cosmos repository
Projects
None yet
Development

No branches or pull requests

2 participants