Skip to content

wmfs/cardscript-table-of-contents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cardscript-table-of-contents

Tymly Cardscript CircleCI npm (scoped) codecov CodeFactor Dependabot badge Commitizen friendly JavaScript Style Guide license

Extracts a table-of-contents from some Cardscript.

Install

$ npm install cardscript-table-of-contents --save

Usage

const extractToc = require('@wmfs/cardscript-table-of-contents')

const toc = extractToc(
  {
    "type": "AdaptiveCard",
    "body": [
      {
        "type": "TextBlock",
        "text": "Change me!",
        "color": "attention",
        "horizontalAlignment": "center"
      }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.0"
  }
)

Testing

$ npm test

License

MIT