{"id":19256509,"url":"https://github.com/instant-dev/copenhagen","last_synced_at":"2026-06-16T08:31:10.419Z","repository":{"id":259330573,"uuid":"725341353","full_name":"instant-dev/copenhagen","owner":"instant-dev","description":"Collaborative code editor","archived":false,"fork":false,"pushed_at":"2024-11-01T20:39:25.000Z","size":765,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-23T17:46:27.423Z","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/instant-dev.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":"2023-11-30T00:00:35.000Z","updated_at":"2024-11-01T20:39:28.000Z","dependencies_parsed_at":"2024-10-24T13:24:55.029Z","dependency_job_id":"afd73c8e-e08d-48fe-851f-1b04b35351bd","html_url":"https://github.com/instant-dev/copenhagen","commit_stats":null,"previous_names":["instant-dev/copenhagen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/instant-dev/copenhagen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instant-dev%2Fcopenhagen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instant-dev%2Fcopenhagen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instant-dev%2Fcopenhagen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instant-dev%2Fcopenhagen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instant-dev","download_url":"https://codeload.github.com/instant-dev/copenhagen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instant-dev%2Fcopenhagen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34398405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-09T19:06:00.165Z","updated_at":"2026-06-16T08:31:10.405Z","avatar_url":"https://github.com/instant-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🇩🇰 Copenhagen Editor\n\n**Copenhagen** is a free, lightweight and hackable\nopen source code editor for the web. It's written entirely in vanilla JavaScript\nwith only [highlight.js](https://highlightjs.org/) and\n[feather icons](https://feathericons.com) bundled as\ndependencies.\n\n![Copenhagen Demo](/readme/gallery/01.gif)\n\n# Getting Started\n\nTo get started with Copenhagen, add `copenhagen.v0-3-0.min.css`\nand `copenhagen.v0-3-0.min.js` to your web project.\nYou can find them in this repository.\nThen import them to your webpage by adding the following lines in the\n`\u003chead\u003e` tag of your webpage:\n\n```html\n\u003c!-- Copenhagen Editor --\u003e\n\u003clink rel=\"stylesheet\" href=\"./compiled/copenhagen.v0-3-0.min.css\"\u003e\n\u003cscript src=\"./compiled/copenhagen.v0-3-0.min.js\"\u003e\u003c/script\u003e\n```\n\nYou can then instantiate a new Editor adding the following JavaScript\nwithin a `\u003cscript\u003e` tag:\n\n```javascript\n// Use DOMContentLoaded or whatever instantiation code you'd like,\n// just make sure the page is ready...\nwindow.addEventListener('DOMContentLoaded', function () {\n\n  // instantiated CPHEditor instance with config\n  var editor = new Copenhagen.Editor({language: 'javascript'});\n\n  // open, but do not auto-focus the editor\n  editor.open(this.selector('.some-selector'), false);\n\n  // set a value\n  editor.setValue('var message = `hello world`;');\n\n});\n```\n\nAlternatively, you can automatically convert all elements matching a\nspecific selector. This will automatically pass in config values\nvia `data-*` attributes on the HTML tag.\n\n```html\n\u003cdiv class=\"editor\" data-language=\"html\" data-maxrows=\"20\"\u003e\n  // some code\n\u003c/div\u003e\n```\n\n```javascript\nwindow.addEventListener('DOMContentLoaded', function () {\n  var editors = Copenhagen.initSelectorAll('.editor');\n});\n```\n\n# Hacking the Editor, Contributing\n\nHacking the editor and making updates is simple. We recommend you install the\nAutocode command line tools to get started.\n\n[Autocode CLI, stdlib/lib on Github](https://github.com/stdlib/lib/)\n\nOnce installed, you can run your own local instance of the Autocode HTTP gateway\nusing;\n\n```\n$ lib http\n```\n\nAnd then visit `http://localhost:3434/dev/raw/` or `http://localhost:3434/dev/min/`\nto play with the raw or minified compiled version of the editor. You can change\nthe editor code via the `src/` directory in this repository.\n\n## Compiling Copenhagen\n\n**You can only compile the editor when running locally**, this is not available\nvia the Autocode web interface because live web services run a read-only filesystem.\n\nTo compile changes to a single script / css file, simply run:\n\n```\n$ lib .compile --filename script.js --min t --write t\n$ lib .compile --filename style.css --min t --write t\n```\n\nYou can remove the `--min t` flag if you want to compile the non-minified versions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstant-dev%2Fcopenhagen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstant-dev%2Fcopenhagen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstant-dev%2Fcopenhagen/lists"}