{"id":15569296,"url":"https://github.com/tony/django-docutils","last_synced_at":"2025-08-04T02:07:37.475Z","repository":{"id":34007606,"uuid":"37763213","full_name":"tony/django-docutils","owner":"tony","description":"Docutils (a.k.a. reStructuredText, reST, RST) support for django","archived":false,"fork":false,"pushed_at":"2025-07-20T21:07:59.000Z","size":2944,"stargazers_count":11,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-21T07:31:34.360Z","etag":null,"topics":["django","docutils","python","restructuredtext","rst","sphinx-doc","sphinx-extension"],"latest_commit_sha":null,"homepage":"https://django-docutils.git-pull.com/","language":"Python","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/tony.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","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,"zenodo":null}},"created_at":"2015-06-20T08:25:49.000Z","updated_at":"2025-07-20T21:08:03.000Z","dependencies_parsed_at":"2025-05-27T12:37:41.484Z","dependency_job_id":"bf21acbe-ea5d-40cd-a975-78308b5cca29","html_url":"https://github.com/tony/django-docutils","commit_stats":{"total_commits":647,"total_committers":4,"mean_commits":161.75,"dds":0.1792890262751159,"last_synced_commit":"61893b3f60acc746d921cff877c23a5215cf01ea"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/tony/django-docutils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony%2Fdjango-docutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony%2Fdjango-docutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony%2Fdjango-docutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony%2Fdjango-docutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tony","download_url":"https://codeload.github.com/tony/django-docutils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tony%2Fdjango-docutils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268639707,"owners_count":24282666,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["django","docutils","python","restructuredtext","rst","sphinx-doc","sphinx-extension"],"created_at":"2024-10-02T17:25:19.244Z","updated_at":"2025-08-04T02:07:37.422Z","avatar_url":"https://github.com/tony.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-docutils \u0026middot; [![Python Package](https://img.shields.io/pypi/v/django-docutils.svg)](https://pypi.org/project/django-docutils/) [![License](https://img.shields.io/github/license/tony/django-docutils.svg)](https://github.com/tony/django-docutils/blob/master/LICENSE)\n\ndocutils (a.k.a. reStructuredText / rst / reST) support for Django.\n\n## Quickstart\n\nInstall django-docutils:\n\n```console\n$ pip install django-docutils\n```\n\nNext, add `django_docutils` to your `INSTALLED_APPS` in your settings file:\n\n```python\nINSTALLED_APPS = [\n    # ... your default apps,\n    'django_docutils'\n]\n```\n\n## Template tag\n\nIn your template:\n\n```django\n{% load django_docutils %}\n{% rst %}\n# hey\n# how's it going\nA. hows\nB. it\n\nC. going\nD. today\n\n**hi**\n*hi*\n{% endrst %}\n```\n\n## Template filter\n\nIn your template:\n\n```django\n{% load django_docutils %}\n{% filter rst %}\n# hey\n# how's it going\nA. hows\nB. it\n\nC. going\nD. today\n\n**hi**\n*hi*\n{% endfilter %}\n```\n\n## Template engine (class-based view)\n\nYou can also use a class-based view to render reStructuredText (reST).\n\nIf you want to use reStructuredText as a django template engine, `INSTALLED_APPS` _isn't_ required,\ninstead you add this to your `TEMPLATES` variable in your settings:\n\n```python\nTEMPLATES = [\n    # ... Other engines\n    {\n        \"NAME\": \"docutils\",\n        \"BACKEND\": \"django_docutils.template.DocutilsTemplates\",\n        \"DIRS\": [],\n        \"APP_DIRS\": True,\n    }\n]\n```\n\nNow django will be able to scan for .rst files and process them. In your view:\n\n```python\nfrom django_docutils.views import DocutilsView\n\nclass HomeView(DocutilsView):\n    template_name = 'base.html'\n    rst_name = 'home.rst'\n```\n\n# Settings\n\n```python\n# Optional, automatically maps roles, directives and transformers\nDJANGO_DOCUTILS_LIB_RST = {\n    \"docutils\": {\n        \"raw_enabled\": True,\n        \"strip_comments\": True,\n        \"initial_header_level\": 2,\n    },\n    \"roles\": {\n        \"local\": {\n            \"gh\": \"django_docutils.lib.roles.github.github_role\",\n            \"twitter\": \"django_docutils.lib.roles.twitter.twitter_role\",\n            \"email\": \"django_docutils.lib.roles.email.email_role\",\n        }\n    },\n    \"directives\": {\n        \"code-block\": \"django_docutils.lib.directives.code.CodeBlock\",\n    }\n}\n\n# Optional\nDJANGO_DOCUTILS_LIB_TEXT = {\n    \"uncapitalized_word_filters\": [\"project.my_module.my_capitalization_fn\"]\n}\n```\n\n## More information\n\n- Python 3.9+\n- Django 4.2+\n\n[![Docs](https://github.com/tony/django-docutils/workflows/docs/badge.svg)](https://github.com/tony/django-docutils/actions?query=workflow%3A%22Docs%22)\n[![Build Status](https://github.com/tony/django-docutils/workflows/tests/badge.svg)](https://github.com/tony/django-docutils/actions?query=workflow%3A%22tests%22)\n[![Code Coverage](https://codecov.io/gh/tony/django-docutils/branch/master/graph/badge.svg)](https://codecov.io/gh/tony/django-docutils)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony%2Fdjango-docutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftony%2Fdjango-docutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony%2Fdjango-docutils/lists"}