{"id":18109666,"url":"https://github.com/replit/codemirror-indentation-markers","last_synced_at":"2025-04-05T07:07:59.240Z","repository":{"id":45734840,"uuid":"450676207","full_name":"replit/codemirror-indentation-markers","owner":"replit","description":"A CodeMirror extension that renders indentation markers","archived":false,"fork":false,"pushed_at":"2024-07-15T21:42:31.000Z","size":252,"stargazers_count":66,"open_issues_count":7,"forks_count":19,"subscribers_count":32,"default_branch":"main","last_synced_at":"2025-03-29T06:07:51.017Z","etag":null,"topics":["codemirror","editor","indentation"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@replit/codemirror-indentation-markers","language":"TypeScript","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/replit.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":"2022-01-22T00:12:57.000Z","updated_at":"2025-03-24T19:16:00.000Z","dependencies_parsed_at":"2024-03-13T20:38:47.629Z","dependency_job_id":"2a862240-87bf-47e2-af8a-9fd0e6de2928","html_url":"https://github.com/replit/codemirror-indentation-markers","commit_stats":{"total_commits":33,"total_committers":7,"mean_commits":4.714285714285714,"dds":"0.24242424242424243","last_synced_commit":"f2f8ccdc58fcc51dbe6a82784f2f83fa6ac4648c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Fcodemirror-indentation-markers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Fcodemirror-indentation-markers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Fcodemirror-indentation-markers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/replit%2Fcodemirror-indentation-markers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/replit","download_url":"https://codeload.github.com/replit/codemirror-indentation-markers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299833,"owners_count":20916190,"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":["codemirror","editor","indentation"],"created_at":"2024-11-01T00:01:53.590Z","updated_at":"2025-04-05T07:07:59.215Z","avatar_url":"https://github.com/replit.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":[],"readme":"# CodeMirror Indentation Markers\n\n\u003cspan\u003e\u003ca href=\"https://replit.com/@util/codemirror-indentation-markers\" title=\"Run on Replit badge\"\u003e\u003cimg src=\"https://replit.com/badge/github/replit/codemirror-indentation-markers\" alt=\"Run on Replit badge\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan\u003e\u003ca href=\"https://www.npmjs.com/package/@replit/codemirror-indentation-markers\" title=\"NPM version badge\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@replit/codemirror-indentation-markers?color=blue\" alt=\"NPM version badge\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\nA CodeMirror extension that renders indentation markers using a\nheuristic similar to what other popular editors, like Ace and Monaco, use.\n\n![Example](public/cm-indentation-markers.png)\n\n### Usage\n\n```ts\nimport { basicSetup } from 'codemirror';\nimport { EditorState } from '@codemirror/state';\nimport { EditorView } from '@codemirror/view';\nimport { indentationMarkers } from '@replit/codemirror-indentation-markers';\n\nconst doc = `\ndef max(a, b):\n  if a \u003e b:\n    return a\n  else:\n    return b\n`\n\nnew EditorView({\n  state: EditorState.create({\n    doc,\n    extensions: [basicSetup, indentationMarkers()],\n  }),\n  parent: document.querySelector('#editor'),\n});\n\n```\n\n### Options\n\nYou can provide an options object to `indentationMarkers()` with the following\noptional properties:\n\n- `highlightActiveBlock`\n    \n    Boolean that determines whether the active block marker is styled\n    differently. Setting this to `false` provides a significant performance\n    enhancement because it means that markers do not need to be regenerated\n    when the selection changes. Defaults to `true`.\n \n- `hideFirstIndent`\n\n    Boolean that determines whether markers in the first column are omitted.\n    Defaults to `false`.\n  \n- `markerType`\n  \n    String that determines how far the indentation markers extend. `\"fullScope\"` indicates that the markers extend down the full height of a scope. With the `\"codeOnly\"` option, indentation markers terminate at the last nonempty line in a scope. Defaults to `\"fullScope\"`.\n\n- `thickness`\n\n    Integer that determines the thickness in pixels of the indentation markers. Defaults to `1`.\n\n- `activeThickness`\n\n    Integer that determines the thickness in pixels of the active indentation markers. If `undefined` or `null` then `thickness` will be used. Defaults to `undefined`.\n\n- `colors`\n\n    Object that determines the colors of the indentation markers.\n\n    - `light`\n\n        String that determines the color of the markers when the editor has a light theme. Defaults to `#F0F1F2`.\n\n    - `dark`\n\n        String that determines the color of the markers when the editor has a dark theme. Defaults to `#2B3245`.\n\n    - `activeLight`\n\n        String that determines the color of the active block marker when the editor has a light theme. Only applies if `highlightActiveBlock` is `true`. Defaults to `#E4E5E6`.\n\n    - `activeDark`\n\n        String that determines the color of the active block marker when the editor has a dark theme. Only applies if `highlightActiveBlock` is `true`. Defaults to `#3C445C`.\n\n#### Example\n\n```ts\nnew EditorView({\n  state: EditorState.create({\n    doc,\n    extensions: [\n      basicSetup,\n      indentationMarkers({\n        highlightActiveBlock: false,\n        hideFirstIndent: true,\n        markerType: \"codeOnly\",\n        thickness: 2,\n        colors: {\n          light: 'LightBlue',\n          dark: 'DarkBlue',\n          activeLight: 'LightGreen',\n          activeDark: 'DarkGreen',\n        }\n      })\n    ],\n  }),\n  parent: document.querySelector('#editor'),\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplit%2Fcodemirror-indentation-markers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freplit%2Fcodemirror-indentation-markers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freplit%2Fcodemirror-indentation-markers/lists"}