Exemplo n.º 1
0
def slugify(text, entities=True, decimal=True, hexadecimal=True, max_length=0,
            word_boundary=False, separator='-', save_order=False, stopwords=()):
    """
    Make a slug from a given text.
    """

    return smart_str(pyslugify(text, entities, decimal, hexadecimal, max_length,
        word_boundary, separator, save_order, stopwords))
Exemplo n.º 2
0
def slugify(text,
            entities=True,
            decimal=True,
            hexadecimal=True,
            max_length=0,
            word_boundary=False,
            separator='-'):
    """ Make a slug from a given text """

    return smart_str(
        pyslugify(text, entities, decimal, hexadecimal, max_length,
                  word_boundary, separator))
Exemplo n.º 3
0
def slugify(txt: str, length: int = 128) -> str:
    """Slugify a string

    Thin wrapper around python-slugify.

    Args:
      length: int: Maximum length of the slug (Default value = 128)

    Returns:
      A string converted to a slug

    """
    return pyslugify(txt, max_length=length, word_boundary=True)
Exemplo n.º 4
0
def slugify(text,
            entities=True,
            decimal=True,
            hexadecimal=True,
            max_length=0,
            word_boundary=False,
            separator='-',
            save_order=False,
            stopwords=()):
    """
    Make a slug from a given text.
    """

    return smart_str(
        pyslugify(text, entities, decimal, hexadecimal, max_length,
                  word_boundary, separator, save_order, stopwords))
Exemplo n.º 5
0
 def slugify(value, **kwargs):
     """Slugifies the value."""
     return pyslugify(value, **kwargs)
Exemplo n.º 6
0
def slugify(text, entities=True, decimal=True, hexadecimal=True, max_length=0, word_boundary=False):
    """ Make a slug from a given text """

    return smart_unicode(pyslugify(text, entities, decimal, hexadecimal, max_length, word_boundary))
Exemplo n.º 7
0
def slugify(txt: tyUnion[str, tySequence]):
    if not isinstance(txt, str):
        txt = ' '.join(txt)
    return pyslugify(txt, separator='_')
Exemplo n.º 8
0
def slugify(text, entities=True, decimal=True, hexadecimal=True, max_length=0, word_boundary=False):
    """ Make a slug from a given text """
    
    return smart_unicode(pyslugify(text, entities, decimal, hexadecimal, max_length, word_boundary))
Exemplo n.º 9
0
def cmk_slugify(txt: UnionType[str, SequenceType]) -> str:
    if not isinstance(txt, str):
        # e.g a list of strings
        txt = " ".join(str(t) for t in txt)
    return pyslugify(txt, separator="_")
Exemplo n.º 10
0
def slugify(text, entities=True, decimal=True, hexadecimal=True):
    """ Make a slug from a given text """
    
    return smart_unicode(pyslugify(text, entities, decimal, hexadecimal))
Exemplo n.º 11
0
def slugify(text, entities=True, decimal=True, hexadecimal=True, max_length=0, word_boundary=False, separator='-'):
    """ Make a slug from a given text """

    return smart_str(pyslugify(text, entities, decimal, hexadecimal, max_length, word_boundary, separator))
Exemplo n.º 12
0
def slugify(text):
    return pyslugify(text)