Exemple #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))
Exemple #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))
Exemple #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)
Exemple #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))
 def slugify(value, **kwargs):
     """Slugifies the value."""
     return pyslugify(value, **kwargs)
Exemple #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))
Exemple #7
0
def slugify(txt: tyUnion[str, tySequence]):
    if not isinstance(txt, str):
        txt = ' '.join(txt)
    return pyslugify(txt, separator='_')
Exemple #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))
Exemple #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="_")
Exemple #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))
Exemple #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))
Exemple #12
0
def slugify(text):
    return pyslugify(text)