🚀 Launch Week Day 2:Introducing Custom Tabs for Org Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

whatastory-mark-parser

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

whatastory-mark-parser

A markup language for storyboards. This is just the parser component.

unpublished
latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

whatastory-mark-parser

Build Status Coverage Status

This is the parser component of wnatastory-mark. It takes a document (a string representation of a storyboard written in whatastory-mark) and outputs an object representation of that document.

Usage

const opts = {
  panelSeparator: /^==+/,
  subpanelSeparator: /^--+/,
  panelItemMatchers: {
    modifiers: /^\((.*)\)$/,
    sfx: /^<(.*)>$/,
    caption: /^\[(.*)\]$/,
    dialog: /^"(.*)"$/
  },
  allowedModifiers: [
    'frameless',
    'narrow',
    'wide',
    'tall',
    'short'
  ]
}

// configure the parser
const parser = require('whatastory-mark-parser')(opts)

// set up a template; you can use handlebars, pug or any of those
const rendererSource = require('./my-renderer.handlebars')
const render = Handlebars.compile(rendererSource)

// parse and feed the result to the template
const data = parser.parse(source)
const result = render(data)
console.log(result)

Options

  • panelSeparator - Regular expression used for detecting panel delimiters.
  • subpanelSeparator - Regular expression used for detecting subpanel delimiters.
  • panelItemMatchers - Regular expressions used for detecting panel items.
    • modifiers - Regular expression used for detecting lists of modifiers.
  • allowedModifiers - List of known modifiers. Unrecognized modifiers will be ignored.

FAQs

Package last updated on 13 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts