Skip to content
Permalink
Browse files

Update documentation

  • Loading branch information...
golightlyb committed May 23, 2019
1 parent 9f9bbaf commit 27c2498cd7673911de6a14e1fbcef32c0f9d19fb
Showing with 142 additions and 16 deletions.
  1. +3 −0 .gitignore
  2. +11 −5 COPYING.md
  3. +5 −1 README.md
  4. +71 −0 W3C-Document-License.html
  5. +14 −2 make.py → make_1.py
  6. +3 −0 package.sh
  7. +2 −0 setup.cfg
  8. +24 −0 setup.py
  9. +9 −8 strictdom/tags_1.py
@@ -1,3 +1,6 @@
.*
__pycache__
!.gitignore
*.egg*
/build
/dist
@@ -7,21 +7,27 @@ following sources:

The HTML Living Standard is Copyright © 2018 WHATWG (Apple, Google, Mozilla,
Microsoft) and available under a Creative Commons Attribution 4.0
International License: see `https://whatwg.org/` and
`https://creativecommons.org/licenses/by/4.0/`
International License: see https://whatwg.org/ and
https://creativecommons.org/licenses/by/4.0/

Accessible Rich Internet Applications (WAI-ARIA) is Copyright © 2013-2019 W3C®
(MIT, ERCIM, Keio, Beihang) and available under the W3C Document License: see
`https://w3c.github.io/aria/` and `https://www.w3.org/Consortium/Legal/2015
/doc-license`
https://w3c.github.io/aria/ and https://www.w3.org/Consortium/Legal/2015/doc-
license or W3C-Document-License.html where provided

Based on current published specifications accessed Thu 23 May 13:50:08 UTC
2019

Redistribution of Strictdom is permitted only in simultaneous accordance with
the above licenses, namely attribution to all authors under the Creative
Commons Attribution 4.0 International License, and attribution to all authors
under the W3C Document License and any additional terms specified.
under the W3C Document License and also the additional terms specified by the
W3C Document License.

The easiest way to comply with this license is to include this notice in any
copies of the software. However, the W3C Document License excludes using this
software to create a new technical specification (as distinct from
"implementing" the specifications that exist).

Strictdom is available from `https://github.com/tawesoft/strictdom` and
`https://www.tawesoft.co.uk/products/open-source-software`. Strictdom also
@@ -1,7 +1,7 @@
Strictdom
=========

Stictdom is a strongly-typed front-end to
Stictdom is a strictly typed wrapper over
[Dominate](https://github.com/Knio/dominate/pull/111), a Python library for
creating and manipulating HTML documents.

@@ -16,8 +16,12 @@ Compared to using Dominate directly, strictdom offers:
Features:

* Nothing new to learn - mostly the same interface as vanilla.

* Stable versioned interface e.g. `strictdom.tags_1` is a frozen view of the spec

* Consistent handling of both [boolean attributes](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes)
and the weird "boolean-like" attributes like `contenteditable` or `spellcheck`.


Example: Vanilla vs Strict
--------------------------
@@ -0,0 +1,71 @@
<html>
<head>
<title>W3C Document License</title>
</head>
<body>
<h1>W3C Document License</h1>

<h2>License</h2>
<p class="tPadding"> By using and/or copying this document, or the
W3C document from which this statement is linked, you (the licensee) agree
that you have read, understood, and will comply with the following terms and
conditions:</p>

<p>Permission to copy, and distribute the contents of this document, or the
W3C document from which this statement is linked, in any medium for any
purpose and without fee or royalty is hereby granted, provided that you
include the following on <i>ALL</i> copies of the document, or portions
thereof, that you use:</p>
<ul class="show_items"><li>A link or URL to the original W3C document.</li><li>The pre-existing copyright notice of the original author, or if it
doesn't exist, a notice (hypertext is preferred, but a textual
representation is permitted) of the form: "Copyright &#xA9;
[$date-of-document] <a href="http://www.w3.org/">World Wide Web
Consortium</a>, (<a href="http://www.csail.mit.edu/">MIT</a>, <a href="http://www.ercim.org/">ERCIM</a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>).
<a href="http://www.w3.org/Consortium/Legal/2015/doc-license">http://www.w3.org/Consortium/Legal/2015/doc-license</a>"</li><li>
<em>If it exists</em>, the STATUS of the W3C document.</li></ul>

<p>When space permits, inclusion of the full text of this <b>NOTICE</b>
should be provided. We request that authorship attribution be provided in any
software, documents, or other items or products that you create pursuant to
the implementation of the contents of this document, or any portion
thereof.</p>
<p>No right to create modifications or derivatives of W3C documents is granted pursuant to this license, except as follows: To facilitate implementation of the technical specifications set forth in this document, anyone may prepare and distribute derivative works and portions of this document in software, in supporting materials accompanying software, and in documentation of software, PROVIDED that all such works include the notice below. HOWEVER, the publication of derivative works of this document for use as a technical specification is expressly prohibited. </p>

<p>In addition, "Code Components" &mdash;Web IDL in sections clearly marked as Web IDL; and W3C-defined markup (HTML, CSS, etc.) and computer programming language code clearly marked as code examples&mdash; are licensed under the <a href="http://www.w3.org/Consortium/Legal/copyright-software">W3C Software License</a>.</p>

