Skip to content

Instantly share code, notes, and snippets.

@stain
Last active June 19, 2018 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stain/96188080fd4b9376aebf6256ba1873fd to your computer and use it in GitHub Desktop.
Save stain/96188080fd4b9376aebf6256ba1873fd to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>
Hello
</title>
<link href="http://example.com/" rel="canonical" />
</head>
<body>
<p>
Welcome to
<a href="http://forgethtml.sourceforge.net/">
ForgetHTML
</a>
</p>
</body>
</html>
>>> d = Document()
>>> d.append(Head(Title("Hello"), Link(href="http://example.com/", rel="canonical")))
>>> d.append(Body(Paragraph("Welcome to", Anchor("ForgetHTML", href="http://forgethtml.sourceforge.net/"))))
>>> print d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment