{"id":13799364,"url":"https://github.com/mikaelbr/marked-terminal","last_synced_at":"2025-05-15T01:05:50.773Z","repository":{"id":19126146,"uuid":"22355576","full_name":"mikaelbr/marked-terminal","owner":"mikaelbr","description":"A Renderer for the marked project. Allowing you to render Markdown to print to your Terminal","archived":false,"fork":false,"pushed_at":"2025-03-31T13:27:18.000Z","size":744,"stargazers_count":436,"open_issues_count":21,"forks_count":62,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-22T13:49:20.751Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/mikaelbr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2014-07-28T19:47:28.000Z","updated_at":"2025-04-20T06:19:52.000Z","dependencies_parsed_at":"2023-09-22T12:11:42.080Z","dependency_job_id":"f789b3e4-6a9f-42eb-b122-cab3ec24812f","html_url":"https://github.com/mikaelbr/marked-terminal","commit_stats":{"total_commits":185,"total_committers":31,"mean_commits":5.967741935483871,"dds":"0.48108108108108105","last_synced_commit":"50117298495ce0b5f917428ebc6c9d06e122e791"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelbr%2Fmarked-terminal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelbr%2Fmarked-terminal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelbr%2Fmarked-terminal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelbr%2Fmarked-terminal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikaelbr","download_url":"https://codeload.github.com/mikaelbr/marked-terminal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254039,"owners_count":22039792,"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":[],"created_at":"2024-08-04T00:01:01.950Z","updated_at":"2025-05-15T01:05:50.752Z","avatar_url":"https://github.com/mikaelbr.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized","JavaScript"],"sub_categories":["Uncategorized"],"readme":"# marked-terminal\n\n\u003e Custom Renderer for [marked](https://github.com/chjj/marked)\n\u003e allowing for printing Markdown to the Terminal. Supports pretty tables, syntax\n\u003e highlighting for javascript, and overriding all colors and styles.\n\nCould for instance be used to print usage information.\n\n[![build](https://github.com/mikaelbr/marked-terminal/actions/workflows/ci.yml/badge.svg)](https://github.com/mikaelbr/marked-terminal/actions/workflows/ci.yml) [![npm marked-terminal](https://img.shields.io/npm/v/marked-terminal.svg)](https://www.npmjs.com/package/marked-terminal)\n\n## Install\n\n```sh\nnpm install marked marked-terminal\n```\n\n## Example\n\n```javascript\nimport { marked } from 'marked';\nimport { markedTerminal } from 'marked-terminal';\n\nmarked.use(markedTerminal([options][, highlightOptions]));\n\nmarked.parse('# Hello \\n This is **markdown** printed in the `terminal`');\n```\n\n### Using older versions\n\n```javascript\nconst marked = require('marked');\nconst TerminalRenderer = require('marked-terminal');\n\nmarked.setOptions({\n  // Define custom renderer\n  renderer: new TerminalRenderer()\n});\n\n// Show the parsed data\nconsole.log(\n  marked('# Hello \\n This is **markdown** printed in the `terminal`')\n);\n```\n\nThis will produce the following:\n\n![Screenshot of marked-terminal](./screenshot.png)\n\n### Syntax Highlighting\n\nAlso have support for syntax highlighting using [cli-highlight](https://github.com/felixfbecker/cli-highlight).\nYou can override highlighting defaults by passing in settings as the second argument for TerminalRenderer.\n\nHaving the following markdown input:\n\n\u003cpre\u003e\n```js\nvar foo = function(bar) {\n  console.log(bar);\n};\nfoo('Hello');\n```\n\u003c/pre\u003e\n\n...we will convert it into terminal format:\n\n```javascript\n// Show the parsed data\nconsole.log(marked(exampleSource));\n```\n\nThis will produce the following:\n\n![Screenshot of marked-terminal](./screenshot2.png)\n\n## API\n\nConstructur: `new TerminalRenderer([options][, highlightOptions])`\n\n### `options`\n\nOptional\nUsed to override default styling.\n\nDefault values are:\n\n```javascript\nvar defaultOptions = {\n  // Colors\n  code: chalk.yellow,\n  blockquote: chalk.gray.italic,\n  html: chalk.gray,\n  heading: chalk.green.bold,\n  firstHeading: chalk.magenta.underline.bold,\n  hr: chalk.reset,\n  listitem: chalk.reset,\n  table: chalk.reset,\n  paragraph: chalk.reset,\n  strong: chalk.bold,\n  em: chalk.italic,\n  codespan: chalk.yellow,\n  del: chalk.dim.gray.strikethrough,\n  link: chalk.blue,\n  href: chalk.blue.underline,\n\n  // Formats the bulletpoints and numbers for lists\n  list: function (body, ordered) {/* ... */},\n\n  // Reflow and print-out width\n  width: 80, // only applicable when reflow is true\n  reflowText: false,\n\n  // Should it prefix headers?\n  showSectionPrefix: true,\n\n  // Whether or not to undo marked escaping\n  // of enitities (\" -\u003e \u0026quot; etc)\n  unescape: true,\n\n  // Whether or not to show emojis\n  emoji: true,\n\n  // Options passed to cli-table3\n  tableOptions: {},\n\n  // The size of tabs in number of spaces or as tab characters\n  tab: 3 // examples: 4, 2, \\t, \\t\\t\n\n  image: function (href, title, text) {} // function for overriding the default image handling.\n};\n```\n\n#### Example of overriding defaults\n\n```javascript\nmarked.setOptions({\n  renderer: new TerminalRenderer({\n    codespan: chalk.underline.magenta\n  })\n});\n```\n\n### `highlightOptions`\n\nOptions passed into [cli-highlight](https://github.com/felixfbecker/cli-highlight). See readme there to see what options to pass.\n\nSee [more examples](./example/)\n\n## Related\n\n- [ink-markdown](https://github.com/cameronhunter/ink-markdown) - Markdown component for Ink\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikaelbr%2Fmarked-terminal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikaelbr%2Fmarked-terminal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikaelbr%2Fmarked-terminal/lists"}