typescript-book/tools
2023-07-18 16:56:30 +02:00
..
.nvmrc Add README and .nvmrc to tools folder (#16) 2023-06-20 23:19:00 +02:00
.prettierrc Tooling check TypeScript snippets from markdown (#14) 2023-06-20 23:04:42 +02:00
compile.ts Checks on pre-commit and pre-push (#39) 2023-07-18 16:56:30 +02:00
format.ts Checks on pre-commit and pre-push (#39) 2023-07-18 16:56:30 +02:00
i18n.ts Checks on pre-commit and pre-push (#39) 2023-07-18 16:56:30 +02:00
package-lock.json Checks on pre-commit and pre-push (#39) 2023-07-18 16:56:30 +02:00
package.json Checks on pre-commit and pre-push (#39) 2023-07-18 16:56:30 +02:00
README.md Checks on pre-commit and pre-push (#39) 2023-07-18 16:56:30 +02:00
tsconfig.json Tooling check TypeScript snippets from markdown (#14) 2023-06-20 23:04:42 +02:00
utils.ts Checks on pre-commit and pre-push (#39) 2023-07-18 16:56:30 +02:00

Tools

These are tools for working with Markdown books.

To install, use nvm use and npm i.

To format all TypeScript snippets using Prettier, use npm run format.

To compile snippets using TypeScript, use npm run compile.

To apply Prettier formatting to all TypeScript snippets and compile them using TypeScript, use npm run check.

To mark snippets that you do not want to compile, use <!-- skip --> just before the TypeScript demarcation.

Generate epub file for English version:

pandoc -o downloads/typescript-book.epub --metadata title="The Concise TypeScript Book" --metadata author="Simone Poggiali"  -s README.md

Generate epub file for Chinese version:

pandoc -o downloads/typescript-book-zh_CN.epub --metadata title="The Concise TypeScript Book" --metadata author="Simone Poggiali"  -s README-zh_CN.md