def parse_notebook()

in notebooks/notebook_template_review.py [0:0]


def parse_notebook(path: str,
                   tags: List,
                   linkback: str,
                   rules: List) -> int:
    """
        Review the specified notebook for conforming to the notebook template
        and notebook authoring requirements.
        
            path: The path to the notebook.
            tags: The associated tags
            linkback: A link back to the web docs
            rules: The cell rules to apply
            
        Returns the number of errors
    """
    notebook = Notebook(path)
    
    for rule in rules:
        rule.validate(notebook)

    
    # Automatic Index Generation
    if objective.desc != '':
        if overview.linkbacks:
            linkbacks = overview.linkbacks
        else:
            if linkback:
                linkbacks = [linkback]
            else:
                linkbacks = []

        if overview.tags:
            tags = overview.tags
                
        add_index(path, 
                  tags, 
                  linkbacks,
                  title.title, 
                  objective.desc, 
                  objective.uses, 
                  objective.steps, 
                  links.git_link, 
                  links.colab_link, 
                  links.colab_enterprise_link, 
                  links.workbench_link,
        )
        
    if args.fix:
        notebook.writeback()
        
    return notebook.num_errors