{"id":13449344,"url":"https://github.com/erwinmatijsen/django-markdownify","last_synced_at":"2025-03-22T22:32:47.650Z","repository":{"id":3539999,"uuid":"49970948","full_name":"erwinmatijsen/django-markdownify","owner":"erwinmatijsen","description":"Markdown template filter for Django","archived":false,"fork":false,"pushed_at":"2024-07-08T07:55:23.000Z","size":95,"stargazers_count":118,"open_issues_count":3,"forks_count":24,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-01T16:20:54.573Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/erwinmatijsen.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":"2016-01-19T17:43:50.000Z","updated_at":"2024-09-17T23:32:16.000Z","dependencies_parsed_at":"2024-01-23T10:31:05.489Z","dependency_job_id":"cb9fc168-9cd8-4509-bf74-13f901aa6e0b","html_url":"https://github.com/erwinmatijsen/django-markdownify","commit_stats":{"total_commits":69,"total_committers":12,"mean_commits":5.75,"dds":"0.46376811594202894","last_synced_commit":"33f9c75f1c0ccef9753b56a2e1f195bba2957454"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erwinmatijsen%2Fdjango-markdownify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erwinmatijsen%2Fdjango-markdownify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erwinmatijsen%2Fdjango-markdownify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erwinmatijsen%2Fdjango-markdownify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erwinmatijsen","download_url":"https://codeload.github.com/erwinmatijsen/django-markdownify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221840630,"owners_count":16889834,"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-31T06:00:35.989Z","updated_at":"2024-10-28T14:30:45.815Z","avatar_url":"https://github.com/erwinmatijsen.png","language":"Python","funding_links":[],"categories":["Python","表单"],"sub_categories":[],"readme":"# Django Markdownify - A Django Markdown filter\n\n![PyPi Downloads](https://img.shields.io/pypi/dm/django-markdownify) \n![License](https://img.shields.io/pypi/l/django-markdownify?color=brightgreen)\n[![Documentation Status](https://readthedocs.org/projects/django-markdownify/badge/?version=latest)](https://django-markdownify.readthedocs.io/en/latest/?badge=latest)\n![Version](https://img.shields.io/pypi/v/django-markdownify)\n\nDjango Markdownify is a template filter to convert Markdown to HTML in Django. Markdown is converted to HTML and sanitized.\n\nRead the full documentation on [Read the docs](http://django-markdownify.readthedocs.io/en/latest/) or check out the package on [pypi](https://pypi.python.org/pypi/django-markdownify).\n\n\u003e [!WARNING]  \n\u003e The [old settings](https://django-markdownify.readthedocs.io/en/latest/settings-old.html#oldsettings) are removed in release 0.9.4! Please update to the [new settings](https://django-markdownify.readthedocs.io/en/latest/settings.html) as soon as possible.\n\n## Usage\n\nLoad the tag inside your template:\n\n```\n{% load markdownify %}\n```\n\nThen you can change markdown to html as follows:\n\n```\n{{ 'text'|markdownify }}\n```\n\nor\n\n```\n{{ somevariable|markdownify }}\n```\n\n## Example\n\n```\n{% load markdownify %}\n{{'Some *test* [link](#)'|markdownify }}\n```\n\nIs transformed to:\n\n```html\n\u003cp\u003e\n  Some \u003cem\u003etest\u003c/em\u003e \u003ca href=\"#\"\u003elink\u003c/a\u003e\n\u003c/p\u003e\n```\n\nThe filter is a wrapper around [Markdown](https://pypi.python.org/pypi/Markdown) and\n[Bleach](http://pythonhosted.org/bleach/index.html) and as such supports their settings. \nIt is possible to define multiple settings for multiple usecases.\n\nFor example:\n\n```python\n# settings.py\n\nMARKDOWNIFY = {\n  \"default\": {\n     \"WHITELIST_TAGS\": [\"a\", \"p\", \"h1\", ]\n  },\n\n  \"alternative\": {\n     \"WHITELIST_TAGS\": [\"a\", \"p\", ],\n     \"MARKDOWN_EXTENSIONS\": [\"markdown.extensions.fenced_code\", ]\n  }\n}\n```\n\nAnd in your templates:\n\n```html\n\n\u003c!-- page1.html --\u003e\n{{ mytext|markdownify }} \u003c!-- Uses your default settings --\u003e\n\n\u003c!-- page2.html --\u003e\n{{ mytext|markdownify:\"alternative\" }} \u003c!-- Uses your alternative settings --\u003e\n```\n\n## Documentation\nRead the full documentation on [Read the docs](https://django-markdownify.readthedocs.io/en/latest/).\n\n## Credits\nThis filter is a slightly richer and packaged version of the snippet: [using-markdown-django-17](http://www.jw.pe/blog/post/using-markdown-django-17/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferwinmatijsen%2Fdjango-markdownify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferwinmatijsen%2Fdjango-markdownify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferwinmatijsen%2Fdjango-markdownify/lists"}