Skip to content

Releases: byteface/domonic

dialog

20 Nov 22:55
Compare
Choose a tag to compare

dialog tag was missing so now added.

NodeList hooked up

more type hints added

javascript references mostly removed from dom by using new webapi modules instead for URL

🌎

17 Nov 14:50
Compare
Choose a tag to compare
  • added a package to make the dom universal . so you can import tags from other languages.

i.e.

from domonic.i18n.sw import *
  • fixed domonic entry point. This means phasing out the old project bash script or having to set a domonic alias. not yet tested on windows.

means you can now do...

domonic -p someproject

window module fixes

06 Nov 17:03
Compare
Choose a tag to compare

window module was broken. not sure why. looks like a branch merge had gone wrong during reduction of modules in webapi.

fixed now. so if you have html5lib installed you can do...

from domonic.window import *
window.location = "https://www.somesite.com"
print(window.document.title)

querySelectorAll fix

05 Nov 14:13
Compare
Choose a tag to compare

noticed a bug on this when trying some css queries with spaces in. so sorted

Fix hasChildNodes

31 Oct 17:25
Compare
Choose a tag to compare

this should have been a method not a property.

querySelector and __pyml__

28 Oct 17:36
Compare
Choose a tag to compare

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.

html5lib

27 Oct 20:58
Compare
Choose a tag to compare

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

EntityReference

25 Oct 08:15
Compare
Choose a tag to compare

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.

append

20 Oct 23:59
Compare
Choose a tag to compare

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

kthy

12 Oct 21:41
Compare
Choose a tag to compare

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.

#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.