예제 #1
0
파일: filters.py 프로젝트: AN6U5/nikola
def typogrify(data):
    if typo is None:
        req_missing(['typogrify'], 'use the typogrify filter')

    data = typo.amp(data)
    data = typo.widont(data)
    data = typo.smartypants(data)
    # Disabled because of typogrify bug where it breaks <title>
    # data = typo.caps(data)
    data = typo.initial_quotes(data)
    return data
예제 #2
0
def typogrify(data):
    global typogrify_filter
    if typo is None:
        raise Exception("To use the typogrify filter, you need to install typogrify.")
    data = typo.amp(data)
    data = typo.widont(data)
    data = typo.smartypants(data)
    # Disabled because of typogrify bug where it breaks <title>
    #data = typo.caps(data)
    data = typo.initial_quotes(data)
    return data
예제 #3
0
파일: filters.py 프로젝트: AN6U5/nikola
def typogrify_sans_widont(data):
    # typogrify with widont disabled because it caused broken headline
    # wrapping, see issue #1465
    if typo is None:
        req_missing(['typogrify'], 'use the typogrify_sans_widont filter')

    data = typo.amp(data)
    data = typo.smartypants(data)
    # Disabled because of typogrify bug where it breaks <title>
    # data = typo.caps(data)
    data = typo.initial_quotes(data)
    return data
예제 #4
0
파일: filters.py 프로젝트: GetsDrawn/nikola
def typogrify(data):
    """Prettify text with typogrify."""
    if typo is None:
        req_missing(["typogrify"], "use the typogrify filter")

    data = typo.amp(data)
    data = typo.widont(data)
    data = typo.smartypants(data)
    # Disabled because of typogrify bug where it breaks <title>
    # data = typo.caps(data)
    data = typo.initial_quotes(data)
    return data
예제 #5
0
def applyfilters(text):
    """Applies the following filters: smartypants, caps, amp, initial_quotes

    >>> typogrify('<h2>"Jayhawks" & KU fans act extremely obnoxiously</h2>')
    '<h2><span class="dquo">&#8220;</span>Jayhawks&#8221; <span class="amp">&amp;</span> <span class="caps">KU</span> fans act extremely&nbsp;obnoxiously</h2>'
    """
    text = amp(text)
    text = smartypants(text)
    text = caps(text)
    text = initial_quotes(text)

    return text
예제 #6
0
파일: filters.py 프로젝트: GetsDrawn/nikola
def typogrify_sans_widont(data):
    """Prettify text with typogrify, skipping the widont filter."""
    # typogrify with widont disabled because it caused broken headline
    # wrapping, see issue #1465
    if typo is None:
        req_missing(["typogrify"], "use the typogrify_sans_widont filter")

    data = typo.amp(data)
    data = typo.smartypants(data)
    # Disabled because of typogrify bug where it breaks <title>
    # data = typo.caps(data)
    data = typo.initial_quotes(data)
    return data
예제 #7
0
파일: filters.py 프로젝트: Cnwauche/nikola
def typogrify(data):
    """Prettify text with typogrify."""
    if typo is None:
        req_missing(['typogrify'], 'use the typogrify filter', optional=True)
        return data

    data = _normalize_html(data)
    data = typo.amp(data)
    data = typo.widont(data)
    data = typo.smartypants(data)
    # Disabled because of typogrify bug where it breaks <title>
    # data = typo.caps(data)
    data = typo.initial_quotes(data)
    return data
예제 #8
0
파일: filters.py 프로젝트: zpisar/nikola
def typogrify_sans_widont(data):
    """Prettify text with typogrify, skipping the widont filter."""
    # typogrify with widont disabled because it caused broken headline
    # wrapping, see issue #1465
    if typo is None:
        req_missing(['typogrify'], 'use the typogrify_sans_widont filter')

    data = _normalize_html(data)
    data = typo.amp(data)
    data = typo.smartypants(data)
    # Disabled because of typogrify bug where it breaks <title>
    # data = typo.caps(data)
    data = typo.initial_quotes(data)
    return data
예제 #9
0
파일: filters.py 프로젝트: zpisar/nikola
def typogrify(data):
    """Prettify text with typogrify."""
    if typo is None:
        req_missing(['typogrify'], 'use the typogrify filter', optional=True)
        return data

    data = _normalize_html(data)
    data = typo.amp(data)
    data = typo.widont(data)
    data = typo.smartypants(data)
    # Disabled because of typogrify bug where it breaks <title>
    # data = typo.caps(data)
    data = typo.initial_quotes(data)
    return data
예제 #10
0
def typogrify_no_widont(value):
    value = Typogrify.amp(value)
    value = Typogrify.smartypants(value)
    value = Typogrify.caps(value)
    value = Typogrify.initial_quotes(value)
    return value
예제 #11
0
def typogrify_no_widont(value):
    value = Typogrify.amp(value)
    value = Typogrify.smartypants(value)
    value = Typogrify.caps(value)
    value = Typogrify.initial_quotes(value)
    return value