{"id":19345656,"url":"https://github.com/blhmr/hcml","last_synced_at":"2026-05-13T21:32:59.831Z","repository":{"id":219811604,"uuid":"749999262","full_name":"blhmr/HCML","owner":"blhmr","description":"Hatim's Configuration Markup Language","archived":false,"fork":false,"pushed_at":"2024-02-29T13:47:01.000Z","size":123,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-16T21:06:02.816Z","etag":null,"topics":["c","config","configuration","database","database-management","gcc","markup","markup-converter","markup-language"],"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/blhmr.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":"2024-01-29T19:51:13.000Z","updated_at":"2025-04-17T13:17:50.000Z","dependencies_parsed_at":"2024-02-07T22:29:16.900Z","dependency_job_id":"b8ad7081-b811-4674-8826-e58df564a075","html_url":"https://github.com/blhmr/HCML","commit_stats":null,"previous_names":["blhmr/hcml"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blhmr/HCML","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blhmr%2FHCML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blhmr%2FHCML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blhmr%2FHCML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blhmr%2FHCML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blhmr","download_url":"https://codeload.github.com/blhmr/HCML/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blhmr%2FHCML/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33000911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","config","configuration","database","database-management","gcc","markup","markup-converter","markup-language"],"created_at":"2024-11-10T04:07:35.253Z","updated_at":"2026-05-13T21:32:59.814Z","avatar_url":"https://github.com/blhmr.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://cdn.discordapp.com/attachments/1043106668839456860/1209171188237082654/303505010-2f3b85ac-f566-46a8-9ad0-939b42ee60b7.png?ex=65e5f36c\u0026is=65d37e6c\u0026hm=6509cef9ac6ca1128e90cb3a9fbf483d566cc9aadcdd83e43b0ff2acb5a10494\u0026\" alt=\"HCML\" style=\"display: block; margin: 0 auto; width: 200px; height: 200px;\"\u003e\n\n# HCML 📎 (Hatim's Configuration Markup Language)\n\nHCML is a lightweight markup language designed for configuring applications. It provides a simple and human-readable syntax for specifying key-value pairs and hierarchical data structures.\n\n## Features\n\n- Simple and intuitive syntax\n- Support for key-value pairs\n- Lightweight and easy to use\n- Portable C library\n- Arrays: parsing a string into array and array from a string\n\n## \n\n## Installation\n\nHCML is a configuration markup language, but right now it can only be used as a C library to manipulate `.hcml` files, more wrappers for more languages are coming soon only if this gets any popular. Here is how to install the library on your system (UNIX):\n\n```bash\ngit clone https://github.com/blhmr/HCML.git\ncd HCML\nmake install\n```\nThere is also a `main.c` file if you want to see an example of usage.\n\n## Usage\n\nLike any other key-value configuration files, HCML has `families` instead of sections:\n\n```html\n# This is a comment\n\n\u003cfamily:key=value\u003e\n\n\u003cinfo/personal:first_name=Hatim\u003e\n\u003cinfo/persnal:last_name=Belahmer\u003e\n\u003cinfo/personal:age=17\u003e\n\u003cinfo/personal:country=Morocco\u003e\n\n\u003cinfo/account:username=hatim225\u003e\n\u003cinfo/account:password=SOMEPASS1234\u003e\n\n\u003cinfo/account:profile_picture=PFP_1\u003e\n\u003cinfo/account:color_scheme=RED\u003e\n```\n### Some rules to follow:\n\n- A family can have many **unique** key-value paires, and by **unique** I mean you can't have the same key names in the same family.\n- The syntax is strict:\n```c\n// family: letters, numbers, underscore and slash\n// key: letters, numbers and underscore\n// value: anything that is in ASCII\n```\nFor example:\n```html\n# Wrong\n\u003cfamily 123:some key=some value\u003e\n\n# Right\n\u003cfamily_123:some_key=some value\u003e\n\n# Right\n\u003cinfo/personal:email=xyz@example.com\u003e\n\n# Right but not as expected, because it'll include the spaces\n\u003cinfo/personal: nationality = Moroccan\u003e\n# So the entry will be:\n# FAMILY: \"info/personal\"\n# KEY: \" nationality \"\n# VALUE: \" Moroccan\"\n```\n\n### Using the minimal C library:\n\n```c\n#include \u003chcml.h\u003e\n\n/* These are set to 50 by default */\n#define MAX_LEN_KEY 50\n#define MAX_LEN_VALUE 50\n#define MAX_LEN_FAMILY 50\n\nint main(void) {\n    hcml_file_t file;\n\n    hcml_file_open(\u0026file, \"newfile.hcml\"); // Returns 0 if success\n\n    hcml_insert_value(\u0026file, \"family\", \"key\", \"value\"); // Returns 0 if success\n\n    hcml_file_close(file); // Same thing\n\n    return 0;\n}\n```\n\nAs simple as that!\nThere are examples in the `example` directory, use `make` to compile the run each example! Read the code for explanations\n\n### Arrays\n\nArrays are here ! Here is how to use them:\n```html\n\u003cfood:fruits=apple;orange;banana\u003e\n```\nThis is an array of family `food`, its key is `fruits` and has the values `apple`, `orange` and `banana`\nWhen using the C library:\n- `bool hcml_value_is_array(const char* value)`: This returns a `bool` value, it checks wether a `value` string is an array so we can use it for parsing\n- `char** hcml_parse_from_array(const char* string)`: This functions returns an `array of strings`, must be freed after working with it, just pass a string that can be parsed using the function above\n- `char* hcml_parse_to_array(int num_args, ...)`: This functions takes a number of `num_args` of arguments as string, converts them into a string buffer that can be treated as an array, or can be written to the HCML file\n\n## Vim\n\nThis language and library was made in Vim, so if you want to use the syntax highlighting file, simply copy and paste this into `.vim/after/syntax/hcml.vim`:\n\n```vim\n\" Language: HCML (Hatim's Configuration Markup Language)\n\" Author: Hatim Belahmer\n\" Last Updated: Monday 2024-01-29\n\n\" Define HCML file extensions\nau BufRead,BufNewFile *.hcml set filetype=hcml\n\n\" Define HCML syntax highlighting\nsyntax region hcmlComment start=\"#.*\" end=\"$\"\nsyntax match hcmlComment \"#.*$\"\n\nsyntax region hcmlTag start=\"\u003c\" end=\"\u003e\" contains=hcmlTagName,hcmlAttribute,hcmlComment\nsyntax match hcmlTagName \"\\\u003c\\w\\+\\%(\\s\\|\u003e\\)\" contained\nsyntax match hcmlAttribute \"\\\u003c\\w\\+\\ze\\s*=\" contained contains=hcmlKey,hcmlValue\nsyntax match hcmlKey \"\\\u003c\\w\\+\\ze\\s*=\" contained\nsyntax match hcmlValue \"\\\u003c[^=]\\+\\ze\\s*=\" contained\n\n\" Highlight HCML tags\nhighlight link hcmlTag Special\nhighlight link hcmlTagName Keyword\nhighlight link hcmlAttribute Identifier\nhighlight link hcmlKey Type\nhighlight link hcmlValue String\nhighlight link hcmlComment Comment\n```\nPreview:\n\u003cimg src=\"https://media.discordapp.net/attachments/1043106668839456860/1209171773975953529/Mon_Feb_19_051207_PM_01_2024.png?ex=65ef2e78\u0026is=65dcb978\u0026hm=a0b2edf2268ad6d5f91d8f955a48b6abb2c7d86ff5fbe70be950df1ee08f3e02\u0026=\u0026format=webp\u0026quality=lossless\u0026width=780\u0026height=439\"\u003e\n\n## Use case\n\nThis language was primarly for personal use, therefore it lacks some features other configuration files have, so keep your expectations low.\nExample of usage: consider the following folder scheme\n\n```\nschool/\n├── class-1/\n│   ├── student-1/\n│   │   ├── history.txt\n│   │   ├── grades/\n│   │   └── information.hcml \u003c- Informations about the student\n│   ├── student-2/\n│   │   ├── history.txt\n│   │   ├── grades/\n│   │   └── information.hcml\n```\n\n## Undone and In Progress\n\n- Bindings for other languages: I will probably only make Python and C++ bindings unless this project gets too popular\n\n## License\n\nThis library is provided under the [MIT License](LICENSE). Feel free to use and modify it in your projects.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblhmr%2Fhcml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblhmr%2Fhcml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblhmr%2Fhcml/lists"}