Domonic

Latest version: v0.9.12

Safety actively analyzes 683322 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 17

0.6.7

this should have been a method not a property.

0.6.6

querySelectorAll has been limited for ages. Then I started a few css parsers. the most basic one i got working was called getElementsBySelector but that for some reason would only work if a tag was present. So I have now re-directed any queries that are complex to that. making querySelectorAll appear to work. so anyways. now that domonic is compatible with a few html5 parsers I figured I'd just patch that to work properly for now. until some other time.

calling __pyml__ can now create the data attributes the way domonic whats them. which is as *variable keyword argument syntax* for custom data-tags. Which also makes it clear when you are using a non standard or special attribute.

0.6.5

So there's now an 'undocumented' html5lib integration. which helped me figure out how to integrate parts of minidom that exist i.e NameNodeMap. Only just started so won't render to pyml yet but should have all the DOM methods available.

You will also have to pip install html5lib to use it. im created an ext lib for libraries I interface with but don't include in reqs. i.e. later on may do a namespace for django or a filter for jinja or a pdfkit integration or css minifier so these kind of things could go in there.

Here's an example... seems to run fine for several websites til i killed it.


import requests
import html5lib
from domonic.ext.html5lib_ import getTreeBuilder

for SITE in sites:
r = requests.get("https://"+SITE)
parser = html5lib.HTMLParser(tree=getTreeBuilder())
page = parser.parse(r.content.decode("utf-8"))
links = page.getElementsByTagName('a')
for l in links:
try:
print(l.href)
except Exception as e:
no href on this tag
pass

0.6.4

So EntityReference is 404 missing from mdn. and the createEntityReference method on the dom is dropped from spec.

So... does that mean EntityReference also dropped?. I thought that was a mapping from entities so required?

Doesn't appear to be from other online specs. So having to cross reference specs to see what's going on there.

It would appear as long as we start returning HTMLCollecitons and NodeLists were compliant to a good decent amount of lvl1-5 specs. The hard part would be taking into account changes between specs if I'm not settling on one and just reading them randomly as I do each method. As tbf I'm working backwards from tests and use cases rather than building directly from a spec. Then only referencing the spec.

I'm not against have legacy methods avaiallable if they don't affect anything. And need to understand some parts better.

There now overlap between my DOM stuff and the xm.dom... i.e. NodeFilter exists as identitcal... so i can likely import and reference that. It also has a raiseNotImplemented which was as I expected from the spec and shim Id been working with have it so you set that function rule as you build the treewalker.

Anyways. This DOM is reall really huge. It can often feel like the mandala effect (i've said this before) . So if you want to help just fork and start anywhere. It doesn't belong to me which is why I opened sourced it. And it far too much for 1 person to dev. Tests are really far behind as are docs.

0.6.3

append was missing from element. webapi started. several more dom methods added or updated.

0.6.2

Fixes a render bug that was causing self closing tags to have a closing tag. Very grateful to kthy for picking this up.

Also adds a new feature boolean attributes.

i.e.
https://github.com/byteface/domonic/issues/40
s = script(_src="foo.js", _async="")
<script src="foo.js" async></script>

there's a new undocumented package called templates with a status_page template for when prototyping.

Page 5 of 17

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.