{"id":21420855,"url":"https://github.com/lord-turmoil/codepaste","last_synced_at":"2025-07-14T06:32:41.526Z","repository":{"id":177206285,"uuid":"657032972","full_name":"Lord-Turmoil/CodePaste","owner":"Lord-Turmoil","description":"Provide code highlight and format for Office","archived":false,"fork":false,"pushed_at":"2024-08-18T14:15:24.000Z","size":1786,"stargazers_count":32,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-18T15:29:36.048Z","etag":null,"topics":["alertifyjs","font-awesome","highlight","icons8","office","prismj"],"latest_commit_sha":null,"homepage":"https://paste.tonys-studio.top","language":"CSS","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/Lord-Turmoil.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-06-22T07:05:19.000Z","updated_at":"2024-08-18T15:29:38.429Z","dependencies_parsed_at":"2023-10-16T16:36:20.164Z","dependency_job_id":"bc6e8a20-3260-4154-96cf-1dd8c7a3704f","html_url":"https://github.com/Lord-Turmoil/CodePaste","commit_stats":null,"previous_names":["lord-turmoil/codepaste"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lord-Turmoil%2FCodePaste","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lord-Turmoil%2FCodePaste/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lord-Turmoil%2FCodePaste/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lord-Turmoil%2FCodePaste/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lord-Turmoil","download_url":"https://codeload.github.com/Lord-Turmoil/CodePaste/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225960016,"owners_count":17551655,"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":["alertifyjs","font-awesome","highlight","icons8","office","prismj"],"created_at":"2024-11-22T20:22:53.660Z","updated_at":"2025-07-14T06:32:41.516Z","avatar_url":"https://github.com/Lord-Turmoil.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Code Paste\n\nCopyright \u0026copy; Tony's Studio 2023 - 2025\n\n---\n\n[![Build](https://github.com/Lord-Turmoil/CodePaste/actions/workflows/static.yml/badge.svg?branch=main)](https://github.com/Lord-Turmoil/CodePaste/actions/workflows/static.yml)\n\n## Description\n\nThis tool provides you the ability to create highlighted code block for Microsoft Office, mainly for Word and PowerPoint. You can use it to create a beautiful code block in your document or presentation.\n\n### Try it now!\n\n- [Code Paste on Tony's Studio](https://codepaste.top/)\n- [Code Paste on GitHub Page](https://lord-turmoil.github.io/CodePaste/)\n\n---\n\n## Development\n\nIf you find Code Paste useful and want to host it on your own, this section will be useful. By the way, feel free to contribute to this project. You can report bugs, suggest new features, or even submit a pull request. 😊\n\n### Quick Start\n\nCode Paste is written in native HTML, CSS and JavaScript. To start development, clone the repo first, then install required packages.\n\n```bash\nnpm install\nnpm run init    # initialize placeholder files\n```\n\nThen, you can run the project. There are three options for this.\n\n```bash\nnpm run build  # build for production\nnpm run dev    # build for development and watch for changes\n```\n\n\u003e To preview the project locally, I recommend using [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) plugin for Visual Studio Code. Just open `dist/index.html` after your local server is on.\n\n### Code Samples\n\nCode Paste provides sample code for each supported language. The supported languages are listed in `languages/lang.yml`, grouped by their categories. All the code samples are placed under `languages/samples/` directory. \n\n\u003e [!NOTE]\n\u003e\n\u003e The display order of the language options in the final webpage is exactly the same as that in `lang.yml`.\n\nManaging language options in HTML and JavaScript is tedious, so there is a script to automatically generate related code. You should run this command after modifying the language list or adding new samples. This will generate `src/js/samples.js` and `src/views/components/languages.html`.\n\n```bash\nnpm run sample\n```\n\nTo add a new language, first add it to `languages/lang.yml`. In the suitable category, add a new list item in the format of `key value`, where `key` is the language id of [Prism.js](https://prismjs.com/#supported-languages), and the `value` is the display name of the language in the select box. Then, create a new file `{key}.txt` under `languages/samples/` and write your sample code in it. Finally, add this language to `.babelrc` so that it can be correctly loaded.\n\n### Customization\n\nSince I removed sensitive information from the project, you need to run `npm run init` to create placeholder files even if you don't need them. These files are placed under `src/views/components/`.\n\n**Analytics**\n\nIn file `statistics.html`, and place all your scripts into it. If you don't need them, just leave this file empty. Here is an example for this file.\n\n```html\n\u003c!-- Clarity --\u003e\n\u003cscript type=\"text/javascript\"\u003e\n    (function (c, l, a, r, i, t, y) {\n        c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };\n        t = l.createElement(r); t.async = 1; t.src = \"https://www.clarity.ms/tag/\" + i;\n        y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y);\n    })(window, document, \"clarity\", \"script\", \"***key***\");\n\u003c/script\u003e\n\u003c!-- Baidu Analytics --\u003e\n\u003cscript\u003e\n    var _hmt = _hmt || [];\n    (function () {\n        var hm = document.createElement(\"script\");\n        hm.src = \"https://hm.baidu.com/hm.js?******key*******\";\n        var s = document.getElementsByTagName(\"script\")[0];\n        s.parentNode.insertBefore(hm, s);\n    })();\n\u003c/script\u003e\n```\n\n**Notification**\n\nFor users who visit your website for the first time, you may want to prompt a notice or agreement. In `notification.html`, write your custom `\u003cdiv\u003e` for it. The default class for it is `notification`, you can change it and add your own CSS style.\n\n```html\n\u003cdiv class=\"notification\"\u003e\n    \u003cp\u003eGreetings from all members of Tony's Studio!\u003c/p\u003e\n\u003c/div\u003e\n```\n\n**Support**\n\nIf you want to add a support page, write it in `support.html`. Like notification, the default class for it is `coffee` and you can customize it. If you add this, there will be an extra support button in the center of the page.\n\n```html\n\u003cdiv class=\"coffee\"\u003e\n    \u003cimg src=\"url or local path\" alt=\"WeChat Pay\" title=\"Scan to support me\"\u003e\n    \u003cp\u003eWe appreciate your sponsorship!🌹\u003c/p\u003e\n\u003c/div\u003e\n```\n\n### Self-hosting\n\nThere is still one step before you can host Code Paste on your website. I use [Font Awesome](https://fontawesome.com/) for lovely icons, and the linked JavaScript only works for my domain. Therefore, you have to get your kit [here](https://fontawesome.com/kits) and replace the link in `src/views/components/head.html`.\n\nAfter all these are done, just copy `dist` folder to your server and enjoy!🎉\n\n---\n\n## Sponsors 💖\n\nHere, I would like to express my sincere gratitude for all who sponsor Code Paste. THANK YOU! 🥰\n\n\u003e I may not be able to know your GitHub account from the payment. If you bought me a coffee but are not present in the following table, feel free to contact me via E-mail.🙏\n\n\u003ctable\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\n                \u003ca href=\"https://github.com/Pan-Pan-Pan\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/111100556?s=100\" width=\"100px;\" alt=\"Pan-Pan-Pan\"/\u003e\u003c/a\u003e\n                \u003cbr /\u003e\n                \u003csub\u003e\u003cb\u003ePan-Pan-Pan\u003c/b\u003e\u003c/sub\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\n                \u003ca href=\"https://github.com/AkashiSensei\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/78262426?s=100\" width=\"100px;\" alt=\"Liu Yizhou\"/\u003e\u003c/a\u003e\n                \u003cbr /\u003e\n                \u003csub\u003e\u003cb\u003eLiu Yizhou\u003c/b\u003e\u003c/sub\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\n                \u003ca href=\"https://github.com/hongshuobuaa\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/117986926?s=100\" width=\"100px;\" alt=\"hongshuobuaa\"/\u003e\u003c/a\u003e\n                \u003cbr /\u003e\n                \u003csub\u003e\u003cb\u003ehongshuobuaa\u003c/b\u003e\u003c/sub\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\n                \u003ca href=\"https://github.com/CR-1201\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/112941971?s=100\" width=\"100px;\" alt=\"秋子夜\"/\u003e\u003c/a\u003e\n                \u003cbr /\u003e\n                \u003csub\u003e\u003cb\u003e秋子夜\u003c/b\u003e\u003c/sub\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\n                \u003ca href=\"https://github.com/GuoLan-Fruket\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/109665787?s=100\" width=\"100px;\" alt=\"GuoLan-Fruket\"/\u003e\u003c/a\u003e\n                \u003cbr /\u003e\n                \u003csub\u003e\u003cb\u003eGuoLan-Fruket\u003c/b\u003e\u003c/sub\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flord-turmoil%2Fcodepaste","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flord-turmoil%2Fcodepaste","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flord-turmoil%2Fcodepaste/lists"}