JanetDocsPlaygroundI'm feeling luckyGitHub sign in

doc-format



    function
    boot.janet on line 2996, column 1

    (doc-format str &opt width indent colorize)

    Reformat a docstring to wrap a certain width. Docstrings can either 
    be plaintext or a subset of markdown. This allows a long single 
    line of prose or formatted text to be a well-formed docstring. 
    Returns a buffer containing the formatted text.


1 exampleSign in to add an example
Loading...
(print (doc-format "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." 30))

    Lorem ipsum dolor
    sit amet, consectetur
    adipiscing elit, sed
    do eiusmod tempor
    incididunt ut labore
    et dolore magna
    aliqua. Ut enim ad
    minim veniam, quis
    nostrud exercitation
    ullamco laboris nisi
    ut aliquip ex ea
    commodo consequat.
btbytesPlayground