def mobile(): return ( t.meta(name="viewport", content="width=device-width, user-scalable=no"), t.meta(name='apple-mobile-web-app-capable', content="yes"), t.meta(name="mobile-web-app-capable", content="yes"), )
def mobile(): return (t.meta(name="viewport", content="width=device-width, user-scalable=no"), t.meta(name='apple-mobile-web-app-capable', content="yes"), t.meta(name="mobile-web-app-capable", content="yes"), )
def test_inject_css(): page = t.html( t.head(t.meta(charset="utf-8"), ), t.body( t.h1("A page"), t.p("Yup, this is a page on the World Wild Web."), inject_css('https://example.com/style.css'), ), ) assert page result = page.build() assert result print(result) assert '<link href="https://example.com/style.css" ' \ 'rel="stylesheet" type="text/css"/>' in result
def test_page(): page = t.html( t.head( t.title('Title'), t.meta(charset='utf-8'), f.css('style.css'), ), t.body( t.h1('Page Title'), t.p( t.i('Hello'), ), t.p('Come back later for more !'), ), ) assert page assert page.build() == '''<!DOCTYPE html>
import tumulus.lib as lib def truc(title): global lib return t.div( t.h2(title), t.p('Bla bla bla', class_='btn btn-info'), lib.css('bootstrap'), ) page = t.html( t.head( t.meta(charset="utf-8"), ), t.body( t.h1("A page"), t.p("Yup, this is a page on the World Wild Web."), # inject_css('http://okso.me/static/style.css'), truc('Salut les amis'), # lib.js('d3'), # lib.js('jquery'), # lib.js('http://d3js.org/d3.v3.min.js'), # lib.js('bootstrap'), # lib.css('bootstrap'), ), )
def IEedge(): return t.meta(content="IE=edge", **{"http-equiv": "X-UA-Compatible"})
def utf8(): return t.meta(charset='utf-8')
def viewport(): return t.meta(name="viewport", content="width=device-width, initial-scale=1")
from tumulus.tags import HTMLTags as t from tumulus.plugins import inject_css, inject_js_footer, inject_js_head import tumulus.lib as lib def truc(title): global lib return t.div( t.h2(title), t.p('Bla bla bla', class_='btn btn-info'), lib.css('bootstrap'), ) page = t.html( t.head(t.meta(charset="utf-8"), ), t.body( t.h1("A page"), t.p("Yup, this is a page on the World Wild Web."), # inject_css('http://okso.me/static/style.css'), truc('Salut les amis'), # lib.js('d3'), # lib.js('jquery'), # lib.js('http://d3js.org/d3.v3.min.js'), # lib.js('bootstrap'), # lib.css('bootstrap'), ), )