{"id":48606306,"url":"https://github.com/github/mdbook-asciinema","last_synced_at":"2026-04-16T06:10:25.509Z","repository":{"id":347000705,"uuid":"1186819509","full_name":"github/mdbook-asciinema","owner":"github","description":"An mdbook preprocessor for embedding asciinema terminal recordings in your book","archived":false,"fork":false,"pushed_at":"2026-03-26T09:20:15.000Z","size":131,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-27T03:27:55.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","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/github.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-20T02:48:20.000Z","updated_at":"2026-03-26T09:20:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/github/mdbook-asciinema","commit_stats":null,"previous_names":["github/mdbook-asciinema"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/github/mdbook-asciinema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fmdbook-asciinema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fmdbook-asciinema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fmdbook-asciinema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fmdbook-asciinema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/mdbook-asciinema/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fmdbook-asciinema/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31573876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2026-04-09T00:00:43.638Z","updated_at":"2026-04-09T00:02:01.710Z","avatar_url":"https://github.com/github.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"[Latest Version]: https://img.shields.io/crates/v/mdbook-asciinema.svg\n[crates.io]: https://crates.io/crates/mdbook-asciinema\n\n# `mdbook-asciinema` \u0026emsp; [![Latest Version]][crates.io] [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/github/mdbook-asciinema/blob/main/LICENSE)\n\nAn [`mdbook`](https://github.com/rust-lang/mdBook) preprocessor that embeds [`asciinema`](https://asciinema.org) terminal recordings directly into your book pages using the [asciinema-player](https://docs.asciinema.org/manual/player/).\n\n## Installation\n\n- [Install `mdbook`](https://rust-lang.github.io/mdBook/guide/installation.html)\n\n- Install `mdbook-asciinema`:\n\n  To install the latest release published to [crates.io](https://crates.io/crates/mdbook-asciinema):\n\n  ```sh\n  cargo install mdbook-asciinema --locked\n  ```\n\n  To install the latest version committed to GitHub:\n\n  ```sh\n  cargo install mdbook-asciinema --git https://github.com/github/mdbook-asciinema.git --locked\n  ```\n\n## Getting Started\n\nCreate a new book.\n\n```bash\nmdbook init --force --title \u003cTITLE\u003e\n```\n\nEdit the `book.toml` file; add the `asciinema` preprocessor.\n\n```toml\n[book]\ntitle = \"My Book\"\n\n[preprocessor.asciinema]\n```\n\nAdd your asciicast file/s into a path underneath `src`.\n\n```\nPROJ_DIR\n├── book\n├── book.toml\n└── src\n    ├── chapter_1.md\n    ├── SUMMARY.md\n    └── video\n        └── demo.cast\n```\n\nAdd a helper tag to a markdown file (e.g. `chapter_1.md`).\n\n```md\n# Chapter 1\n\n{{ #asciinema video/demo.cast }}\n\n```\n\nSee the [example](example/) directory for a ready-to-run setup.\n\nPreview the book by running [mdbook serve](https://rust-lang.github.io/mdBook/cli/serve.html).\n\n```bash\n\u003e mdbook serve\n INFO Book building has started\n INFO mdbook_asciinema: created \"[PROJ_DIR]/src/lib/asciinema-player/asciinema-player.min.js\"\n INFO mdbook_asciinema: created \"[PROJ_DIR]/src/lib/asciinema-player/asciinema-player.css\"\n INFO Running the html backend\n INFO HTML book written to `[PROJ_DIR]/book`\n INFO Serving on: http://localhost:3000\n INFO Watching for changes...\n```\n\n## Syntax\n\nThe general form of the helper tag is:\n\n```md\n{{ #asciinema \u003cpath\u003e [opts=\u003cpath\u003e] [scope=\u003cstring\u003e] }}\n```\n\n| Parameter  | Required | Description |\n|------------|----------|-------------|\n| `path`     | Yes      | Relative path (from `src`) to a `.cast` asciicast file. |\n| `opts`     | No       | Relative path to a JSON file containing [player options](https://docs.asciinema.org/manual/player/options/). |\n| `scope`    | No       | Scope identifer to provide [control](https://docs.asciinema.org/manual/player/api/#control-inspection) of a specific asciinema player. The provided value should be an alphanumeric string of length between 5 and 10 characters. If this value is not provided or does not meet these restrictions, a random alphanumeric string 10 characters in length will be generated. Each asciinema player will be declared:\u003cbr /\u003e\u003cbr /\u003e`const player_{scope} = AsciinemaPlayer.create('{path}', document.querySelector('div[b-{scope}]'));`. |\n\n### Player Options\n\nTo customise playback, create a JSON file with [asciinema-player options](https://docs.asciinema.org/manual/player/options/) and reference it with the `opts` parameter:\n\n```json\n{\n  \"autoPlay\": true,\n  \"speed\": 2,\n  \"idleTimeLimit\": 0.5,\n  \"cols\": 400,\n  \"rows\": 51,\n  \"fit\": false,\n  \"terminalFontSize\": \"15px\"\n}\n```\n\n```md\n{{ #asciinema video/demo.cast opts=video/player-opts.json }}\n```\n\n### Escaping\n\nTo display the helper tag literally without rendering it, prefix it with a backslash:\n\n```md\n\\{{ #asciinema video/demo.cast }}\n```\n\n## How It Works\n\nWhen `mdbook` builds or serves the book, this preprocessor:\n\n1. Copies the bundled asciinema-player JavaScript and CSS assets into `src/lib/asciinema-player/`.\n2. Scans each chapter for `{{ #asciinema ... }}` tags.\n3. Replaces each tag with the HTML and JavaScript needed to render an embedded asciinema-player.\n\n## Verifying Release Artifacts\n\nAll release binaries include [build provenance attestations](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds) and an [SBOM (Software Bill of Materials)](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds#about-sbom-attestations) in SPDX format.\n\nTo verify the provenance of a downloaded binary:\n\n```sh\ngh attestation verify \u003cartifact-file\u003e --repo github/mdbook-asciinema\n```\n\nTo verify the SBOM attestation:\n\n```sh\ngh attestation verify \u003cartifact-file\u003e --repo github/mdbook-asciinema --predicate-type https://spdx.dev/Document\n```\n\n## License\n\nLicensed under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fmdbook-asciinema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Fmdbook-asciinema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fmdbook-asciinema/lists"}