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.
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.
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:
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.
So it would be good to provide some sort of hook to allow for arbitrary preprocessing of the source file.