{"id":16309092,"url":"https://github.com/susisu/mte-kernel","last_synced_at":"2025-10-25T05:44:20.157Z","repository":{"id":43612949,"uuid":"102928335","full_name":"susisu/mte-kernel","owner":"susisu","description":"text editor independent part of markdown-table-editor","archived":false,"fork":false,"pushed_at":"2020-11-28T10:49:13.000Z","size":447,"stargazers_count":78,"open_issues_count":2,"forks_count":39,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-03T15:08:19.631Z","etag":null,"topics":["javascript","markdown"],"latest_commit_sha":null,"homepage":"","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/susisu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-09T05:02:54.000Z","updated_at":"2025-06-03T13:45:36.000Z","dependencies_parsed_at":"2022-09-13T18:21:23.950Z","dependency_job_id":null,"html_url":"https://github.com/susisu/mte-kernel","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/susisu/mte-kernel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/susisu%2Fmte-kernel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/susisu%2Fmte-kernel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/susisu%2Fmte-kernel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/susisu%2Fmte-kernel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/susisu","download_url":"https://codeload.github.com/susisu/mte-kernel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/susisu%2Fmte-kernel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262766152,"owners_count":23361047,"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":["javascript","markdown"],"created_at":"2024-10-10T21:19:39.989Z","updated_at":"2025-10-25T05:44:15.122Z","avatar_url":"https://github.com/susisu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# markdown-table-editor kernel\nThe text editor independent part of [atom-markdown-table-editor][atom-mte].\n\n![demo](https://github.com/susisu/markdown-table-editor/wiki/images/demo.gif)\n\n[You can try it on your browser!](https://susisu.github.io/mte-demo/)\n\n## Installation\n``` shell\nnpm i -S @susisu/mte-kernel\n```\n\n## Usage\nImplement an [interface to the text editor][doc-ITextEditor].\n\n``` javascript\ninterface ITextEditor {\n  getCursorPosition(): Point;\n  setCursorPosition(pos: Point): void;\n  setSelectionRange(range: Range): void;\n  getLastRow(): number;\n  acceptsTableEdit(row: number): boolean;\n  getLine(row: number): string;\n  insertLine(row: number, line: string): void;\n  deleteLine(row: number): void;\n  replaceLines(startRow: number, endRow: number, lines: Array\u003cstring\u003e): void;\n  transact(func: Function): void;\n}\n```\n\nAnd then you can execute [commands][doc-TableEditor] through a `TableEditor` object.\n\n``` javascript\nimport { TableEditor, options } from \"@susisu/mte-kernel\";\nconst textEditor = ...; // interface to the text editor\nconst tableEditor = new TableEditor(textEditor);\ntableEditor.formatAll(options({}));\n```\n\nSee the [API reference][doc-API] for more information.\nIt is also good to look into [atom-markdown-table-editor][atom-mte-repo] as a reference implementation.\n\n[doc-API]: https://doc.esdoc.org/github.com/susisu/mte-kernel/identifiers.html\n[doc-ITextEditor]:  https://doc.esdoc.org/github.com/susisu/mte-kernel/class/lib/text-editor.js~ITextEditor.html\n[doc-TableEditor]:  https://doc.esdoc.org/github.com/susisu/mte-kernel/class/lib/table-editor.js~TableEditor.html\n[atom-mte]: https://atom.io/packages/markdown-table-editor\n[atom-mte-repo]: https://github.com/susisu/atom-markdown-table-editor\n\n## License\n[MIT License](http://opensource.org/licenses/mit-license.php)\n\n## Author\nSusisu ([GitHub](https://github.com/susisu), [Twitter](https://twitter.com/susisu2413))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsusisu%2Fmte-kernel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsusisu%2Fmte-kernel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsusisu%2Fmte-kernel/lists"}