{"id":15141823,"url":"https://github.com/nativescript/marked-terminal","last_synced_at":"2025-09-29T10:31:11.450Z","repository":{"id":141978055,"uuid":"225873721","full_name":"NativeScript/marked-terminal","owner":"NativeScript","description":"A Renderer for the marked project. Allowing you to render Markdown to print to your Terminal","archived":false,"fork":true,"pushed_at":"2019-12-04T14:37:41.000Z","size":157,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-23T10:01:06.969Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mikaelbr/marked-terminal","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NativeScript.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}},"created_at":"2019-12-04T13:27:17.000Z","updated_at":"2019-12-04T13:27:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"82877034-6fa8-4a10-bc68-ee563e60706f","html_url":"https://github.com/NativeScript/marked-terminal","commit_stats":{"total_commits":102,"total_committers":23,"mean_commits":4.434782608695652,"dds":"0.36274509803921573","last_synced_commit":"f47087216cbdaa8647df60276b80ab3fb7109419"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fmarked-terminal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fmarked-terminal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fmarked-terminal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fmarked-terminal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NativeScript","download_url":"https://codeload.github.com/NativeScript/marked-terminal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219874490,"owners_count":16554583,"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-09-26T09:02:22.335Z","updated_at":"2025-09-29T10:31:06.095Z","avatar_url":"https://github.com/NativeScript.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"marked-terminal\n===\n\n\u003e Custom Renderer for [marked](https://github.com/chjj/marked)\nallowing for printing Markdown to the Terminal. Supports pretty tables, syntax\nhighlighting for javascript, and overriding all colors and styles.\n\nCould for instance be used to print usage information.\n\n[![Build Status](https://img.shields.io/travis/mikaelbr/marked-terminal.svg)](https://travis-ci.org/mikaelbr/marked-terminal) [![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\nvar marked = require('marked');\nvar TerminalRenderer = require('marked-terminal');\n\nmarked.setOptions({\n  // Define custom renderer\n  renderer: new TerminalRenderer()\n});\n\n// Show the parsed data\nconsole.log(marked('# Hello \\n This is **markdown** printed in the `terminal`'));\n```\n\nThis will produce the following:\n\n![Screenshot of marked-terminal](./screenshot.png)\n\n\n### Syntax Highlighting\n\nAlso have support for syntax highlighting using [cardinal](https://github.com/thlorenz/cardinal).\nYou can override highlight defaults by passing in settings as the second argument for TerminalRenderer,\nor you can create a `.cardinalrc` as defined in the [cardinal README](https://github.com/thlorenz/cardinal).\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`\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-table\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```\n\n#### Example of overriding defaults\n```javascript\nmarked.setOptions({\n  renderer: new TerminalRenderer({\n    codespan: chalk.underline.magenta,\n  })\n});\n```\n\n### `highlightOptions`\nOptions passed into [cardinal](https://github.com/thlorenz/cardinal). See\nreadme there to see what options to pass.\n\n\nSee [more examples](./example/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript%2Fmarked-terminal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnativescript%2Fmarked-terminal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript%2Fmarked-terminal/lists"}