typescript-book/tools
2023-09-12 18:11:00 +02:00
..
.vscode Lint check (#42) 2023-07-21 13:08:21 +02:00
.markdownlint.json Fix minor errors (#63) 2023-08-21 19:56:44 +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
config.ts Lint check (#42) 2023-07-21 13:08:21 +02:00
format.ts TypeScript 5.2 using declaration (#71) 2023-09-11 17:58:00 +02:00
i18n.ts Checks on pre-commit and pre-push (#39) 2023-07-18 16:56:30 +02:00
lint.ts Fix issue with tooling after upgrade to Prettier 3.0.3 (#73) 2023-09-11 18:29:18 +02:00
make-books.sh Update warning message in tooling (#53) 2023-07-23 11:01:00 +02:00
package-lock.json TypeScript 5.2 using declaration (#71) 2023-09-11 17:58:00 +02:00
package.json TypeScript 5.2 Metadata (#74) 2023-09-12 18:11:00 +02:00
README.md Improve README for tooling folder and logs (#54) 2023-07-23 11:37:04 +02:00
tsconfig.json TypeScript 5.2 Metadata (#74) 2023-09-12 18:11:00 +02:00
utils.ts Lint check (#42) 2023-07-21 13:08:21 +02:00

Tools for Working with Markdown Books

If you're working with Markdown books, here are some essential tools and commands to help you streamline your workflow.

Installation

Before you begin, ensure you have Node.js installed. To set up the required dependencies, use the following commands:

nvm use
npm install

Formatting

Consistent code formatting is crucial. To format all TypeScript snippets, we use Prettier. Execute the following command for formatting:

npm run format

Compilation

To compile TypeScript snippets within the Markdown files, utilize the following command:

npm run compile

Linting

To ensure that your Markdown files adhere to proper formatting rules, use the linting command:

npm run lint:md

Linting and Formatting

For a comprehensive process that includes linting all Markdown files, applying Prettier formatting to all TypeScript snippets, and compiling them using TypeScript, use the following command:

npm run check

Skipping Compilation

If you have specific snippets in the Markdown files that you don't want to compile, simply add <!-- skip --> just before the TypeScript demarcation for those snippets.

Epub Generation

To generate Epub files from your Markdown books, navigate to the `tools`` folder and run the following command:

make-books.sh

After generating the Epub files, thoroughly test them, and once you're satisfied with the results, commit the changes.

These tools will assist you in efficiently working with Markdown books and ensure a smooth and organized process. Happy writing!