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.

check_for_project()

Verify that current directory is a project

Raises:(FileExistsError) – If not in a project directory
copy_asset(src_asset, dest_asset)

Copy asset files from one asset to another

Parameters:
create_bibliography()

Create bibliography if it doesn’t exist

Bibliography checked and created with bibliography value from project settings

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 settings
Raises:

(FileExistsError) – If file with same name already exists

create_project_dir()

Create .vsuite directory if it doesn’t exist

get_project_dir(cursor_dir='/home/docs/checkouts/readthedocs.org/user_builds/vsuite/checkouts/v0.4.0/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 settings from the parents project

init_project_config()

Copy user config into 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