An open API service indexing awesome lists of open source software.

https://github.com/yysun/apprun-code


https://github.com/yysun/apprun-code

Last synced: 11 months ago
JSON representation

Awesome Lists containing this project

README

          

## AppRun Code Editor

This project creates a web component for demonstrating HTML/JS code snippets in web pages, especially for documentation. e.g., It is used in the [AppRun documentation](https://apprun.js.org/docs/).

> It uses the [React Monaco Editor](https://github.com/suren-atoyan/monaco-react) for code editing. And run the code in a preview iframe.
>
> The web component is built with [AppRun](https://github.com/yysun/apprun).

## Use the web component

Place the web component in your HTML file under the code snippet you want to demo.

```html


// some HTML / JS /JSX code here

```

## Style the web component

You can style the web component with CSS. For example, you can set the height of the web component.

```html

```

You can set the width of the source code.
```html

```

You can also completely hide the source code, just to demo the code.

```html

```

## Development

* Use _npm start_ to start the dev server
* Use _npm run build_ to build the demo
* Use _npm run build:lib_ to build the web component