Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Feature to add a read only code viewer #14

Closed
swatikode opened this issue Sep 18, 2019 · 1 comment
Closed

Feature to add a read only code viewer #14

swatikode opened this issue Sep 18, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request released

Comments

@swatikode
Copy link
Contributor

Is your feature request related to a problem? Please describe.
carbon-graphs uses carbon-site-helpers to generate its demo site. When you take a look at the examples on the carbon-graphs demo site you don't know what code was written to generate that example. It will be a very nice feature if there was a way to see what Carbon API's were used. This will way it can help consumers take a direct look at the code instead of hunting it down in the carbon-graphs repo.

Describe the solution you'd like
Below the breadcrumb add a CodeIcon to show the code used to generate the tab content. The carbon-site-helpers app config will expect consumers to send a new property for instance, code which should be a call back function returning a string. When the code icon is clicked, carbon site will execute the call back function and the returned string value will be embedded in a code editor. To begin with we will use the javascript editor.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Mock-ups

1. A code icon will appear above the file content. On hovering it will add a highlight to it.
image

2. Clicking the code icon
image

@swatikode swatikode added the enhancement New feature or request label Sep 18, 2019
@swatikode swatikode self-assigned this Sep 20, 2019
abhijit945 pushed a commit that referenced this issue Sep 24, 2019
# [1.5.0](v1.4.2...v1.5.0) (2019-09-24)

### New

* Added code viewer for the page (fixes #14) (#15) ([6749212](6749212)), closes [#14](#14) [#15](#15) [#14](#14)
@abhijit945
Copy link
Contributor

🎉 This issue has been resolved in version 1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request released
Projects
None yet
Development

No branches or pull requests

2 participants