{"id":28931851,"url":"https://github.com/apoorvaeternity/django-pygmento","last_synced_at":"2026-05-02T05:05:35.379Z","repository":{"id":57421418,"uuid":"471302735","full_name":"apoorvaeternity/django-pygmento","owner":"apoorvaeternity","description":"A syntax highlighter for django templates based on Pygments - For django \u003e= 4.0","archived":false,"fork":false,"pushed_at":"2022-03-18T15:36:36.000Z","size":84,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T02:15:36.367Z","etag":null,"topics":["code-highlighter","django","highlight","pygmentize","pygments","python","syntax","syntax-highlighting","template"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/django-pygmento/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apoorvaeternity.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":"2022-03-18T09:13:45.000Z","updated_at":"2022-04-03T16:37:29.000Z","dependencies_parsed_at":"2022-09-14T08:41:45.231Z","dependency_job_id":null,"html_url":"https://github.com/apoorvaeternity/django-pygmento","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/apoorvaeternity/django-pygmento","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apoorvaeternity%2Fdjango-pygmento","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apoorvaeternity%2Fdjango-pygmento/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apoorvaeternity%2Fdjango-pygmento/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apoorvaeternity%2Fdjango-pygmento/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apoorvaeternity","download_url":"https://codeload.github.com/apoorvaeternity/django-pygmento/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apoorvaeternity%2Fdjango-pygmento/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261320426,"owners_count":23140941,"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":["code-highlighter","django","highlight","pygmentize","pygments","python","syntax","syntax-highlighting","template"],"created_at":"2025-06-22T16:08:22.985Z","updated_at":"2026-05-02T05:05:35.374Z","avatar_url":"https://github.com/apoorvaeternity.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-pygmento\n\u003e Syntax highlighter for django templates based on Pygments.\n\n\n## Usage example\n- Install the package using\n```bash\npip install django-pygmento\n```\n\n- Add `pygmento` to `INSTALLED_APPS` in your settings file.\n- Load `pygmento` template tag\n```html\n{% load pygmento %}\n```\n- Include pygment css in `head` using the `pygmento_css` template tag or manually generate it as described [here](https://pygments.org/docs/quickstart/#command-line-usage) and add it to static files. \n```html\n\u003chead\u003e\n    {% pygmento_css %}\n\u003c/head\u003e\n```\n\n- Use `pygmento` as shown below\n```\n# Single line code\n{{ \"print('hello')\"|pygmento:\"python\" }}\n\n# Multi-line code block in python\n{% pygmentoblock \"python\" %}\nclass Dog:\n    def __init__(self, name):\n        self.name = name\n        self.tricks = []    # creates a new empty list for each dog\n\n    def add_trick(self, trick):\n        self.tricks.append(trick)\n{% endpygmentoblock %}\n\n# Multi-line code block in html\n{% pygmentoblock \"html\" %}\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003cbody\u003e\n\u003ch1\u003eMy Heading\u003c/h1\u003e\n\u003cp\u003eMy paragraph.\u003c/p\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n{% endpygmentoblock %}\n```\n\nThe above code will get rendered as\n\n![image info](./example.png)\n\n\n# Available styles\nStyles can be set using `PYGMENTO_STYLE` setting.\n```python\nPYGMENTO_STYLE = \"default\"\n```\n\nSee the list of available styles and how they look [here](https://pygments.org/styles/). \n\n\n## Meta\n\nApoorva Pandey – apoorvapandey365@gmail.com\n\nDistributed under the BSD license.\n\n[https://github.com/apoorvaeternity](https://github.com/apoorvaeternity)\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/apoorvaeternity/django-pygmento/\u003e)\n2. Create your feature branch (`git checkout -b feature/fooBar`)\n3. Commit your changes (`git commit -m 'Add some fooBar'`)\n4. Push to the branch (`git push origin feature/fooBar`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapoorvaeternity%2Fdjango-pygmento","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapoorvaeternity%2Fdjango-pygmento","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapoorvaeternity%2Fdjango-pygmento/lists"}