typescript-book/tools
2024-01-18 15:53:12 +01:00
..
.vscode Website (#93) 2024-01-17 16:59:09 +01:00
test-md Website (#93) 2024-01-17 16:59:09 +01: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
make-website-content.py Website (#93) 2024-01-17 16:59:09 +01:00
Makefile Gix publish on GitHub pages (#97) 2024-01-18 15:38:52 +01:00
package-lock.json Remove husky (#92) 2024-01-15 20:27:17 +01:00
package.json Remove husky (#92) 2024-01-15 20:27:17 +01:00
README.md Fix formatting in mds (#98) 2024-01-18 15:53:12 +01: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

Commands

Use make to run the main commands:

  • make format: Format Markdown files for books.
  • make check: Run several checks to ensure the Markdown files are valid.
  • make website: Create different Markdown pages for the website.
  • make website-deploy: Build and deploy website to GitHub Pages.
  • make books: Create .epub books.

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!