Skip to content

PDF

mkdocs_exporter.formats.pdf.config.Config

The plugin's configuration.

Source code in mkdocs_exporter/formats/pdf/config.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
class Config(BaseConfig):
  """The plugin's configuration."""

  enabled = c.Type(bool, default=True)
  """Is the generator enabled?"""

  explicit = c.Type(bool, default=False)
  """Should pages specify explicitly that they should be rendered as PDF?"""

  concurrency = c.Type(int, default=4)
  """The maximum number of concurrent PDF generation tasks."""

  stylesheets = c.ListOfItems(c.File(exists=True), default=[])
  """A list of custom stylesheets to apply before rendering documents."""

  scripts = c.ListOfItems(c.File(exists=True), default=[])
  """A list of custom scripts to inject before rendering documents."""

  covers = c.SubConfig(CoversConfig)
  """The document's cover pages."""

  browser = c.SubConfig(BrowserConfig)
  """The browser's configuration."""

  url = c.Optional(c.Type(str))
  """The base URL that'll be prefixed to links with a relative path."""

  aggregator = c.SubConfig(AggregatorConfig)
  """The aggregator's configuration."""

aggregator = c.SubConfig(AggregatorConfig)

The aggregator's configuration.

browser = c.SubConfig(BrowserConfig)

The browser's configuration.

concurrency = c.Type(int, default=4)

The maximum number of concurrent PDF generation tasks.

covers = c.SubConfig(CoversConfig)

The document's cover pages.

enabled = c.Type(bool, default=True)

Is the generator enabled?

explicit = c.Type(bool, default=False)

Should pages specify explicitly that they should be rendered as PDF?

scripts = c.ListOfItems(c.File(exists=True), default=[])

A list of custom scripts to inject before rendering documents.

stylesheets = c.ListOfItems(c.File(exists=True), default=[])

A list of custom stylesheets to apply before rendering documents.

url = c.Optional(c.Type(str))

The base URL that'll be prefixed to links with a relative path.

mkdocs_exporter.formats.pdf.config.CoversConfig

The cover's configuration.

Source code in mkdocs_exporter/formats/pdf/config.py
21
22
23
24
25
26
27
28
class CoversConfig(BaseConfig):
  """The cover's configuration."""

  front = c.Optional(c.File(exists=True))
  """The front cover template location."""

  back = c.Optional(c.File(exists=True))
  """The back cover template location."""

back = c.Optional(c.File(exists=True))

The back cover template location.

front = c.Optional(c.File(exists=True))

The front cover template location.

mkdocs_exporter.formats.pdf.config.BrowserConfig

The browser's configuration.

Source code in mkdocs_exporter/formats/pdf/config.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
class BrowserConfig(BaseConfig):
  """The browser's configuration."""

  debug = c.Type(bool, default=False)
  """Should console messages sent to the browser be logged?"""

  headless = c.Type(bool, default=True)
  """Should the browser start in headless mode?"""

  timeout = c.Type(int, default=60_000)
  """The timeout when waiting for the PDF to render."""

  args = c.ListOfItems(c.Type(str), default=[])
  """Extra arguments to pass to the browser."""

args = c.ListOfItems(c.Type(str), default=[])

Extra arguments to pass to the browser.

debug = c.Type(bool, default=False)

Should console messages sent to the browser be logged?

headless = c.Type(bool, default=True)

Should the browser start in headless mode?

timeout = c.Type(int, default=60000)

The timeout when waiting for the PDF to render.

mkdocs_exporter.formats.pdf.config.AggregatorConfig

The aggregator's configuration.

Source code in mkdocs_exporter/formats/pdf/config.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
class AggregatorConfig(BaseConfig):
  """The aggregator's configuration."""

  enabled = c.Type(bool, default=False)
  """Is the aggregator enabled?"""

  output = c.Type(str, default='combined.pdf')
  """The aggregated PDF document output file path."""

  metadata = c.Type(dict, default={})
  """Some metadata to append to the PDF document."""

  covers = c.Choice(['all', 'none', 'limits', 'book', 'front', 'back'], default='all')
  """The behavior of cover pages."""

covers = c.Choice(['all', 'none', 'limits', 'book', 'front', 'back'], default='all')

The behavior of cover pages.

enabled = c.Type(bool, default=False)

Is the aggregator enabled?

metadata = c.Type(dict, default={})

Some metadata to append to the PDF document.

output = c.Type(str, default='combined.pdf')

The aggregated PDF document output file path.