{"id":17204441,"url":"https://github.com/mthh/reveal.js-plugin-codemirror","last_synced_at":"2025-03-25T10:25:35.170Z","repository":{"id":95037658,"uuid":"231604582","full_name":"mthh/reveal.js-plugin-codemirror","owner":"mthh","description":"A reveal.js plugin allowing a smooth integration of CodeMirror to use its highlighting functions","archived":false,"fork":false,"pushed_at":"2020-01-03T22:59:16.000Z","size":5808,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T09:41:46.706Z","etag":null,"topics":["codemirror","reveal-js","slides","syntax-highlighting"],"latest_commit_sha":null,"homepage":"https://mthh.github.io/reveal.js-plugin-codemirror/","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/mthh.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":"2020-01-03T14:28:09.000Z","updated_at":"2022-03-04T01:34:10.000Z","dependencies_parsed_at":"2023-06-11T20:00:17.652Z","dependency_job_id":null,"html_url":"https://github.com/mthh/reveal.js-plugin-codemirror","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/mthh%2Freveal.js-plugin-codemirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthh%2Freveal.js-plugin-codemirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthh%2Freveal.js-plugin-codemirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthh%2Freveal.js-plugin-codemirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mthh","download_url":"https://codeload.github.com/mthh/reveal.js-plugin-codemirror/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245442448,"owners_count":20616020,"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","reveal-js","slides","syntax-highlighting"],"created_at":"2024-10-15T02:21:57.788Z","updated_at":"2025-03-25T10:25:35.147Z","avatar_url":"https://github.com/mthh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## reveal.js-plugin-codemirror\n\n*Enjoy a nice syntax highlighting for languages not supported by highlight.js on your reveal.js slides !*\n\n**Demo slides:** https://mthh.github.io/reveal.js-plugin-codemirror/\n\n### Installation\n\nSimply place the content of the `codemirror`-directory within the reveal.js `plugin` directory.\n\nThis plugin is just a wrapper to call `CodeMirror.runMode` and doesn't contain any code from `CodeMirror`.\n\nTwo options are provided in order to fetch the appropriate `CodeMirror` modules, using a CDN (*JsDelivr*) or providing the path to theses modules (it allows to host theses files locally, or to use another CDN).\n\n### Usage\n- Just use this plugin instead of the `highlight.js` plugin :\n\n```js\nReveal.initialize({\n  codemirrorHighlight: {\n     // The default language,\n     // for fenced code block (or `code` elements) without language identifier\n     // (default: 'javascript')\n    default_lang: 'javascript',\n    // A specific CodeMirror theme to use (default: 'default')\n    theme: 'zenburn',\n    // The version number of CodeMirror to use\n    // if using the CDN strategy\n    // (default: 5, not used if `path` option is provided)\n    version: '5.50.2',\n    // A path to reach CodeMirror `lib`, `addon`, `theme`, etc. folders\n    // to fetch the appropriate modules needed\n    // (default: undefined, mandatory to avoid using the default CDN)\n    path: '/codemirror/',\n  },\n  dependencies: [\n    { src: 'plugin/codemirror/revealjs-plugin-codemirror.js', async: true },\n    ...\n  ],\n  ...\n});\n```\n\n- It's now possible to use fenced code block within the markdown of the presentation and to get the code highlighted by CodeMirror.\n\n``````html\n  \u003csection data-markdown class=\"table-slide big-table\"\u003e\n    \u003ctextarea data-template\u003e\n## Slide with markdown content and code in the default language\n\n```\nfunction ItWorks() {\n  return 'It works !'\n}\n```\n    \u003c/textarea\u003e\n  \u003c/section\u003e\n  \u003csection data-markdown class=\"table-slide big-table\"\u003e\n    \u003ctextarea data-template\u003e\n## Slide with markdown content and code in another language\n\n```turtle\nex:AliceInWonderland a ex:Book ;\n  ex:title \"Alice in Wonderland\"@en ;\n  ex:author \"Lewis Carroll\" ;\n  ex:datePublished \"1865-11-26\"^^xsd:date .\n```\n    \u003c/textarea\u003e\n  \u003c/section\u003e\n``````\n\n- It also works for `html` slides with code inside `pre \u003e code` elements :\n\n```html\n  \u003csection\u003e\n    \u003ch2\u003eSlide with html content and code in another language\u003c/h2\n\n    \u003cpre\u003e\n      \u003ccode class=\"language-turtle\"\u003e\n      ex:AliceInWonderland a ex:Book ;\n        ex:title \"Alice in Wonderland\"@en ;\n        ex:author \"Lewis Carroll\" ;\n        ex:datePublished \"1865-11-26\"^^xsd:date .\n      \u003c/code\u003e\n    \u003c/pre\u003e\n  \u003c/section\u003e\n```\n\n\n### License\n\nMIT licensed\n\nCopyright (C) 2019 Matthieu Viry\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthh%2Freveal.js-plugin-codemirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmthh%2Freveal.js-plugin-codemirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthh%2Freveal.js-plugin-codemirror/lists"}