skypager-project
Version:
skypager project framework
112 lines (75 loc) • 1.87 kB
Markdown
---
type: example
spec: true
metadata:
key1: value1
key2: value2
flag: true
tags:
- examples
- specs
---
# Example
These are some introductory nodes.
- list item one
- list item two
I Highlight some `Domain Specific Words`
And I include [Links](toSomeShit "This is a Title")
Here is a [Reference Style Link][EXAMPLE.spec.md]
Here is an Image: 
Here is a ![Reference Image][skypagerLogo]
## Actual Input
This section contains code blocks. Skypager should be able to convert these into a module for us.
### Code Sample One
```javascript
import Skypager from 'skypager'
import project from 'skypager/current'
export default (project) => {
return project
}
```
### Code Sample Two
```javascript
const project = require('skypager/current')
module.exports = {
getProject() {
return project
}
}
```
### Code Sample Three
```javascript
const { project } = global
project.cli.print('Hello World')
```
## Specs
### Querying the markdown AST
#### Get all of the heading nodes
```javascript
const headingNodes = doc.selectHeadingNodes()
headingNodes.should.not.be.empty
```
You can even pass a test function
```javascript
const filtered = doc.selectHeadingNodes(n => n.depth > 3)
filtered.should.not.be.empty
```
#### Get all of the code blocks
```javascript
const jsNodes = doc.selectCodeBlocks('javascript')
jsNodes.should.not.be.empty
```
## Setup
This code will be run once at the beginning of the document context initialization
```javascript
import React from 'react'
import ReactDOM from 'react-dom'
```
## Teardown
This code will be run at the end of each run
```javascript
doc.teardownComplete = true
```
## Links
[EXAMPLE.spec.md]: "https://skypager.io" "This is a Title Man"
[skypagerLogo]: "assets/skypager-logo-1024.png" "Skypager 1024x1024 Logo"