{"id":17006065,"url":"https://github.com/duologic/jsonml-libsonnet","last_synced_at":"2026-03-18T23:06:50.213Z","repository":{"id":244867741,"uuid":"816515512","full_name":"Duologic/jsonml-libsonnet","owner":"Duologic","description":"Jsonnet library to generate XML/HTML.","archived":false,"fork":false,"pushed_at":"2024-06-18T11:19:20.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-27T10:43:28.321Z","etag":null,"topics":["html","jsonml","jsonnet","jsonnet-lib","xml"],"latest_commit_sha":null,"homepage":"","language":"Jsonnet","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Duologic.png","metadata":{"files":{"readme":"docs/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-06-17T23:07:31.000Z","updated_at":"2024-11-20T11:37:07.000Z","dependencies_parsed_at":"2024-06-18T00:38:47.608Z","dependency_job_id":"d3433305-7c72-464b-a9f9-5059ccfc4b08","html_url":"https://github.com/Duologic/jsonml-libsonnet","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"ddda88d1deb637197e87f75bf1ef97bde902d185"},"previous_names":["duologic/jsonml-libsonnet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Duologic%2Fjsonml-libsonnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Duologic%2Fjsonml-libsonnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Duologic%2Fjsonml-libsonnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Duologic%2Fjsonml-libsonnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Duologic","download_url":"https://codeload.github.com/Duologic/jsonml-libsonnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244945591,"owners_count":20536296,"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":["html","jsonml","jsonnet","jsonnet-lib","xml"],"created_at":"2024-10-14T05:04:55.769Z","updated_at":"2026-01-05T05:05:28.380Z","avatar_url":"https://github.com/Duologic.png","language":"Jsonnet","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsonml-libsonnet\n\nJsonnet library to generate XML/HTML.\n## Install\n\n```\njb install github.com/Duologic/jsonml-libsonnet@main\n```\n\n## Usage\n\n```jsonnet\nlocal ml = import 'github.com/Duologic/jsonml-libsonnet/main.libsonnet';\n\nlocal head = ml.tag.new('head');\n\nlocal body =\n  ml.tag.new('body')\n  + ml.tag.withElements(\n    ml.tag.new('h1')\n    + ml.tag.withElements(\n      ml.literal.new('title')\n    )\n  );\n\nlocal html =\n  ml.tag.new('html')\n  + ml.tag.withAttributes(\n    ml.attribute.new('lang', 'en')\n  )\n  + ml.tag.withElements([\n    head,\n    body,\n  ]);\n\n\nhtml.manifest()\n\n```\n\n\n## Index\n\n* [`obj attribute`](#obj-attribute)\n  * [`fn new(name, value)`](#fn-attributenew)\n  * [`fn withName(value)`](#fn-attributewithname)\n  * [`fn withType()`](#fn-attributewithtype)\n  * [`fn withValue(value)`](#fn-attributewithvalue)\n* [`obj literal`](#obj-literal)\n  * [`fn new(value)`](#fn-literalnew)\n  * [`fn withType()`](#fn-literalwithtype)\n  * [`fn withValue(value)`](#fn-literalwithvalue)\n* [`obj tag`](#obj-tag)\n  * [`fn new(name)`](#fn-tagnew)\n  * [`fn withAttributes(value)`](#fn-tagwithattributes)\n  * [`fn withAttributesMixin(value)`](#fn-tagwithattributesmixin)\n  * [`fn withElements(value)`](#fn-tagwithelements)\n  * [`fn withElementsMixin(value)`](#fn-tagwithelementsmixin)\n  * [`fn withName(value)`](#fn-tagwithname)\n  * [`fn withType()`](#fn-tagwithtype)\n\n## Fields\n\n### obj attribute\n\n\n#### fn attribute.new\n\n```jsonnet\nattribute.new(name, value)\n```\n\nPARAMETERS:\n\n* **name** (`string`)\n* **value** (`boolean`,`null`,`number`,`string`)\n\n\n#### fn attribute.withName\n\n```jsonnet\nattribute.withName(value)\n```\n\nPARAMETERS:\n\n* **value** (`string`)\n\n\n#### fn attribute.withType\n\n```jsonnet\nattribute.withType()\n```\n\n\n\n#### fn attribute.withValue\n\n```jsonnet\nattribute.withValue(value)\n```\n\nPARAMETERS:\n\n* **value** (`boolean`,`null`,`number`,`string`)\n\n\n### obj literal\n\n\n#### fn literal.new\n\n```jsonnet\nliteral.new(value)\n```\n\nPARAMETERS:\n\n* **value** (`string`)\n\n\n#### fn literal.withType\n\n```jsonnet\nliteral.withType()\n```\n\n\n\n#### fn literal.withValue\n\n```jsonnet\nliteral.withValue(value)\n```\n\nPARAMETERS:\n\n* **value** (`string`)\n\n\n### obj tag\n\n\n#### fn tag.new\n\n```jsonnet\ntag.new(name)\n```\n\nPARAMETERS:\n\n* **name** (`string`)\n\n\n#### fn tag.withAttributes\n\n```jsonnet\ntag.withAttributes(value)\n```\n\nPARAMETERS:\n\n* **value** (`array`)\n\n\n#### fn tag.withAttributesMixin\n\n```jsonnet\ntag.withAttributesMixin(value)\n```\n\nPARAMETERS:\n\n* **value** (`array`)\n\n\n#### fn tag.withElements\n\n```jsonnet\ntag.withElements(value)\n```\n\nPARAMETERS:\n\n* **value** (`array`)\n\n\n#### fn tag.withElementsMixin\n\n```jsonnet\ntag.withElementsMixin(value)\n```\n\nPARAMETERS:\n\n* **value** (`array`)\n\n\n#### fn tag.withName\n\n```jsonnet\ntag.withName(value)\n```\n\nPARAMETERS:\n\n* **value** (`string`)\n\n\n#### fn tag.withType\n\n```jsonnet\ntag.withType()\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduologic%2Fjsonml-libsonnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduologic%2Fjsonml-libsonnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduologic%2Fjsonml-libsonnet/lists"}