calingen.contrib.layouts.lineatur.lineatur

LayoutProvider implementation for various ruled paper outputs.

More or less all of this module’s source code is utility code, that is tied together in LineaturForm and actually used in the layout’s templates.

This may seem like a lot of boilerplate (and it is, in fact), but it demonstrates an easy way to actually implement the LayoutProvider’s ability to provide a layout specific configuration as implemented by calingen.interfaces.plugin_api.LayoutProvider.configuration_form.

Module Contents

Classes

CaptionPositionChoices

Where to put the caption.

ColorChoices

Pre-defined colors to use in the generated output.

LengthUnits

Provide CSS absolute length units.

Lineatur

Provide different kinds of ruled paper.

LineaturForm

Configuration form for the Lineatur layout.

LineaturTypes

Provide different types of grids.

PaperSize

Provide choices for the paper sizes.

class calingen.contrib.layouts.lineatur.lineatur.CaptionPositionChoices

Bases: django.db.models.TextChoices

Where to put the caption.

CENTER
LEFT
RIGHT
class calingen.contrib.layouts.lineatur.lineatur.ColorChoices

Bases: django.db.models.TextChoices

Pre-defined colors to use in the generated output.

BLACK
BLUE
DARK_GREY
GREEN
LIGHT_GREY
RED
class calingen.contrib.layouts.lineatur.lineatur.LengthUnits

Bases: django.db.models.TextChoices

Provide CSS absolute length units.

Taken from here: https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units#lengths

CM
IN
MM
PT
PX
class calingen.contrib.layouts.lineatur.lineatur.Lineatur

Bases: calingen.interfaces.plugin_api.LayoutProvider

Provide different kinds of ruled paper.

The term lineatur can be translated (loosely) to ruled paper. It describes the lines or grids on paper, usually used for notes.

_template = lineatur/layout.html
configuration_form
layout_type = html
name = Lineatur
orientation = portrait
paper_size = various
class calingen.contrib.layouts.lineatur.lineatur.LineaturForm(*args, request=None, **kwargs)

Bases: calingen.forms.generation.LayoutConfigurationForm

Configuration form for the Lineatur layout.

This is actually a subclass of calingen.forms.generation.LayoutConfigurationForm and exposes some options to adjust the generated page, e.g. the format of the paper, margins and the actual grid.

caption
caption_color
caption_font
caption_position
caption_size
length_unit
lineatur_color
lineatur_spacing_x
lineatur_spacing_y
lineatur_stroke_width
lineatur_type
page_margin_bottom
page_margin_left
page_margin_right
page_margin_top
paper_size
template_name = lineatur/config_form.html
class calingen.contrib.layouts.lineatur.lineatur.LineaturTypes

Bases: django.db.models.TextChoices

Provide different types of grids.

BLANK
DOTTED
LINED
SQUARED
class calingen.contrib.layouts.lineatur.lineatur.PaperSize

Bases: django.db.models.TextChoices

Provide choices for the paper sizes.

A0
A1
A2
A3
A4
A5
A6
A7
B0
B1
B2
B3
B4
B5
B6
B7
GOV_LETTER
LEDGER
LEGAL
LETTER
TABLOID