{"id":23529932,"url":"https://github.com/f34nk/modest_html","last_synced_at":"2025-05-14T12:33:16.068Z","repository":{"id":213514581,"uuid":"127538615","full_name":"f34nk/modest_html","owner":"f34nk","description":"Wrapping library for Modest, a HTML5 parsing library in pure C99","archived":false,"fork":false,"pushed_at":"2022-01-18T09:17:49.000Z","size":226,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T03:28:36.807Z","etag":null,"topics":["c","c99","css-parser","html-parser","html-renderer"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f34nk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-03-31T14:20:32.000Z","updated_at":"2022-02-25T15:45:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"a43303cc-8604-4857-80d3-4945194ca8bf","html_url":"https://github.com/f34nk/modest_html","commit_stats":null,"previous_names":["f34nk/modest_html"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f34nk%2Fmodest_html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f34nk%2Fmodest_html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f34nk%2Fmodest_html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f34nk%2Fmodest_html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f34nk","download_url":"https://codeload.github.com/f34nk/modest_html/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254142210,"owners_count":22021481,"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":["c","c99","css-parser","html-parser","html-renderer"],"created_at":"2024-12-25T21:14:18.685Z","updated_at":"2025-05-14T12:33:16.021Z","avatar_url":"https://github.com/f34nk.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# This project is not maintained anymore.\n\n[![Build status](https://travis-ci.org/f34nk/modest_html.svg?branch=master)](https://travis-ci.org/f34nk/modest_html)\n\n# modest_html\n\nThis library wraps functionality of lexborisovs **Modest**. It is written in in pure C99 and exposes a lot of useful features to parse and manipulate a html DOM. Internally it makes use of rxis excellent **vec**, **map** and **dmt** libraries.\n\n\u003eModest is a fast HTML renderer implemented as a pure C99 library with no outside dependencies.\n\n- [Modest](https://github.com/lexborisov/Modest)\n  - HTML5 parsing library in pure C99\n  - fully conformant with the HTML5 spec\n\n- [vec](https://github.com/rxi/vec)\n  - A type-safe dynamic array implementation for C\n\n- [map](https://github.com/rxi/map)\n  - A type-safe generic hashmap implementation for C.\n  \n- [dmt](https://github.com/rxi/dmt)\n  - Dynamic Memory Tracker (DMT) Library\n\n## Current Version\n\n`2.0.1`\n\n## Example\nFor more examples please checkout [tests](https://github.com/f34nk/modest_html/tree/master/test).\n```C\n#include \"modest_html.h\"\n```\n\n```C\n/*\nmodest_html is build around a workspace struct.\nThe workspace holds all allocated memory and frees it in html_destroy().\n*/\nhtml_workspace_t *w = html_init();\n\n// parse some html\nconst char *html = \"\u003cp\u003eHello\u003c/p\u003e\u003cp\u003eWorld\u003c/p\u003e\";\nint tree_index = html_parse_tree(w, html, strlen(html));\n\n// serialize the tree into a buffer\nint buffer_index = html_serialize_tree(w, tree_index, \"body\");\n\n// get buffer and join into a string\nhtml_vec_str_t *buffer = html_get_buffer(w, buffer_index);\nchar* result = html_vec_str_join(buffer, \"\");\nprintf(\"%s\\n\", result);\n\n// test result\nif(result != NULL \u0026\u0026 strcmp(result, \"\u003cbody\u003e\u003cp\u003eHello\u003c/p\u003e\u003cp\u003eWorld\u003c/p\u003e\u003c/body\u003e\") != 0){\n  fprintf(stderr, \"Failed\\n\");\n  html_free(result);\n  html_destroy(w);\n  return false;\n}\n\n// free result\nhtml_free(result);\n\n// destroy our workspace\nhtml_destroy(w);\n\nreturn true;\n```\n\n## Dependencies\n```\ncmake 3.x\n```\n\n## Compile and test\nThe script compiles `Modest` and configures the library.\n```\n./configure\n```\nBuild `libmodest_html.a` into `build/`.\n```\ncd build\nmake\n```\nExecute tests.\n```\nmake test\n```\nCheck for leaks.\n```\nvalgrind --leak-check=yes test/example_test\n```\n\n## Cloning\n```\ngit clone git@github.com:f34nk/modest_html.git\ncd modest_html\n```\nAll dependencies are added as submodules in the `libs/` folder.\n```\ngit submodule update --init --recursive --remote\n```\n\n## Roadmap\n\nSee [CHANGELOG](https://github.com/f34nk/modest_html/blob/master/CHANGELOG.md).\n\n- [ ] Features\n  - [x] Find nodes using a CSS selector\n  - [x] Serialize any string with valid or broken html\n  - [x] Get attribute with optional CSS selector\n  - [x] Set attribute with optional CSS selector\n  - [x] Get text with optional CSS selector\n  - [x] Set text with optional CSS selector\n  - [x] Remove a node from html\n  - [x] Append node to another node\n  - [x] Prepend node to another node\n  - [x] Insert node before another node\n  - [x] Insert node after another node\n  - [x] Replace node with another node\n  - [x] Slice html to a subset of nodes\n  - [x] Get position of node in relation to its parent\n  - [x] Wrap node with another node\n  - [x] Pretty print html\n  - [ ] Compare two html strings\n- [ ] Documentation\n\n## License\n\nmodest_html is under LGPL license. Check the [LICENSE](https://github.com/f34nk/modest_html/blob/master/LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff34nk%2Fmodest_html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff34nk%2Fmodest_html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff34nk%2Fmodest_html/lists"}