Statue
Easier way to querry selectors for static HTML pages.
Spare yourself from writing
let work_area = document
.query_selector
.unwrap
.unwrap
.
.unwrap;
let layer_list_div = document
.query_selector
.unwrap
.unwrap
.
.unwrap;
let save_files_btn = document
.query_selector
.unwrap
.unwrap
.
.unwrap;
and write
initialize_elements!;
instead.
Note on optimization
Eventually, this can be possible to just traverse the tree of HTML nodes to get the elements chosen by selectors. However, this is not implemented yet.
Note on (in-)completeness of implementation
The implementation is incomplete. For example, many elements of web_sys
are not yet supported. One easy way to add support for more elements is to edit
src/elements.rs and add the element to the ElementKind enum. Then, edit new
method of ElementKind to return the element kind you added. Finally, edit to_web_sys_name.
File structure
src/: Source code.target/: Compiled code (generated)..gitingore: Git ignore file..markdownlint.json: Configuration file for Markdown linting, used byDavidAnson.vscode-markdownlintVisual Studio Code extension.Cargo.tomlandCargo.lock: Manifest and machine-generated list of dependencies. Learn more.LICENSE-APACHE: Apache License, Version 2.0.LICENSE-MIT: MIT License.README.md: This file.