Domonic

Latest version: v0.9.12

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

Scan your dependencies

Page 7 of 17

0.4.6

so i made a start on the sanitizer api...
https://wicg.github.io/sanitizer-api/#sanitizer-algorithms

which lead to the creation of DocumentFragment.

DocumentFragment is now available. it can decorate other elements that don't have a document to make available a few methods of the Document class. when you call str on it, it only returns the content.

also quite a big change to tag.
element.attributes wasn't returning due to tag sharing the name. so tag is now changed to __attributes__ which stringifies the kwargs and elements attributes prop now works. however be aware it returns not a dict but a list of Attr. I considered attributes_ to return kwargs but will see how this pans out. I was surprised all tests still passing so hope it doesn't affect anyone.

added a page for the utils to the docs. will see if they appear.

0.4.5

couple of missing string methods for trim and pad

array has a static from method that has an undercore at the end. will need to document that for all clashes and get a list of ones that do it.

dont use d3... its to drive dev. altho 4 methods on there now work. see tests if you're keen to play.

Style is being phased out for a full cssom as d3 kind wanted the CSSDeclration props. So looks like a lot of work ahead there too once d3 is finished.

stubbed out Set for JS. turns out you can put dicts in a JS Set so will need to implement that to finish it off.

Stubbed out ccsom

0.4.4

the parers main issue is it's an inplace parser. initially for simple html blobs.

as it grew more complex it's main problem is that python wants keywords after args...

so you need to swap the keywords and the content positions around when you parse.

to do this the eval needs the code on separate lines. so it can wrap .html after the keywords and nest the content by passing it through a function rather than as a paramter. (kind of cheating).

The inplace parser is not tagged but is split mostly onto lines which are recognised at the time so could be.

to keep small blobs cute they were not being formatted. and I hand't written a proper formatter at that time. so most of the unit tests would fail when moving to a splitline parser.

This unocvered that a single line of lists gets wrapped by the eval. but split doesn't as it doesn't handle it as a single failling line.

anways to solve that it now tries twice. i.e. if fails on with splitlines. it will flatten the line.

I doubt anyones using the parser much and probably shouldn't it's s secondary feature really to the html generation.

anyway there's a cool example called codemirror in the examples folder than can now convert html to pyml with the evolving parser tools.

0.4.3

document is now a global to the dom module and updates whenever you create a html tag. it houses an empty html tag by default so that static methods are availabe.

from domonic.dom import document
print(document)

d3 selection class is started. but all d3 is undocumented so not officially supported yet. however check out the unit tests if you're interested in using selection and to see how the port is going.

They're not yet on d3 as a modules.. you have to import their methods directly. (see unit tests)

It doesn't appear to break anything... yet. but will mean you have to manually switch the reference if you have multiple documents (as extra libs d3 will rely on it.) The alternative is the dQuery method of having an init call... which may go away in favour of the global.

0.4.2

python3 -m domonic --install

then you can do...

project mycoolproj

and

domonic -h

the docs will update with instructions...

https://domonic.readthedocs.io/

0.4.1

need to focus on more assertions and unit tests around dom and parser.

test names were simplified

Page 7 of 17

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.