github-form-schema-html

Interpret the Syntax for GitHub's form schema and export a html form.


Keywords
github, issue
License
MIT
Install
npm install github-form-schema-html@1.0.6

Documentation

GitHub Form Schema HTML

GitHub Form Schema HTML

npm version npm downloads License

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

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Change vite.confg.js to mode:'development' / minify:false / sourcemap:true
  4. Start development server using yarn dev or npm run dev

License

Copyright (c) 2022 Jonathan Schneider MIT License