{"id":13515732,"url":"https://github.com/acode/copenhagen","last_synced_at":"2025-04-05T23:10:51.082Z","repository":{"id":45195086,"uuid":"348613742","full_name":"acode/copenhagen","owner":"acode","description":" Free, lightweight and hackable open source code editor for the web","archived":false,"fork":false,"pushed_at":"2022-08-14T16:45:17.000Z","size":2302,"stargazers_count":501,"open_issues_count":9,"forks_count":30,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-29T22:08:16.458Z","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/acode.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}},"created_at":"2021-03-17T07:13:27.000Z","updated_at":"2025-03-23T05:22:52.000Z","dependencies_parsed_at":"2022-08-12T11:41:06.638Z","dependency_job_id":null,"html_url":"https://github.com/acode/copenhagen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acode%2Fcopenhagen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acode%2Fcopenhagen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acode%2Fcopenhagen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acode%2Fcopenhagen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acode","download_url":"https://codeload.github.com/acode/copenhagen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411235,"owners_count":20934653,"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-01T05:01:15.371Z","updated_at":"2025-04-05T23:10:51.060Z","avatar_url":"https://github.com/acode.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"readme":"# 🇩🇰 Copenhagen Editor\n\n**Copenhagen** is a free, lightweight and hackable\nopen source code editor for the web. It's responsible for powering the\ncode-editing experience on [Autocode](https://autocode.com/),\nand it's written entirely in vanilla JavaScript with only\n[highlight.js](https://highlightjs.org/) and\n[feather icons](https://feathericons.com) bundled as\ndependencies.\n\nDocumentation is available at [copenhagen.autocode.com](https://copenhagen.autocode.com).\nYou can also play around with your own installation right away by forking this\nrepository in Autocode:\n\n[\u003cimg src=\"https://open.autocode.com/static/images/open.svg?\" width=\"192\"\u003e](https://open.autocode.com/)\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# Documentation\n\nDocumentation is available at [copenhagen.autocode.com/docs.html](https://copenhagen.autocode.com/docs.html).\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\n# Development and license\n\nThe development of Copenhagen is funded by commercial interests and is\nowned by Polybit Inc. DBA Autocode but is fully open source and MIT licensed.\nWe do not profit off of the development of Copenhagen directly; proceeds from\nour commercial offering help fund its development.\n\n# Updates and who to follow\n\nYou can follow Autocode team updates on Twitter at\n[@AutocodeHQ](https://twitter.com/AutocodeHQ). The primary\nauthor of Copenhagen is [@keithwhor (Keith Horwood)](https://twitter.com/keithwhor)\nwith the support of [@Hacubu (Jacob Lee)](https://twitter.com/Hacubu).\nSpecial thanks to [@threesided (Scott Gamble)](https://twitter.com/threesided)\nand [@YusufMusleh](https://twitter.com/yusufmusleh) for hundreds\nof hours of testing in total, and thanks to our users and customers for\nplenty of feedback. Enjoy Copenhagen, we sure have! 😎\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facode%2Fcopenhagen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facode%2Fcopenhagen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facode%2Fcopenhagen/lists"}