Skip to content

Commit

Permalink
💽 commit: update
Browse files Browse the repository at this point in the history
  • Loading branch information
zrosenbauer committed Feb 7, 2024
1 parent a4d66bc commit 5f0202f
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 79 deletions.
72 changes: 36 additions & 36 deletions src/lib/Document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ export class Document {

/**
* Append a heading (h1) to the document.
*
*
* @example
* ```ts
* const doc = new Document()
* .h1('Hello, World!')
* .toString();
* // Output: # Hello, World!
* ```
*
*
* @param text A TextInput type, which can be a string, Text instance, or a function that returns a string or Text instance.
* @returns A new Document instance with the heading appended.
*/
Expand All @@ -223,15 +223,15 @@ export class Document {

/**
* Append a heading (h2) to the document.
*
*
* @example
* ```ts
* const doc = new Document()
* .h2('Hello, World!')
* .toString();
* // Output: ## Hello, World!
* ```
*
*
* @param text A TextInput type, which can be a string, Text instance, or a function that returns a string or Text instance.
* @returns A new Document instance with the heading appended.
*/
Expand All @@ -249,15 +249,15 @@ export class Document {

/**
* Append a heading (h3) to the document.
*
*
* @example
* ```ts
* const doc = new Document()
* .h3('Hello, World!')
* .toString();
* // Output: ### Hello, World!
* ```
*
*
* @param text A TextInput type, which can be a string, Text instance, or a function that returns a string or Text instance.
* @returns A new Document instance with the heading appended.
*/
Expand All @@ -275,15 +275,15 @@ export class Document {

/**
* Append a heading (h4) to the document.
*
*
* @example
* ```ts
* const doc = new Document()
* .h4('Hello, World!')
* .toString();
* // Output: #### Hello, World!
* ```
*
*
* @param text A TextInput type, which can be a string, Text instance, or a function that returns a string or Text instance.
* @returns A new Document instance with the heading appended.
*/
Expand All @@ -301,15 +301,15 @@ export class Document {

/**
* Append a heading (h5) to the document.
*
*
* @example
* ```ts
* const doc = new Document()
* .h5('Hello, World!')
* .toString();
* // Output: ##### Hello, World!
* ```
*
*
* @param text A TextInput type, which can be a string, Text instance, or a function that returns a string or Text instance.
* @returns A new Document instance with the heading appended.
*/
Expand All @@ -327,15 +327,15 @@ export class Document {

/**
* Append a heading (h6) to the document.
*
*
* @example
* ```ts
* const doc = new Document()
* .h6('Hello, World!')
* .toString();
* // Output: ##### Hello, World!
* ```
*
*
* @param text A TextInput type, which can be a string, Text instance, or a function that returns a string or Text instance.
* @returns A new Document instance with the heading appended.
*/
Expand All @@ -359,15 +359,15 @@ export class Document {

/**
* Append a paragraph to the document.
*
*
* @example
* ```ts
* const doc = new Document()
* .paragraph('This is a paragraph of text.')
* .toString();
* // Output: This is a paragraph of text.
* ```
*
*
* @param text A TextInput type, which can be a string, Text instance, or a function that returns a string or Text instance.
* @returns A new Document instance with the paragraph appended.
*/
Expand All @@ -388,7 +388,7 @@ export class Document {

/**
* Append a table to the document.
*
*
* @example
* ```ts
* const doc = new Document()
Expand All @@ -404,7 +404,7 @@ export class Document {
* // | John Doe | jdoe@gmail.com |
* // | Jane Doe | jane@gmail.com |
* ```
*
*
* @param tableDefinition An array of arrays of the TextInput type, which can be a string, Text instance, or a function that returns a string or Text instance. With the first array being the header row.
* @returns A new Document instance with the table appended.
*/
Expand Down Expand Up @@ -433,15 +433,15 @@ export class Document {

/**
* Append a raw HTML string to the document.
*
*
* @example
* ```ts
* const doc = new Document()
* .html('<p align="center">Hello, World!</p>')
* .toString();
* // Output: <p align="center">Hello, World!</p>
* ```
*
*
* @param html A string of raw HTML.
* @returns A new Document instance with the HTML appended.
*/
Expand All @@ -456,15 +456,15 @@ export class Document {

/**
* Append a code block to the document.
*
*
* @example
* ```ts
* const doc = new Document()
* .codeBlock(`
* const x = 10;
*
*
* console.log(x);
* `.trim(),
* `.trim(),
* 'javascript'
* )
* .toString();
Expand All @@ -475,7 +475,7 @@ export class Document {
* // console.log(x);
* // ```
* ```
*
*
* @param code A string of code.
* @param language A supported language for the code block.
* @returns A new Document instance with the code block appended.
Expand All @@ -494,15 +494,15 @@ export class Document {

/**
* Append a block quote to the document.
*
*
* @example
* ```ts
* const doc = new Document()
* .blockQuote('This is a block quote.')
* .toString();
* // Output: > This is a block quote.
* ```
*
*
* @param text A TextInput type, which can be a string, Text instance, or a function that returns a string or Text instance.
* @returns A new Document instance with the block quote appended.
*/
Expand All @@ -517,15 +517,15 @@ export class Document {

/**
* Append an image to the document.
*
*
* @example
* ```ts
* const doc = new Document()
* .image('Alt text', 'https://example.com/image.png')
* .toString();
* // Output: ![Alt text](https://example.com/image.png)
* ```
*
*
* @param text A TextInput type, which can be a string, Text instance, or a function that returns a string or Text instance.
* @param src A string of the image source.
* @returns A new Document instance with the image appended.
Expand All @@ -544,15 +544,15 @@ export class Document {

/**
* Append a thematic break to the document.
*
*
* @example
* ```ts
* const doc = new Document()
* .break()
* .toString();
* // Output: ---
* ```
*
*
* @returns A new Document instance with the thematic break appended.
*/
public break(): this {
Expand All @@ -572,7 +572,7 @@ export class Document {

/**
* Append a number list to the document.
*
*
* @example
* ```ts
* const doc = new Document()
Expand All @@ -587,7 +587,7 @@ export class Document {
* // 2. Item 2
* // 3. Item 3
* ```
*
*
* @param text An array of TextInput types, which can be a string, Text instance, or a function that returns a string or Text instance.
* @returns A new Document instance with the number list appended.
*/
Expand All @@ -607,7 +607,7 @@ export class Document {

/**
* Append a bullet list to the document.
*
*
* @example
* ```ts
* const doc = new Document()
Expand All @@ -622,7 +622,7 @@ export class Document {
* // - Item 2
* // - Item 3
* ```
*
*
* @param text An array of TextInput types, which can be a string, Text instance, or a function that returns a string or Text instance.
* @returns A new Document instance with the bullet list appended.
*/
Expand All @@ -648,7 +648,7 @@ export class Document {

/**
* Convert the document to string representation, that can be used for rendering.
*
*
* @example
* ```ts
* const doc = new Document()
Expand All @@ -660,7 +660,7 @@ export class Document {
* //
* // This is a paragraph of text.
* ```
*
*
* @returns A string representation of the document, that can be used for rendering.
*/
public toString(): string {
Expand All @@ -673,7 +673,7 @@ export class Document {

/**
* Convert the document to a JSON representation, that can be used for serialization.
*
*
* @example
* ```ts
* const doc = new Document()
Expand Down Expand Up @@ -709,7 +709,7 @@ export class Document {
* // }
* // ]
* ```
*
*
* @returns A JSON representation of the document, that can be used for serialization.
*/
public toJSON(): DocumentNode[] {
Expand Down
Loading

0 comments on commit 5f0202f

Please sign in to comment.