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