<p>The notice is:</p>
<blockquote>"Copyright &copy; 2015 W3C&reg; (MIT, ERCIM, Keio,
Beihang). This software or document includes material copied from
or derived from [title and URI of the W3C document]."
</blockquote>

<h2>Disclaimers</h2>
<p>THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO
REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED
TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE
FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT
INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.</p>

<p>COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE
PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.</p>

<p>The name and trademarks of copyright holders may NOT be used in
advertising or publicity pertaining to this document or its contents without
specific, written prior permission. Title to copyright in this document will
at all times remain with copyright holders.</p>

<h2>Notes</h2>
<ul>
<li><a href="https://www.w3.org/Consortium/Legal/2015/doc-license">This version</a>: https://www.w3.org/Consortium/Legal/2015/doc-license</li>
<li><a href="https://www.w3.org/Consortium/Legal/copyright-documents">Latest version</a>: https://www.w3.org/Consortium/Legal/copyright-documents</li>
<li><a href="http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231">Previous version</a>: http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231</li>
</ul>
<h3>Changes since the previous Document License</h3>
<ul class="show_items">
<li>This version grants limited permission to create and distribute derivative works except for use as technical specifications.</li>
<li>This version licenses Code Components under the <a href="http://www.w3.org/Consortium/Legal/copyright-software">W3C Software License</a>.</li>
</ul>
</body>
</html>
@@ -1,4 +1,9 @@
# make.py from Strictdom by Ben Golightly
# make.py from Strictdom by Ben Golightly <ben@tawesoft.co.uk>

# This file generates the `strictdom/tags_$VERSION.py` code from a
# machine-readable spec. You will need to first get this from
# https://github.com/tawesoft/html5spec.json and put it in a
# sibling directory relative to this directory.

# This file itself is donated to the public domain, but the data it works on
# - and its output! - is copyright - see COPYING.md
@@ -13,6 +18,7 @@


VERSION="1"

srcdir=Path("../html5spec/spec-json/")
destdir=Path("strictdom")

@@ -167,7 +173,13 @@ def fmt_attribute_assign(arg):
Redistribution of Strictdom is permitted only in simultaneous accordance with
the above licenses, namely attribution to all authors under the Creative
Commons Attribution 4.0 International License, and attribution to all authors
under the W3C Document License and any additional terms specified.
under the W3C Document License and also the additional terms specified by the
W3C Document License.
The easiest way to comply with this license is to include this notice in any
copies of the software. However, the W3C Document License excludes using this
software to create a new technical specification (as distinct from
"implementing" the specifications that exist).
Strictdom is available from `https://github.com/tawesoft/strictdom` and
`https://www.tawesoft.co.uk/products/open-source-software`. Strictdom also
@@ -0,0 +1,3 @@
python3 setup.py sdist bdist_wheel
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*

@@ -0,0 +1,2 @@
[metadata]
description-file = README.md
@@ -0,0 +1,24 @@
from setuptools import setup

setup(name='strictdom',
version='0.1',
description='strictly typed wrapper around Knio\'s Dominate',
long_description='strictly typed wrapper around Knio\'s Dominate, a Python library for creating and manipulating HTML documents',
url='https://github.com/tawesoft/strictdom',
author='Ben Golightly',
author_email='golightly.ben@googlemail.com',
maintainer='Tawesoft Ltd',
maintainer_email='opensource@tawesoft.co.uk',
license='Creative Commons Attribution 4.0 International License and W3C Document License',
packages=['strictdom'],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: Other/Proprietary License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Processing :: Markup :: HTML',
'Topic :: Internet :: WWW/HTTP',
],
zip_safe=True)
@@ -1,12 +1,13 @@
# The HTML Living Standard is Copyright © 2018 WHATWG (Apple, Google, Mozilla,
# Microsoft) and available under a Creative Commons Attribution 4.0
# International License: see `https://whatwg.org/` and
# `https://creativecommons.org/licenses/by/4.0/`
# International License: see https://whatwg.org/ and
# https://creativecommons.org/licenses/by/4.0/
#
# Accessible Rich Internet Applications (WAI-ARIA) is Copyright © 2013-2019
# W3C® (MIT, ERCIM, Keio, Beihang) and available under the W3C Document
# License: see `https://w3c.github.io/aria/` and
# `https://www.w3.org/Consortium/Legal/2015/doc-license`
# License: see https://w3c.github.io/aria/ and
# https://www.w3.org/Consortium/Legal/2015/doc-license or W3C-Document-
# License.html where provided
#
# Based on current published specifications accessed Thu 23 May 13:50:08 UTC
# 2019
@@ -49,10 +50,10 @@ def __init__(self, **kwargs):
class ElementType(Enum):
normal_elements = 0
foreign_elements = 1
the_template_element = 2
raw_text_elements = 3
void_elements = 4
escapable_raw_text_elements = 5
escapable_raw_text_elements = 2
void_elements = 3
the_template_element = 4
raw_text_elements = 5


class a(dominate.tags.html_tag):

0 comments on commit 27c2498

Please sign in to comment.
You can’t perform that action at this time.