Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service_name: travis-ci
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@types/* linguist-generated=true
dist/* linguist-generated=true
**/__snapshots__/* linguist-generated=true
**/examples/* linguist-generated=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,4 @@ package-lock.json
**/webpack.config.js

**/*.js.map
coverage
21 changes: 18 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,23 @@ notifications:
email:
on_success: never
on_failure: change
branches:
only:
- master
- dev
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
node_js:
- stable
- "node"
script:
- npm tslint
- npm test
- npm run tslint
- npm run test-ci
after_script:
- npm run coveralls
deploy:
provider: npm
email: $SIMPLR_NPM_EMAIL
api_key: $SIMPLR_NPM_API_KEY
skip_cleanup: true
on:
tags: true
repo: SimplrJS/markdown
19 changes: 19 additions & 0 deletions .vscode/cSpell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// cSpell Settings
{
// Version of the setting file. Always 0.1
"version": "0.1",
// language - current active spelling language
"language": "en",
// words - list of words to be always considered correct
"words": [
"AGPL",
"loglevel",
"simplrjs"
],
// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
// For example "hte" should be "the"
"flagWords": [
"hte"
]
}
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"preLaunchTask": "build",
"program": "${workspaceRoot}\\src\\debug.ts",
"outFiles": [
"${workspaceRoot}\\dist\\**\\*.js"
],
"sourceMaps": true
}
]
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"eslint.enable": false,
"typescript.tsdk": "node_modules\\typescript\\lib",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"tests/**/__tests__/**/*.test.ts": true
}
}
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "npm",
"script": "build",
"problemMatcher": [
"$tsc"
]
}
]
}
71 changes: 71 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<p align="left">
<a href="https://www.npmjs.com/package/@simplrjs/markdown">
<img src="https://img.shields.io/npm/v/@simplrjs/markdown.svg?style=flat-square" alt="version" />
</a>
<a href="https://travis-ci.org/SimplrJS/markdown">
<img src="https://img.shields.io/travis/SimplrJS/markdown.svg?style=flat-square" alt="build" />
</a>
<a href="https://david-dm.org/simplrjs/markdown">
<img src="https://img.shields.io/david/SimplrJS/markdown.svg?style=flat-square" alt="dependencies" />
</a>
<a href="https://david-dm.org/simplrjs/markdown?type=dev">
<img src="https://img.shields.io/david/dev/SimplrJS/markdown.svg?style=flat-square" alt="devDependencies" />
</a>
<a href="https://coveralls.io/github/SimplrJS/markdown">
<img src="https://img.shields.io/coveralls/github/simplrjs/markdown.svg?style=flat-square" alt="license" />
</a>
</p>

<h1 align="center">@simplrjs/markdown</h1>

Creating markdown made easily.

## Get started
```sh
$ npm install @simplrjs/markdown --save
```

## Features
* Creating Markdown output

## TODO
* Markdown file parser

## Simple examples

Using `MarkdownBuilder`.

```typescript
import * as fs from "fs-extra";
import { MarkdownBuilder } from "@simplrjs/markdown";

const builder = new MarkdownBuilder()
.UnderlineHeader("Markdown Header", 1)
.EmptyLine()
.Text(md => `Hello ${md.Bold("World")}!`)
.Text("It's so easy to print markdown this way!");

fs.writeFile("./text.md", builder.Build());
```

You can use `MarkdownGenerator` directly.

```typescript
import * as fs from "fs-extra";
import { MarkdownGenerator } from "@simplrjs/markdown";

let output: string[] = [];

output = output.concat(MarkdownGenerator.UnderlineHeader("Markdown Header", 1));
output.push("");
output.push(`Hello ${MarkdownGenerator.Bold("World")}!`);

fs.writeFile("./text.md", output.join("\n"));
```


## API
WIP

## License
Released under the [MIT license](LICENSE).
31 changes: 31 additions & 0 deletions __tests__/__snapshots__/helpers.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions __tests__/__snapshots__/markdown-builder.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading