{"id":22769830,"url":"https://github.com/bfontaine/clygments","last_synced_at":"2025-09-10T20:41:48.232Z","repository":{"id":14073951,"uuid":"16777480","full_name":"bfontaine/clygments","owner":"bfontaine","description":":art: Code highlighting using Pygments in Clojure","archived":false,"fork":false,"pushed_at":"2020-11-07T09:52:46.000Z","size":44,"stargazers_count":31,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T06:20:45.686Z","etag":null,"topics":["clojure","library","pygments","syntax-highlighting"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bfontaine.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":"2014-02-12T18:39:44.000Z","updated_at":"2025-03-23T01:25:33.000Z","dependencies_parsed_at":"2022-09-23T18:50:54.837Z","dependency_job_id":null,"html_url":"https://github.com/bfontaine/clygments","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fclygments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fclygments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fclygments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fclygments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bfontaine","download_url":"https://codeload.github.com/bfontaine/clygments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997317,"owners_count":21195853,"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":["clojure","library","pygments","syntax-highlighting"],"created_at":"2024-12-11T15:16:02.809Z","updated_at":"2025-04-15T03:20:27.280Z","avatar_url":"https://github.com/bfontaine.png","language":"Clojure","readme":"# clygments\n\n[![Build Status](https://img.shields.io/travis/bfontaine/clygments.svg)](https://travis-ci.org/bfontaine/clygments)\n[![Coverage Status](https://img.shields.io/coveralls/bfontaine/clygments.svg)](https://coveralls.io/r/bfontaine/clygments)\n[![Clojars Project](https://img.shields.io/clojars/v/clygments.svg)](https://clojars.org/clygments)\n\n**clygments** is a Clojure wrapper for [Pygments][].\n\n[Pygments]: http://pygments.org/\n\n## Usage\n\nAdd the dependency in your `project.clj`:\n\n```clj\n[clygments \"2.0.2\"]\n```\n\nThen:\n\n```clj\n(ns your-project.core\n  (:require [clygments.core :as clygments]))\n```\n\nIt exposes only one function, `highlight`. Give it your code as a string, its\nlanguage and the desired output and it’ll do that for you :)\n\nIt’ll return a string or `nil` if there was an error, like an unsupported\nlanguage or output.\n\n### Example\n\n```clj\n(clygments/highlight \"(def x (+ 20 22))\" :clojure :html)\n;; =\u003e \u003cdiv class=\\\"highlight\\\"\u003e\u003cpre\u003e\u003cspan class=\\\"p\\\"\u003e(\u003c/span\u003e\u003cspan class=\\\"k\\\"\u003edef \u003c/span\u003e\u003cspan class=\\\"nv\\\"\u003ex\u003c/span\u003e \u003cspan class=\\\"mi\\\"\u003e42\u003c/span\u003e\u003cspan class=\\\"p\\\"\u003e)\u003c/span\u003e\\n\u003c/pre\u003e\u003c/div\u003e\n```\n\n## Support\n\nClygments 1.0.0+ only supports Java 7+.\n\n### Langages\n\nSee [Pygments’ list][lexers] for a list of available languages.\n\nIf `nil` is passed as a language we use Pygments’ [`guess_lexer`](http://pygments.org/docs/api/#pygments.lexers.guess_lexer).\nNote it takes more time and might not be accurate on small code snippets.\n\n### Output\n\n* `:bbcode`\n* `:html`\n* `:latex`\n* `:null` (no formatting, this leaves the code unchanged)\n* `:raw`\n* `:rtf`\n* `:svg`\n* `:terminal256`\n* `:terminal`\n\nImages outputs are [not][issue-2] supported. See also\n[Pygments docs][formatters] for the full list.\n\n[issue-2]: https://github.com/bfontaine/clygments/issues/2#issuecomment-35169407\n\n### Options\n\nAll lexers’ and formatters’ options are supported since version 0.1.1. They are\ngiven as a map to `highlight` and support hyphens for a better readability. See\nPygments’ docs for more info.\n\n#### Example\n\n```clj\n;; expand tabs to 4 spaces\n(cligments/highlight \"def foo():\\n\\tpass\" :python :html {:tab-size 4})\n\n;; generate a full standalone HTML document with a custom title\n(cligments/highlight \"int i = 2+2;\" :C :html {:full true, :title \"This is my code\"})\n```\n\n[lexers]: http://pygments.org/docs/lexers/\n[formatters]: http://pygments.org/docs/formatters/\n\n## License\n\nCopyright © 2014-2020 Baptiste Fontaine\n\nDistributed under the Eclipse Public License either version 1.0 or any later\nversion.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfontaine%2Fclygments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbfontaine%2Fclygments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfontaine%2Fclygments/lists"}