@pretextbook/format
v0.0.5
Published
A utility to format PreTeXt source. To use,
Readme
PreTeXt Formatter
A utility to format PreTeXt source. To use,
npm install @pretextbook/formatand then import the formatter in your code:
import { format } from "@pretextbook/format";
const formatted = formatPretext(sourceCode);You can pass options as an object to customize the formatting. For example:
const options = {
blankLines: "many",
breakSentences: true,
insertSpaces: true,
tabSize: 2,
};
const formatted = formatPretext(sourceCode, options);This allows you to specify the maximum line length and indentation level for the formatted output.
Building
Run nx build format to build the library.
Running unit tests
Run nx test format to execute the unit tests via Vitest.
About
This library was generated with Nx.
