How to use the jishaku.codeblocks.Codeblock function in jishaku

To help you get started, we’ve selected a few jishaku examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Gorialis / jishaku / tests / test_converter.py View on Github external
"""

    codeblock = codeblock_converter(inspect.cleandoc(text))
    assert isinstance(codeblock, Codeblock)
    assert codeblock.content.strip() == 'se``ven'
    assert not codeblock.language

    text = "``ei`ght``"
    codeblock = codeblock_converter(text)
    assert isinstance(codeblock, Codeblock)
    assert codeblock.content.strip() == 'ei`ght'
    assert not codeblock.language

    text = "`nine`"
    codeblock = codeblock_converter(text)
    assert isinstance(codeblock, Codeblock)
    assert codeblock.content.strip() == 'nine'
    assert not codeblock.language
github Gorialis / jishaku / tests / test_converter.py View on Github external
def test_codeblock_converter():
    text = """
    ```py
    one
    ```
    """

    codeblock = codeblock_converter(inspect.cleandoc(text))

    assert isinstance(codeblock, Codeblock)
    assert codeblock.content.strip() == 'one'
    assert codeblock.language == 'py'

    text = """
    ```sql
    two
    ```
    """

    codeblock = codeblock_converter(inspect.cleandoc(text))

    assert isinstance(codeblock, Codeblock)
    assert codeblock.content.strip() == 'two'
    assert codeblock.language == 'sql'

    text = """
github Gorialis / jishaku / jishaku / cog_base.py View on Github external
async def jsk_git(self, ctx: commands.Context, *, argument: codeblock_converter):
        """
        Shortcut for 'jsk sh git'. Invokes the system shell.
        """

        return await ctx.invoke(self.jsk_shell, argument=Codeblock(argument.language, "git " + argument.content))