How to use the fava.util.slugify function in fava

To help you get started, we’ve selected a few fava 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 beancount / fava / tests / test_util.py View on Github external
def test_slugify():
    assert slugify("Example Beancount File") == "example-beancount-file"
    assert slugify("    Example Beancount File  ") == "example-beancount-file"
    assert slugify("test") == "test"
    assert slugify("烫烫烫") == "烫烫烫"
    assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
    assert slugify("%✓") == ""
    assert slugify("söße") == "söße"
    assert slugify("ASDF") == "asdf"
    assert slugify("ASDF test test") == "asdf-test-test"
github beancount / fava / tests / test_util.py View on Github external
def test_slugify():
    assert slugify("Example Beancount File") == "example-beancount-file"
    assert slugify("    Example Beancount File  ") == "example-beancount-file"
    assert slugify("test") == "test"
    assert slugify("烫烫烫") == "烫烫烫"
    assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
    assert slugify("%✓") == ""
    assert slugify("söße") == "söße"
    assert slugify("ASDF") == "asdf"
    assert slugify("ASDF test test") == "asdf-test-test"
github beancount / fava / tests / test_util.py View on Github external
def test_slugify():
    assert slugify("Example Beancount File") == "example-beancount-file"
    assert slugify("    Example Beancount File  ") == "example-beancount-file"
    assert slugify("test") == "test"
    assert slugify("烫烫烫") == "烫烫烫"
    assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
    assert slugify("%✓") == ""
    assert slugify("söße") == "söße"
    assert slugify("ASDF") == "asdf"
    assert slugify("ASDF test test") == "asdf-test-test"
github beancount / fava / tests / test_util.py View on Github external
def test_slugify():
    assert slugify("Example Beancount File") == "example-beancount-file"
    assert slugify("    Example Beancount File  ") == "example-beancount-file"
    assert slugify("test") == "test"
    assert slugify("烫烫烫") == "烫烫烫"
    assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
    assert slugify("%✓") == ""
    assert slugify("söße") == "söße"
    assert slugify("ASDF") == "asdf"
    assert slugify("ASDF test test") == "asdf-test-test"
github beancount / fava / tests / test_util.py View on Github external
def test_slugify():
    assert slugify("Example Beancount File") == "example-beancount-file"
    assert slugify("    Example Beancount File  ") == "example-beancount-file"
    assert slugify("test") == "test"
    assert slugify("烫烫烫") == "烫烫烫"
    assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
    assert slugify("%✓") == ""
    assert slugify("söße") == "söße"
    assert slugify("ASDF") == "asdf"
    assert slugify("ASDF test test") == "asdf-test-test"
github beancount / fava / tests / test_util.py View on Github external
def test_slugify():
    assert slugify("Example Beancount File") == "example-beancount-file"
    assert slugify("    Example Beancount File  ") == "example-beancount-file"
    assert slugify("test") == "test"
    assert slugify("烫烫烫") == "烫烫烫"
    assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
    assert slugify("%✓") == ""
    assert slugify("söße") == "söße"
    assert slugify("ASDF") == "asdf"
    assert slugify("ASDF test test") == "asdf-test-test"
github beancount / fava / tests / test_util.py View on Github external
def test_slugify():
    assert slugify("Example Beancount File") == "example-beancount-file"
    assert slugify("    Example Beancount File  ") == "example-beancount-file"
    assert slugify("test") == "test"
    assert slugify("烫烫烫") == "烫烫烫"
    assert slugify("nonun烫icode 烫烫") == "nonun烫icode-烫烫"
    assert slugify("%✓") == ""
    assert slugify("söße") == "söße"
    assert slugify("ASDF") == "asdf"
    assert slugify("ASDF test test") == "asdf-test-test"
github beancount / fava / fava / application.py View on Github external
def _load_file():
    """Load Beancount files.

    This is run automatically on the first request.
    """
    app.config["LEDGERS"] = {}
    for filepath in app.config["BEANCOUNT_FILES"]:
        ledger = FavaLedger(filepath)
        slug = slugify(ledger.options["title"])
        if not slug:
            slug = slugify(filepath)
        app.config["LEDGERS"][slug] = ledger
    app.config["FILE_SLUGS"] = list(app.config["LEDGERS"].keys())
github beancount / fava / fava / application.py View on Github external
def _load_file():
    """Load Beancount files.

    This is run automatically on the first request.
    """
    app.config["LEDGERS"] = {}
    for filepath in app.config["BEANCOUNT_FILES"]:
        ledger = FavaLedger(filepath)
        slug = slugify(ledger.options["title"])
        if not slug:
            slug = slugify(filepath)
        app.config["LEDGERS"][slug] = ledger
    app.config["FILE_SLUGS"] = list(app.config["LEDGERS"].keys())