Add Page to Navigation

Description

Adds page to website navbar left. Will be added to the _quarto.yml file if not yet included. Will place the source file (qmd) in the quarto output folder under name dest and linked in the navigation as text.

Usage

DocConverter.add_navbar_page(src, dest, text,
menu=None)

Arguments

srcstr
Path to an existing quarto file, must end in .qmd.
deststr
Name or path for target quarto file. If path, the directory will be created inside quarto_dir as specified in the config (see DocConverter) if not yet existing.
textstr
Name used in the navigation.
menuNone, str
Must be None if pages are added. If set, it is expected that a menu with this name exists. The page will then be added to that menu if not already in there.

Raises

  • TypeError: If src, dest, text are not str.
  • ValueError: If src and dest do not end in .qmd
  • ValueError: If dest is a path, not only the name of the target quarto file.
  • FileNotFoundError: If src does not exist.
  • TypeError: If menu is not None nor str.
  • Exception: If dest already exists but overwrite is set False (see DocConverter).
  • Exception: if src cannot be copied to destination.