A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rgs258/django-markdown-view below:

rgs258/django-markdown-view: Serve .md pages as Django templates

Serve .md pages as Django views.

This package aims to make it easy to serve .md files on Django sites.

Note

  1. Install with pip install django-markdown-view.

  2. Add 'markdown_view' to your INSTALLED_APPS settings.

    INSTALLED_APPS = [
        ...,
        'markdown_view',
        ...
    ]
  3. (OPTIONAL) Add MARKDOWN_VIEW_BASE_DIR or BASE_DIR to settings

    The dictionary of the application's base. See Settings below

    For example, if settings are in config/settings/base.py, then:

    BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))

Use one of MarkdownView, LoggedInMarkdownView, or StaffMarkdownView from markdown_view.views to serve a .md file

from markdown_view.views import StaffMarkdownView

path('readme/',
    StaffMarkdownView.as_view(file_name='my_app/README.md'),
    name="readme"),

All settings are optional. See markdown_view/constants.py for the defaults.

At a high level, MarkdownView will:

  1. Use a template loader to locate .md given as file_name
  2. Render as a template, the contents of the .md file prepended with {% load static %}, into several context variables
  3. Serve the MARKDOWN_VIEW_TEMPLATE with the context variables

All contributions are very welcomed. Propositions, problems, bugs, and enhancement are tracked with GitHub issues and patches are submitted via pull requests.

We use Travis coupled with Coveralls as continious integration tools.

We aspire to support the currently supported versions of Django.

The Tested With section describes aspirational goals.

Tested with:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4