{"id":23034481,"url":"https://github.com/r4ai/typst-code-info","last_synced_at":"2026-03-20T00:18:54.702Z","repository":{"id":252981989,"uuid":"842099930","full_name":"r4ai/typst-code-info","owner":"r4ai","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-02T15:20:42.000Z","size":253,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T07:53:05.438Z","etag":null,"topics":["typst"],"latest_commit_sha":null,"homepage":"","language":"Typst","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/r4ai.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-08-13T17:09:43.000Z","updated_at":"2024-10-02T15:20:45.000Z","dependencies_parsed_at":"2024-08-13T20:33:47.473Z","dependency_job_id":"ac156929-b053-4994-8c5f-e439b7a67d1f","html_url":"https://github.com/r4ai/typst-code-info","commit_stats":null,"previous_names":["r4ai/typst-code-info"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/r4ai/typst-code-info","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r4ai%2Ftypst-code-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r4ai%2Ftypst-code-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r4ai%2Ftypst-code-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r4ai%2Ftypst-code-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r4ai","download_url":"https://codeload.github.com/r4ai/typst-code-info/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r4ai%2Ftypst-code-info/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28472624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T22:13:38.078Z","status":"ssl_error","status_checked_at":"2026-01-15T22:12:11.737Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["typst"],"created_at":"2024-12-15T16:32:13.522Z","updated_at":"2026-01-15T22:15:37.331Z","avatar_url":"https://github.com/r4ai.png","language":"Typst","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typst-code-info\n\nThis is a library to display code blocks with extra information like captions, line numbers, diff highlights, etc.\n\n## Features\n\n- Show line numbers\n- Calculate diff between two code blocks and highlight the differences\n- Highlighting of specific lines\n- Display captions\n\n## Installation\n\n\u003e [!warning]\n\u003e Following are required to build and install:\n\u003e \n\u003e - [Rust](https://www.rust-lang.org/)\n\u003e - [Task](https://taskfile.dev/)\n\u003e - [Deno](https://deno.com/)\n\n- **From local source**:\n\n  Clone the repository and run the following command:\n\n  ```bash\n  task install\n  ```\n\n## Usage\n\n### Line numbers\n\n````typst\n#import \"../../plugin.typ\": init-code-info, code-info\n\n#show: init-code-info.with()\n\n#code-info(show-line-numbers: true)\n```rust\npub fn add(a: i32, b: i32) -\u003e i32 {\n    a + b\n}\n\npub fn sub(a: i32, b: i32) -\u003e i32 {\n    a - b\n}\n\npub fn mul(a: i32, b: i32) -\u003e i32 {\n    a * b\n}\n\npub fn div(a: i32, b: i32) -\u003e i32 {\n    a / b\n}\n```\n````\n\nyields:\n\n![line-numbers.svg](./.github/fixtures/line-numbers.svg)\n\n### Diff highlighting\n\n````typst\n#import \"../../plugin.typ\": init-code-info, code-info, parse-diff-code\n\n#show: init-code-info.with()\n\n#code-info(\n  diff: true,\n  show-line-numbers: true,\n  always-show-lines: (1,),\n)\n```rust\npub fn add(a: i32, b: i32) -\u003e i32 {\n    a + b\n}\n\npub fn sub(a: i32, b: i32) -\u003e i32 {\n    a - b\n}\n\npub fn mul(a: i32, b: i32) -\u003e i32 {\n    a * b\n}\n\npub fn div(a: i32, b: i32) -\u003e i32 {\n    a / b\n}\n```\n```rust\npub fn add(a: i32, b: i32) -\u003e i32 {\n    a + b\n}\n\npub fn sub(a: i32, b: i32) -\u003e i32 {\n    let c = a - b;\n    c\n}\n\npub fn mul(a: i32, b: i32) -\u003e i32 {\n    a * b\n}\n\npub fn div(a: i32, b: i32) -\u003e i32 {\n    a / b\n}\n```\n````\n\nyields:\n\n![diff.svg](./.github/fixtures/diff.svg)\n\n### Captions\n\n````typst\n#import \"../../plugin.typ\": init-code-info, code-info, parse-diff-code\n\n#show: init-code-info.with()\n\n#code-info(\n  caption: [A program to display \"Hello, world!\"],\n  label: \"hello-world\",\n)\n```rust\npub fn main() {\n    println!(\"Hello, world!\");\n}\n```\n\nAccording to @hello-world, the program displays \"Hello, world!\".\n````\n\nyields:\n\n![caption-and-label.svg](./.github/fixtures/caption-and-label.svg)\n\n## Development\n\n### Pre-requisites\n\n- **[typstyle](https://github.com/Enter-tainer/typstyle)**: Formatter for Typst files\n- **[task](https://taskfile.dev/)**: Task runner\n- **[deno](https://deno.com/)**: JavaScript runtime\n\n### Commands\n\n| Command           | Description                          |\n| ----------------- | ------------------------------------ |\n| `task build`      | Build the library                    |\n| `task install`    | Install the library                  |\n| `task gen-readme` | Generate the files used in README.md |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr4ai%2Ftypst-code-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr4ai%2Ftypst-code-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr4ai%2Ftypst-code-info/lists"}