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
-
src
str
-
Path to an existing quarto file, must end in
.qmd
. -
dest
str
-
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. -
text
str
- Name used in the navigation.
-
menu
None, 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
: Ifsrc
,dest
,text
are not str. -
ValueError
: Ifsrc
anddest
do not end in.qmd
-
ValueError
: Ifdest
is a path, not only the name of the target quarto file. -
FileNotFoundError
: Ifsrc
does not exist. -
TypeError
: Ifmenu
is notNone
norstr
. -
Exception
: Ifdest
already exists but overwrite is setFalse
(see DocConverter). -
Exception
: ifsrc
cannot be copied to destination.