semvec/pypi-packages huggingface dataset:
foliantcontrib.mdtopdf 1.0.0
MdToPdf backend for Foliant documentation generator.
License: MIT

[![](https://img.shields.io/pypi/v/foliantcontrib.mdtopdf.svg)](https://pypi.org/project/foliantcontrib.mdtopdf/)

# MdToPdf backend for Foliant

This backend generates a single PDF document from your Foliant project. It uses [md-to-pdf](https://github.com/simonhaenisch/md-to-pdf) library under the hood.

md-to-pdf supports styling with CSS, automatic syntax highlighting by [highlight.js](https://github.com/highlightjs/highlight.js), and PDF generation with [Puppeteer](https://github.com/GoogleChrome/puppeteer).

MdToPdf backend for Foliant operates the `pdf` target.


## Installation

First install md-to-pdf on your machine:

```bash
$ node install -g md-to-pdf
```

Then install the backend:

```shell
$ pip install foliantcontrib.mdtopdf
```

## Usage

```shell
$ foliant make pdf --with mdtopdf
Parsing config... Done
Applying preprocessor flatten... Done
Applying preprocessor mdtopdf... Done
Applying preprocessor _unescape... Done
Making pdf with md-to-pdf... Done
────────────────────
Result: MyProject.pdf
```

## Config

You don't have to put anything in the config to use MdToPdf backend. If it's installed, Foliant will detect it.

You can however customize the backend with options in `backend_config.mdtopdf` section:

```yaml
backend_config:
  mdtopdf:
    mdtopdf_path: md-to-pdf
    options:
      stylesheet: https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/2.10.0/github-markdown.min.css
      body_class: markdown-body
      css: |-
        .page-break { page-break-after: always; }
        .markdown-body { font-size: 11px; }
        .markdown-body pre > code { white-space: pre-wrap; }
```

`mdtopdf_path`
:   is the path to `md-to-pdf` executable. Default: `md-to-pdf`

`options`
:   is a mapping of options which then will be converted into JSON and fed to the md-to-pdf command. For all possible options consult the [md-to-pdf documentation](https://github.com/simonhaenisch/md-to-pdf#usage).
django-paytm-checkout 0.0.3
A simple and modular django app to help with Paytm checkout and custom checkout
License: MIT

# Django Paytm Checkout
A simple modular approach for Paytm's [checkout][paytm-checkout] and [custom checkout][paytm-custom-checkout]

### Documentation is yet to be done
### This is currently in beta phase

## Installation
Use pip to install from PyPI:
```shell script
pip install django-paytm-checkout
```

## Configuration
Configure your django project by adding the following in your settings:
```python
PAYTM_MERCHANT_ID = 'YOUR_PAYTM_MERCHANT_ID'
PAYTM_MERCHANT_KEY = 'YOUR_PAYTM_MERCHANT_KEY'
PAYTM_INDUSTRY = 'YOUR_INDUSTRY_TYPE'
PAYTM_WEBSITE = 'YOUR_PAYTM_WEBSITE'
```

Setting the environment:
```python
PAYTM_DEBUG = True 
# default: True (for staging)
# False (for production)
```

These are optional settings, change if it not the same as default:
```python
PAYTM_CHANNEL_WEBSITE = ''  # default: WEB
PAYTM_CHANNEL_MOBILE_APP = ''  # default: WAP

PAYTM_STAGING_DOMAIN = ''  # default: securegw-stage.paytm.in
PAYTM_PRODUCTION_DOMAIN = ''  # default: securegw.paytm.in
```

## Using Default application
Add the following into your `urls.py`
```python
from django.urls import path, include

urlpatterns = [
    path('paytm/', include('paytm.urls', namespace='paytm')),
]
```

### Customising views
You can override all the Generic custom views

ex: Customising and using the initiate view
```python
from django.conf import settings as django_settings
from django.shortcuts import render, Http404

from paytm.checkout.views import GenericInitiatePaymentView
from paytm.models import Item


class InitiatePaymentView(GenericInitiatePaymentView):
    """Wrapper for testing"""
    include_payment_charge = False
    channel = 'WEB'

    def get_amount(self):
        item_id = self.request.POST['item']
        item = Item.objects.get(pk=item_id)
        return item.price

    def get(self, request):
        if not django_settings.DEBUG:
            raise Http404

        self.request = request
        return render(request, 'paytm/checkout/index.html', {
            'items': Item.objects.all()
        })

```

---
[paytm-checkout]: https://developer.paytm.com/docs/v1/payment-gateway/
[paytm-custom-checkout]: https://developer.paytm.com/docs/v1/custom-checkout/