Skip to main content

LipsumUtils

Helpers generate test text for a variety of situations, in the standard Lorem-Ipsum utility system.

Functions

username

LipsumUtils.username(
randomRandom?--

Optional random

) → string

Generates a random username.

print(LipsumUtils.username()) --> LoremIpsum23

word

LipsumUtils.word(
randomRandom?--

Optional random

) → string

Generates a random word.

print(LipsumUtils.word()) --> Lipsum

words

LipsumUtils.words(
numWordsnumber,
randomRandom?--

Optional random

) → string

Generates a random set of words space-separated.

print(LipsumUtils.words(5)) --> 5 words

sentence

LipsumUtils.sentence(
numWordsnumber?,--

Defaults to a random number 6 to 12.

randomRandom?--

Optional random

) → string

Generates a random sentence.

print(LipsumUtils.sentence(7)) --> Sentence with 7 words.

paragraph

LipsumUtils.paragraph(
numSentencesnumber,
createSentence(() → string)?,--

Optional createSentence

randomRandom?--

Optional random

) → string

Generates a random paragraph.

print(LipsumUtils.paragraph(4)) --> Paragraph with 4 sentences.

document

LipsumUtils.document(
numParagraphsnumber,
createParagraph(() → string)?,--

Optional createParagraph

randomRandom?--

Optional random

) → string
print(LipsumUtils.document(3)) --> Document with 3 paragraphs
Show raw api
{
    "functions": [
        {
            "name": "username",
            "desc": "Generates a random username.\n\n```lua\nprint(LipsumUtils.username()) --> LoremIpsum23\n```",
            "params": [
                {
                    "name": "random",
                    "desc": "Optional random",
                    "lua_type": "Random?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 27,
                "path": "src/lipsum/src/Shared/LipsumUtils.lua"
            }
        },
        {
            "name": "word",
            "desc": "Generates a random word.\n\n```lua\nprint(LipsumUtils.word()) --> Lipsum\n```",
            "params": [
                {
                    "name": "random",
                    "desc": "Optional random",
                    "lua_type": "Random?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 68,
                "path": "src/lipsum/src/Shared/LipsumUtils.lua"
            }
        },
        {
            "name": "words",
            "desc": "Generates a random set of words space-separated.\n\n```lua\nprint(LipsumUtils.words(5)) --> 5 words\n```",
            "params": [
                {
                    "name": "numWords",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "random",
                    "desc": "Optional random",
                    "lua_type": "Random?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 83,
                "path": "src/lipsum/src/Shared/LipsumUtils.lua"
            }
        },
        {
            "name": "sentence",
            "desc": "Generates a random sentence.\n\n```lua\nprint(LipsumUtils.sentence(7)) --> Sentence with 7 words.\n```",
            "params": [
                {
                    "name": "numWords",
                    "desc": "Defaults to a random number 6 to 12.",
                    "lua_type": "number?"
                },
                {
                    "name": "random",
                    "desc": "Optional random",
                    "lua_type": "Random?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 110,
                "path": "src/lipsum/src/Shared/LipsumUtils.lua"
            }
        },
        {
            "name": "paragraph",
            "desc": "Generates a random paragraph.\n\n```lua\nprint(LipsumUtils.paragraph(4)) --> Paragraph with 4 sentences.\n```",
            "params": [
                {
                    "name": "numSentences",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "createSentence",
                    "desc": "Optional createSentence",
                    "lua_type": "(() -> string)?"
                },
                {
                    "name": "random",
                    "desc": "Optional random",
                    "lua_type": "Random?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 151,
                "path": "src/lipsum/src/Shared/LipsumUtils.lua"
            }
        },
        {
            "name": "document",
            "desc": "```lua\nprint(LipsumUtils.document(3)) --> Document with 3 paragraphs\n```",
            "params": [
                {
                    "name": "numParagraphs",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "createParagraph",
                    "desc": "Optional createParagraph",
                    "lua_type": "(() -> string)?"
                },
                {
                    "name": "random",
                    "desc": "Optional random",
                    "lua_type": "Random?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 179,
                "path": "src/lipsum/src/Shared/LipsumUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "LipsumUtils",
    "desc": "Helpers generate test text for a variety of situations, in the standard Lorem-Ipsum utility system.",
    "source": {
        "line": 5,
        "path": "src/lipsum/src/Shared/LipsumUtils.lua"
    }
}