{"id":16396998,"url":"https://github.com/mottox2/remark-code-titles","last_synced_at":"2025-03-21T02:32:28.271Z","repository":{"id":43040935,"uuid":"168344119","full_name":"mottox2/remark-code-titles","owner":"mottox2","description":null,"archived":false,"fork":false,"pushed_at":"2021-05-01T14:56:51.000Z","size":9,"stargazers_count":16,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T05:48:51.971Z","etag":null,"topics":["remark-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mottox2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-30T13:03:35.000Z","updated_at":"2025-02-21T23:00:30.000Z","dependencies_parsed_at":"2022-09-09T17:01:07.971Z","dependency_job_id":null,"html_url":"https://github.com/mottox2/remark-code-titles","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mottox2%2Fremark-code-titles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mottox2%2Fremark-code-titles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mottox2%2Fremark-code-titles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mottox2%2Fremark-code-titles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mottox2","download_url":"https://codeload.github.com/mottox2/remark-code-titles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244725588,"owners_count":20499633,"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":["remark-plugin"],"created_at":"2024-10-11T05:08:58.944Z","updated_at":"2025-03-21T02:32:27.968Z","avatar_url":"https://github.com/mottox2.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# remark-code-titles\n\n[![npm version](https://badge.fury.io/js/remark-code-titles.svg)](https://badge.fury.io/js/remark-code-titles)\n\n[Remark](https://github.com/remarkjs/remark) plugin to add code title inspired by [gatsby-remark-code-titles](https://github.com/DSchau/gatsby-remark-code-titles)\n\n## Usage\n\nWe have the following file, `hello.md`:\n\n~~~markdown\n# Hello World\n\n```js:hello.js\nconsole.log('js')\n```\n~~~\n\nAnd our script, `hello.js`, lokks as follows:\n\n```js:sample.js\nconst vfile = require('to-vfile')\nconst unified = require('unified')\nconst parse = require('remark-parse')\nconst codeTitle = require('remark-code-titles')\nconst html = require('remark-html')\n\nconst result = unified()\n  .use(parse)\n  .use(codeTitle)\n  .use(html)\n  .process(vfile.readSync('./hello.md'), (err, file) =\u003e {\n    if (err) throw err\n    console.log(String(file))\n  })\n```\n\nNow, running `node hello.js` yields:\n\n```html\n\u003ch1\u003eHello World\u003c/h1\u003e\n\u003cdiv class=\"remark-code-title\"\u003ehello.js\u003c/div\u003e\n\u003cpre\u003e\u003ccode class=\"language-js\"\u003econsole.log('js')\n\u003c/code\u003e\u003c/pre\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmottox2%2Fremark-code-titles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmottox2%2Fremark-code-titles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmottox2%2Fremark-code-titles/lists"}