Skip to content

Options

Sub classes

Name Children Inherits
MarkdownOptions
mkconvert.parsers.base
Common Markdown -> HTML options, mapped onto every parser.
    HtmlToMarkdownOptions
    mkconvert.converters.base
    Common HTML -> Markdown options, mapped onto every converter.

      Base classes

      Name Children Inherits
      BaseModel
      pydantic.main
      !!! abstract "Usage Documentation"

      ⋔ Inheritance diagram

      graph TD
        849523002["_core.Options"]
        3879467795["main.BaseModel"]
        2751680898["builtins.object"]
        3879467795 --> 849523002
        2751680898 --> 3879467795

      🛈 DocStrings

      Bases: BaseModel

      Base class for the common option models.

      Every default is the baseline behaviour all backends can produce. Setting an option to a non-default value requires the backend to support it, see Backend.supported_options.

      Source code in src/mkconvert/_core.py
      class Options(BaseModel):
          """Base class for the common option models.
      
          Every default is the baseline behaviour all backends can produce. Setting an option
          to a non-default value requires the backend to support it, see
          `Backend.supported_options`.
          """
      
          model_config = ConfigDict(frozen=True, extra="forbid", use_attribute_docstrings=True)
      
          def changed(self) -> set[str]:
              """Names of the options whose value differs from the default."""
              return {
                  name
                  for name, field in type(self).model_fields.items()
                  if getattr(self, name) != field.default
              }
      

      changed

      changed() -> set[str]
      

      Names of the options whose value differs from the default.

      Source code in src/mkconvert/_core.py
      def changed(self) -> set[str]:
          """Names of the options whose value differs from the default."""
          return {
              name
              for name, field in type(self).model_fields.items()
              if getattr(self, name) != field.default
          }
      

      :fa-brands-github: Show source on GitHub