github-form-schema-html
v1.0.6
Published
Interpret the Syntax for GitHub's form schema and export a html form.
Downloads
7
Readme
GitHub Form Schema HTML
GitHub Form Schema HTML for GitHub's form schema
Features
GitHub Form Schema HTML convert your GitHub Issue Template in a real HTML Form. (Schema)
- Supported Types:
- Markdown
- Textarea
- Input
- Dropdown
- Checkboxes
- Primer CSS support
- TypeScript support
Setup
yarn add github-form-schema-html # yarn
npm i github-form-schema-html # npm
Basic usage
<form>
<div id="load"></div>
<button class="btn" type="submit">Submit</button>
</form>
import { GitHubFormSchemaHtml } from 'github-form-schema-html';
// basic
document.getElementById('load').innerHTML = new GitHubFormSchemaHtml({ yml: rawYml }).render();
// with fetch (optional, if yml content need loaded before)
fetch('./form.yml').then(res => res.text()).then(rawYml => {
document.getElementById('load').innerHTML = new GitHubFormSchemaHtml({ yml: rawYml }).render();
})
Development
- Clone this repository
- Install dependencies using
yarn install
ornpm install
- Change vite.confg.js to
mode:'development'
/minify:false
/sourcemap:true
- Start development server using
yarn dev
ornpm run dev
License
Copyright (c) 2022 Jonathan Schneider MIT License