GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - askdown/core: Parser, serializer and validator for Askdown — a Markdown-like language for forms.

BranchesTags
Open more actions menu

Latest commit

 

History

1 Commit
1 Commit

Folders and files

NameName
Last commit message
Last commit date
scripts
scripts
 
 
src
src
 
 
test
test
 
 
vendor/spec
vendor/spec
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package.json
package.json
 
 
tsconfig.base.json
tsconfig.base.json
 
 
tsconfig.build.json
tsconfig.build.json
 
 
tsconfig.json
tsconfig.json
 
 
vitest.config.ts
vitest.config.ts
 
 
vlt-lock.json
vlt-lock.json
 
 
vlt.json
vlt.json
 
 

Repository files navigation

@askdown/core

Parser, serializer and validator for Askdown, a Markdown-like language for forms.

npm install @askdown/core
import { parse, serialize, validateResponse } from '@askdown/core';

const { form, diagnostics } = parse(`
? Name *
___

? Will you attend?
- ( ) Yes
- ( ) No
`);

serialize(form); // canonical Askdown text

validateResponse(form, { name: 'Ada', 'will-you-attend': 'Yes' });
// { valid: true, errors: [], answers: { ... }, pages: [0] }

Zero dependencies. Runs in browsers, Node.js, Deno, Bun and Cloudflare Workers.

API

Function
parse(source) Parse Askdown text into { form, diagnostics, locations }. Never throws.
serialize(form, { explicitIds? }) Convert a form to canonical Askdown text.
pinIds(source) Add {#id} to every question and page without one, changing only those lines.
validateForm(form) Check rules the JSON Schema can't express (unique ids, jump targets…).
validateResponse(form, answers) Validate and normalize a response, following jumps.
checkAnswer(question, value) Validate a single answer.
nextPage(form, pageIndex, answers), visitedPages(form, answers) Branching logic.
renderMarkdown(md), renderInline(md) The safe Markdown subset used in forms.

The JSON form model is described by the JSON Schema and the spec.

About

Parser, serializer and validator for Askdown — a Markdown-like language for forms.

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.