class Template(abc.ABC):
Known subclasses: pydoctor.templatewriter.HtmlTemplate
, pydoctor.templatewriter.StaticTemplate
Represents a pydoctor template file.
It holds references to template information.
It's an additionnal level of abstraction to hook to the writer class.
Use Template.fromfile
or Template.fromdir
to create Templates.
See Also | |
TemplateLookup , StaticTemplate and HtmlTemplate | |
Note | |
Directories are not Currently, subdirectories should only contains static templates. This is because the subdirectory creation is handled in |
Class Method | fromdir |
Scan a directory for templates. |
Class Method | fromfile |
Create a concrete template object. Type depends on the file extension. |
Method | __init__ |
Undocumented |
Instance Variable | name |
Template filename, may include subdirectories. |
Parameters | |
basedir:Union[ | A Path or Traversable object that should point to the root directory of the template directory structure. |
subdir:Optional[ | The subdirectory inside the template directory structure that we want to scan, relative to the basedir. Scan the basedir if None. |
Returns | |
Iterator[ | Undocumented |
Raises | |
FailedToCreateTemplate | If the path is not a directory or do not exist. |
Parameters | |
basedir:Union[ | A Path or Traversable object that should point to the root directory of the template directory structure. |
templatepath:PurePath | The path to the template file, relative to the basedir. |
Returns | |
Optional[ | The template object or None if a the path entry is not a file. |
Raises | |
FailedToCreateTemplate | If there is an error while creating the template. |