Did I find the right examples for you? yes no

All Samples(26)  |  Call(16)  |  Derive(0)  |  Import(10)

        def html_minify(html_code, ignore_comments=True, parser="html5lib"):
    html_code = force_decode(html_code)
    soup = bs4.BeautifulSoup(html_code, parser)
    mini_soup = space_minify(soup, ignore_comments)
    if FOLD_DOCTYPE is True:
        # monkey patching to remove new line after doctype
        bs4.element.Doctype.SUFFIX = u'>'
    return unicode(mini_soup)
        


src/d/j/django-htmlmin-HEAD/htmlmin/middleware.py   django-htmlmin(Download)
 
import re
from htmlmin.minify import html_minify
from django.conf import settings
 
        parser = getattr(settings, 'HTML_MIN_PARSER', 'html5lib')
        if minify and self.can_minify_response(request, response):
            response.content = html_minify(response.content,
                                           ignore_comments=not keep_comments,
                                           parser=parser)

src/d/j/django-htmlmin-0.7.0/htmlmin/middleware.py   django-htmlmin(Download)
 
import re
from htmlmin.minify import html_minify
from django.conf import settings
 
        parser = getattr(settings, 'HTML_MIN_PARSER', 'html5lib')
        if minify and self.can_minify_response(request, response):
            response.content = html_minify(response.content,
                                           ignore_comments=not keep_comments,
                                           parser=parser)

src/d/j/django-htmlmin-HEAD/htmlmin/commands.py   django-htmlmin(Download)
import argparse
import os
from htmlmin.minify import html_minify
 
my_dir = os.getcwd()
        content = html_file.read()
 
    print html_minify(content, ignore_comments=not args.keep_comments)
 

src/d/j/django-htmlmin-0.7.0/htmlmin/commands.py   django-htmlmin(Download)
import argparse
import os
from htmlmin.minify import html_minify
 
my_dir = os.getcwd()
        content = html_file.read()
 
    print html_minify(content, ignore_comments=not args.keep_comments)
 

src/d/j/django-htmlmin-HEAD/htmlmin/decorators.py   django-htmlmin(Download)
 
from functools import wraps
from htmlmin.minify import html_minify
 
 
        minifiable_content = 'text/html' in response['Content-Type']
        if minifiable_status and minifiable_content:
            response.content = html_minify(response.content)
        return response
 

src/d/j/django-htmlmin-0.7.0/htmlmin/decorators.py   django-htmlmin(Download)
 
from functools import wraps
from htmlmin.minify import html_minify
 
 
        minifiable_content = 'text/html' in response['Content-Type']
        if minifiable_status and minifiable_content:
            response.content = html_minify(response.content)
        return response
 

src/p/e/Personal-Website-HEAD/libs/decorators.py   Personal-Website(Download)
import os
from functools import wraps
from htmlmin.minify import html_minify
from flask import request
import pylibmc
    def minified_view(*args, **kwargs):
        rv = f(*args, **kwargs)
        if type(rv) == unicode:
            return html_minify(rv.encode('utf-8'))
        return rv

src/p/e/pelican-minify-0.4/minify.py   pelican-minify(Download)
import sys
 
from htmlmin.minify import html_minify as min
from pelican import signals
 
        try:
            logger.debug('Minifying: %s' % filename)
            compressed = min(uncompressed)
            f.write(compressed)
        except Exception, ex:

src/p/e/pelican-minify-HEAD/minify.py   pelican-minify(Download)
import sys
 
from htmlmin.minify import html_minify as min
from pelican import signals
 
        try:
            logger.debug('Minifying: %s' % filename)
            compressed = min(uncompressed)
            f.write(compressed)
        except Exception, ex:

src/d/j/django-htmlmin-HEAD/htmlmin/tests/test_minify.py   django-htmlmin(Download)
import unittest
 
from htmlmin.minify import html_minify
from os.path import abspath, dirname, join
 
    def test_should_not_minify_content_from_textarea(self):
        html, minified = self._normal_and_minified('with_textarea')
        result = html_minify(html)
        self.assertEqual(minified, result)
 
    def test_should_convert_to_entities_the_content_of_textarea_tag(self):
        html, minified = self._normal_and_minified('with_html_content_in_textarea')
        result = html_minify(html)
    def test_should_not_convert_entities_within_textarea_tag(self):
        html, minified = self._normal_and_minified('with_entities_in_textarea')
        result = html_minify(html)
        self.assertEqual(minified, result)
 
    def test_should_not_drop_blank_lines_from_the_begin_of_a_textarea(self):
        t = 'with_textarea_with_blank_lines'
        html, minified = self._normal_and_minified(t)
        result = html_minify(html)