<commit_before>// Numbering and bullet points example
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { AlignmentType, Document, Packer, Paragraph } from "../build";

const doc = new Document({
    numbering: {
        config: [
            {
                reference: "my-crazy-numbering",
                levels: [
                    {
                        level: 0,
                        format: "upperRoman",
                        text: "%1",
                        alignment: AlignmentType.START,
                        style: {
                            paragraph: {
                                indent: { left: 720, hanging: 260 },
                            },
                        },
                    },
                    {
                        level: 1,
                        format: "decimal",
                        text: "%2.",
                        alignment: AlignmentType.START,
                        style: {
                            paragraph: {
                                indent: { left: 1440, hanging: 980 },
                            },
                        },
                    },
                    {
                        level: 2,
                        format: "lowerLetter",
                        text: "%3)",
                        alignment: AlignmentType.START,
                        style: {
                            paragraph: {
                                indent: { left: 2160, hanging: 1700 },
                            },
                        },
                    },
                ],
            },
        ],
    },
});

doc.addSection({
    children: [
        new Paragraph({
            text: "Hey you",
            numbering: {
                reference: "my-crazy-numbering",
                level: 0,
            },
        }),
        new Paragraph({
            text: "What's up fam",
            numbering: {
                reference: "my-crazy-numbering",
                level: 1,
            },
        }),
        new Paragraph({
            text: "Hello World 2",
            numbering: {
                reference: "my-crazy-numbering",
                level: 1,
            },
        }),
        new Paragraph({
            text: "Yeah boi",
            numbering: {
                reference: "my-crazy-numbering",
                level: 2,
            },
        }),
        new Paragraph({
            text: "Hey you",
            bullet: {
                level: 0,
            },
        }),
        new Paragraph({
            text: "What's up fam",
            bullet: {
                level: 1,
            },
        }),
        new Paragraph({
            text: "Hello World 2",
            bullet: {
                level: 2,
            },
        }),
        new Paragraph({
            text: "Yeah boi",
            bullet: {
                level: 3,
            },
        }),
    ],
});

Packer.toBuffer(doc).then((buffer) => {
    fs.writeFileSync("My Document.docx", buffer);
});<commit_msg>Update numbering demo to add more numbering levels<commit_after>// Numbering and bullet points example
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { AlignmentType, Document, Packer, Paragraph } from "../build";

const doc = new Document({
    numbering: {
        config: [
            {
                reference: "my-crazy-numbering",
                levels: [
                    {
                        level: 0,
                        format: "upperRoman",
                        text: "%1",
                        alignment: AlignmentType.START,
                        style: {
                            paragraph: {
                                indent: { left: 720, hanging: 260 },
                            },
                        },
                    },
                    {
                        level: 1,
                        format: "decimal",
                        text: "%2.",
                        alignment: AlignmentType.START,
                        style: {
                            paragraph: {
                                indent: { left: 1440, hanging: 980 },
                            },
                        },
                    },
                    {
                        level: 2,
                        format: "lowerLetter",
                        text: "%3)",
                        alignment: AlignmentType.START,
                        style: {
                            paragraph: {
                                indent: { left: 2160, hanging: 1700 },
                            },
                        },
                    },
                    {
                        level: 3,
                        format: "upperLetter",
                        text: "%4)",
                        alignment: AlignmentType.START,
                        style: {
                            paragraph: {
                                indent: { left: 2880, hanging: 2420 },
                            },
                        },
                    },
                ],
            },
        ],
    },
});

doc.addSection({
    children: [
        new Paragraph({
            text: "Hey you",
            numbering: {
                reference: "my-crazy-numbering",
                level: 0,
            },
        }),
        new Paragraph({
            text: "What's up fam",
            numbering: {
                reference: "my-crazy-numbering",
                level: 1,
            },
        }),
        new Paragraph({
            text: "Hello World 2",
            numbering: {
                reference: "my-crazy-numbering",
                level: 1,
            },
        }),
        new Paragraph({
            text: "Yeah boi",
            numbering: {
                reference: "my-crazy-numbering",
                level: 2,
            },
        }),
        new Paragraph({
            text: "Hey you",
            bullet: {
                level: 0,
            },
        }),
        new Paragraph({
            text: "What's up fam",
            bullet: {
                level: 1,
            },
        }),
        new Paragraph({
            text: "Hello World 2",
            bullet: {
                level: 2,
            },
        }),
        new Paragraph({
            text: "Yeah boi",
            bullet: {
                level: 3,
            },
        }),
        new Paragraph({
            text: "101 MSXFM",
            numbering: {
                reference: "my-crazy-numbering",
                level: 3,
            },
        }),
        new Paragraph({
            text: "back to level 1",
            numbering: {
                reference: "my-crazy-numbering",
                level: 1,
            },
        }),
        new Paragraph({
            text: "back to level 0",
            numbering: {
                reference: "my-crazy-numbering",
                level: 0,
            },
        }),
    ],
});

Packer.toBuffer(doc).then((buffer) => {
    fs.writeFileSync("My Document.docx", buffer);
});
{'fraction_non_alphanumeric': 0.10520471894517697, 'fraction_numerical': 0.012768910478834142, 'mean_word_length': 0.7169406719085061, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '805767', 'n_tokens_mistral': 1784, 'n_tokens_neox': 1599, 'n_words': 386}