{"id":16701131,"url":"https://github.com/rohitawate/domengine","last_synced_at":"2025-04-10T04:05:38.814Z","repository":{"id":139316432,"uuid":"169750089","full_name":"RohitAwate/DOMEngine","owner":"RohitAwate","description":"DOM manipulation engine written in C++.","archived":false,"fork":false,"pushed_at":"2019-04-28T12:46:00.000Z","size":195,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T04:05:29.268Z","etag":null,"topics":["cpp11","dom-manipulation","dom-tree","html-parser","interactive-shell","interpreter"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RohitAwate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-08T14:51:28.000Z","updated_at":"2024-07-28T15:50:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"e2138155-2a26-4284-b287-3019d711e59c","html_url":"https://github.com/RohitAwate/DOMEngine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohitAwate%2FDOMEngine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohitAwate%2FDOMEngine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohitAwate%2FDOMEngine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RohitAwate%2FDOMEngine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RohitAwate","download_url":"https://codeload.github.com/RohitAwate/DOMEngine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154981,"owners_count":21056543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp11","dom-manipulation","dom-tree","html-parser","interactive-shell","interpreter"],"created_at":"2024-10-12T18:28:52.002Z","updated_at":"2025-04-10T04:05:38.805Z","avatar_url":"https://github.com/RohitAwate.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DOM Manipulation Engine\n`THIS IS A WORK IN PROGRESS`\n\nA simple command-line program for parsing HTML files and building a DOM tree which can then be accessed and manipulated from an interactive shell or with scripts using jQuery-like selectors and commands.\n\nThis is nothing more than an effort at learning modern, idiomatic C++ and understanding the working of web browsers. Its amusing at best and useless at worst. Have fun with it!\n\n_Check out the engine in action on ASCII Cinema:_\n\n[![asciicast](https://asciinema.org/a/227230.svg)](https://asciinema.org/a/227230)\n\n## Building from source\nYou'll need the following installed:\n- A compiler which supports at least C++11: `g++`, `clang++` or `Visual C++`\n- `CMake`\n- `make`\n- `git`\n\n#### Steps\n```bash\n# Clone the repository\ngit clone https://github.com/RohitAwate/DOMEngine\n\n# Open the directory\ncd DOMEngine/\n\n# Create a new directory and open it\nmkdir build/ \u0026\u0026 cd build/\n\n# Generate the build files\ncmake .. -DCMAKE_BUILD_TYPE=Release\n\n# Build the project\nmake\n\n# Open the bin/ folder\ncd ../bin/\n\n# Run interactive shell\n./dom-engine \u003chtml-file\u003e\n\n# Run script\n./dom-engine \u003chtml-file\u003e \u003cscript-file\u003e\n```\n\n## Commands\n\n- `print`\\\n    Prints out the DOM tree.\n    \u003cbr/\u003e\n- `$(\"@tagname#someId.firstClass.secondClass\")`\\\n    Selects a DOM element of type `tagname` with ID `someId` and classes `firstClass` and `secondClass`.\n    ### Sub-commands for selected nodes:\n    - `parent` Prints the parent\n    - `children` Prints all the children\n    - `attrs` Prints all the attributes\n    - `innerhtml` Prints the innerHTML\n    - `return` Deselects the node and returns to shell\n    \u003cbr/\u003e\n- `save file.html`\\\n    Generates formatted HTML for the DOM tree and saves it to the specified file.\n- `exit`\\\n    Exits the shell.\n\n## Writing Scripts\nDOM Engine uses a simple scripting language which utilizes the commands mentioned above along with some syntactic elements such as semicolons and braces. Here is an example script.\n\n```\n$(\"#alertBox.alertDiv@div\")\n{\n    parent;\n    children;\n    attrs;\n}\n\n$(\"@div.text-field\") {\n    parent;\n    attrs;\n}\n\n$(\"@div.text-field\") { attrs; }\n\n$(\"@body\"){children;}\n\nprint;\n```\n### Selector Blocks\nThe first five lines demonstrate the usage of DOM Engine's selectors and running sub-commands on selected nodes. The selector is the same as you'd use in the shell with the sub-commands grouped together inside the curly braces, separated by semi-colons.\n\nThe next three selector blocks show alternative formatting.\n\nFinally, the last line shows the `print` command terminated with a semi-colon.\n\nSave the script in a file with the `.des` extension _(DOM Engine Script)_. \u003cbr/\u003e\nRun using: `dom-engine \u003chtml-file\u003e script.des`\n\n## Goals and Progress\nSee the Kanban board [here](https://github.com/RohitAwate/DOMEngine/projects/1?fullscreen=true).\n\n## License\nMIT\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohitawate%2Fdomengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frohitawate%2Fdomengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohitawate%2Fdomengine/lists"}