Project module¶
-
class
vsuite.project.
Project
(path=False)¶ Represent a project directory
The present working directory is considered to be the vsuite project root, unless one of its parent directories is a project, in which case that directory is considered to be.
Initializing sets attributes about where various directories and project resources would be, if they exist.
-
create_doc
(title, template_opt=None)¶ Create new document with title name from template
Parameters: - title (str) – Title of document, used as basis for filename
- template_opt (str) – Document template to override default template set in project config
Returns: Document filename
Return type: str
Raises: (FileExistsError)
– If file with same name already exists
-
get_project_dir
(cursor_dir='/home/docs/checkouts/readthedocs.org/user_builds/vsuite/checkouts/latest/docs/source', path=False)¶ Absolute path to consider as project directory
Use present working directory if no parent directory is a project directory.
Parameters: cursor_dir (str) – directory to check for project Returns: absolute path Return type: str
-
get_relpaths
()¶ Get paths of project resources relative to pwd
Note
Mostly legacy method, preserved only using all assets’ relative paths in
self.create_doc()
Returns: relative paths of project paths (e.g. the project’s csl_dir) Return type: dict
-
get_template
(config, template_opt)¶ Get template object to use for new document
Parameters: config (ConfigParser) – config of project Returns: template to use Return type: jinja2.environment.Template
-
git_init
()¶ Initialize git repository in project_path
-
init
()¶ Initialize project directory
Reinitialize vsuite for the user, and initialize the present working directory as a project directory. This includes creating the .vsuite directory, creating and empty bibliography file, and initializing a git repo.
-
init_inherit
()¶ Initialize project directory
Reinitialize vsuite for the user, and initialize the present working directory as a project directory, inheriting assets and config from the parents project
-
make
(output)¶ Use make and pandoc to generate outputs
Use makefile from .vsuite directory, which leverages pandoc to generate requested outputs
Parameters: output (str) – name of argument to pass to make
-