From 26443e0604ccfafd9e87e717896e5f0081ba3eec Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 10 Apr 2023 21:27:01 +0200 Subject: [PATCH] readme --- README.md | 27 +++++++++++++++++---------- src/index.ts | 4 ---- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index b76247c..aa37107 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,31 @@ -# wow-toc -[![Build Status](http://img.shields.io/travis/zekesonxx/wow-toc.svg)](https://travis-ci.org/zekesonxx/wow-toc) +# wow-toc-parser +World Of Warcraft addon `.toc` file parser. Written in typescript. -World Of Warcraft addon `.toc` file parser. Written in Node.js. +## Ressources +This implementation is based on based on [wow-toc](https://github.com/zekesonxx/wow-toc) by [Zoey Mertes](https://github.com/zekesonxx). -Built on the documentation at [Wowpedia](http://wowpedia.org/TOC_format). +Furthermore the following documentation was used to create this tool: +- http://wowpedia.org/TOC_format +- https://wowwiki-archive.fandom.com/wiki/TOC_format +- https://wowpedia.fandom.com/wiki/TOC_format ## Usage +// TODO publish `$ npm install wow-toc` -````js -var wowtoc = require('wow-toc'); +````ts +import { open } from 'fs/promises'; +import { parse } from 'wow-toc-parser' -var k = wowtoc.parse(fs.readFileSync('somefile.toc')); -wowtoc.stringify(k); +const file = await open(__dirname + '/../test/empty.toc', 'r'); +const toc = await parse(file) + +console.log(toc) ```` ## Notes / Caveats * Does not acknowledge `#@no-lib-strip@`/`#@end-no-lib-strip@` -* `Dependencies`/`OptionalDeps`/etc remain strings (easy to convert to arrays anyways) -* Doesn't validate tag names (`## Bacon: Strip` is valid to it but not to WoW) ## License +// TODO Apache MIT. See `LICENSE` \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 6dca0c3..4b317f6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,3 @@ -/* -https://wowwiki-archive.fandom.com/wiki/TOC_format -https://wowpedia.fandom.com/wiki/TOC_format -*/ import { FileHandle } from 'fs/promises'; export const TOC_PREFIX_TAG = '## '