{"id":13502461,"url":"https://github.com/tlatsas/jinja2-highlight","last_synced_at":"2025-03-29T10:33:00.562Z","repository":{"id":3962138,"uuid":"5056005","full_name":"tlatsas/jinja2-highlight","owner":"tlatsas","description":"Jinja2 extension to highlight source code using Pygments","archived":true,"fork":false,"pushed_at":"2021-07-05T08:53:52.000Z","size":35,"stargazers_count":29,"open_issues_count":7,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-04T07:38:50.753Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pypi.python.org/pypi/jinja2-highlight","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tlatsas.png","metadata":{"files":{"readme":"README.rst","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":"2012-07-15T12:43:24.000Z","updated_at":"2024-11-28T16:30:19.000Z","dependencies_parsed_at":"2022-09-13T03:01:10.642Z","dependency_job_id":null,"html_url":"https://github.com/tlatsas/jinja2-highlight","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/tlatsas%2Fjinja2-highlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlatsas%2Fjinja2-highlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlatsas%2Fjinja2-highlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlatsas%2Fjinja2-highlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tlatsas","download_url":"https://codeload.github.com/tlatsas/jinja2-highlight/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246174208,"owners_count":20735406,"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-07-31T22:02:14.750Z","updated_at":"2025-03-29T10:33:00.165Z","avatar_url":"https://github.com/tlatsas.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"jinja2-highlight\n################\n\nAbout\n=====\n\nA simple Jinja2 extension that uses Pygments to highlight code blocks.\n\n\n.. image:: https://travis-ci.org/tlatsas/jinja2-highlight.svg?branch=master\n    :target: https://travis-ci.org/tlatsas/jinja2-highlight\n\n\nSource\n======\n\nGithub: https://github.com/tlatsas/jinja2-highlight\n\nPypi: http://pypi.python.org/pypi/jinja2-highlight\n\n\nRequirements\n============\n\n* Jinja2 \u003e= 2.4\n* Pygments \u003e= 1.5\n\n\nHighlight examples\n=================\n::\n\n    {% highlight 'language' %}\n    your-awesome-code-here\n    {% endhighlight %}\n\nReplace `language` with the appropriate Pygments lexer short name: http://pygments.org/docs/lexers/\n\nLine numbering can be turned on using `lineno='inline'` or `lineno='table'` depending on the style of line numbering you want (as per Pygment's documentation: http://pygments.org/docs/formatters/#HtmlFormatter)\n\n::\n\n    {% highlight 'language', lineno='inline' %}\n    your-awesome-code-here\n    {% endhighlight %}\n\nThis can also be used without a language setting\n\n::\n\n    {% highlight lineno='table' %}\n    your-awesome-code-here\n    {% endhighlight %}\n\nOptional settings\n================\n\nBy default Pygments renders the code block inside a div with the class 'highlight', if you want to change the name you can set the environment variable `jinja2_highlight_cssclass` to the class name you would like.\n\nIn jinja this can be done after you've created your environment;\n::\n\n    env = Environment(extensions=['jinja2_highlight.HighlightExtension'])\n    # Set the css class name to 'codehilite'\n    env.extend(jinja2_highlight_cssclass = 'codehilite')\n\nIn Flask this can be done with the following (after creating your app):\n::\n\n    app.jinja_env.extend(jinja2_highlight_cssclass = 'codehilite')\n\n\n\nUsing with Flask\n================\n\nSee the example at: https://github.com/tlatsas/jinja2-highlight/tree/master/examples/flask\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlatsas%2Fjinja2-highlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftlatsas%2Fjinja2-highlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlatsas%2Fjinja2-highlight/lists"}