Skip to content

Commit 1ca6b63

Browse files
committed
Lint and generate docs
1 parent 922c59e commit 1ca6b63

File tree

9 files changed

+273
-10
lines changed

9 files changed

+273
-10
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,5 @@ dist
102102

103103
# TernJS port file
104104
.tern-port
105+
106+
docs

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/dist
2+
/docs

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
# typescript-project-template
1+
# bbcode-ast
22

3-
Template repo for new TypeScript projects.
3+
Generates an Abstract Syntax Tree (AST) from a chunk of BBCode.
44

5-
This repo assumes the following:
5+
## Installation
66

7-
- Source code lives in the `src` directory.
8-
- The main export is located in `src/index.ts`.
9-
- Tests live in the `test` directory.
10-
- Each test is name `<name>.test.ts`.
11-
- The `npm_token`, `app_id`, and `app_private_key` secrets are present in the repo.
12-
- The code will be a CommonJS module.
7+
```bash
8+
npm install --save bbcode-ast
9+
```
10+
11+
## Usage
12+
13+
You can either use the default parser or construct your own parser. Once you have a `Parser`, call the `parse` method on
14+
it.
15+
16+
It will return the root node of the AST.
17+
18+
You can navigate through the tree by accessing the `children` attribute of the root node and recursively inspecting
19+
the `children` of child nodes.

package-lock.json

Lines changed: 163 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"mocha": "^10.0.0",
3333
"prettier": "^2.7.1",
3434
"ts-node": "^10.9.1",
35+
"typedoc": "^0.23.10",
3536
"typescript": "^4.7.4"
3637
}
3738
}

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ const defaultTags = [
2121
"code",
2222
"quote",
2323
];
24+
/**
25+
* The default BBcode parser. Implements the tags used on the website [MyAnimeList](https://myanimelist.net/info.php?go=bbcode).
26+
*/
2427
const defaultParser = new Parser(defaultTags, false);
2528
export default defaultParser;

0 commit comments

Comments
 (0)