|
1 | | -# Remark SnackPlayer |
| 1 | +<h1 align="center"> Remark SnackPlayer </h1> |
2 | 2 |
|
| 3 | +Remark plugin to embed [Expo Snack's](https://snack.expo.io/) using Code Blocks |
| 4 | + |
| 5 | +<hr> |
3 | 6 |
|
4 | 7 | <p align="center"> |
5 | 8 |
|
|
15 | 18 |
|
16 | 19 | </p> |
17 | 20 |
|
18 | | -<p align="center"> |
19 | | - <a href="#key-features">Key Features</a> • |
20 | | - <a href="#howto">How To Use</a> • |
21 | | - <a href="#credits">Credits</a> |
22 | | -</p> |
| 21 | +## Installing |
| 22 | + |
| 23 | +`npm install remark-snackplayer` |
| 24 | + |
| 25 | +or |
| 26 | + |
| 27 | +`yarn add remark-snackplayer` |
| 28 | + |
| 29 | +## Usage |
| 30 | + |
| 31 | +This plugin parses codeblocks with language set as `SnackPlayer` and replaces them with embedded Expo's SnackPlayers, you can also provide parameters along with the codeblock to set some basic details. |
| 32 | + |
| 33 | +Example Code Block: |
| 34 | + |
| 35 | +```` |
| 36 | +
|
| 37 | +```SnackPlayer name=Hello%20World description=This%20is%20a%20description |
| 38 | +import React from 'react'; |
| 39 | +import { Text, View } from 'react-native'; |
| 40 | +
|
| 41 | +const YourApp = () => { |
| 42 | + return ( |
| 43 | + <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}> |
| 44 | + <Text> |
| 45 | + Try editing me! 🎉 |
| 46 | + </Text> |
| 47 | + </View> |
| 48 | + ); |
| 49 | +} |
| 50 | +
|
| 51 | +export default YourApp;``` |
| 52 | +
|
| 53 | +
|
| 54 | +```` |
| 55 | + |
| 56 | +The above code snippet would look like this on your page |
| 57 | + |
| 58 | +<img width="783" alt="Screenshot 2020-10-03 at 1 11 19 AM" src="https://user-images.githubusercontent.com/11258286/94963203-67de3500-0515-11eb-974a-a2289c0bfdc8.png"> |
| 59 | + |
| 60 | + |
| 61 | +Parameters: |
| 62 | + |
| 63 | +| Name | Description | Default | |
| 64 | +| ------------------ | -------------------------- | ----------------- | |
| 65 | +| name | SnackPlayer Name | "Example" | |
| 66 | +| description | Description of the example | "Example usage" | |
| 67 | +| platform | Example Platform | "ios" | |
| 68 | +| supportedPlatforms | Supported Platforms | "ios,android,web" | |
| 69 | + |
| 70 | +## To Do |
| 71 | + |
| 72 | +* Support Passing Configuration Parameters |
| 73 | +* Fix and Document Mobile Fallback |
| 74 | +* Write Comprehensive tests |
| 75 | + |
| 76 | +## License |
| 77 | + |
| 78 | +[MIT](./LICENSE) © Darsh Patel |
0 commit comments