refactor: add more types

include types for the new info.yaml
This commit is contained in:
Uri Shaked
2023-12-23 21:27:22 +02:00
parent 0ea5cec65d
commit c2c0d8ffbd
8 changed files with 253 additions and 197 deletions
+9 -3
View File
@@ -3,24 +3,30 @@ import logging
import os
import shutil
import subprocess
from typing import List
import frontmatter # type: ignore
import git
import git # type: ignore
from config import Config
from git_utils import get_first_remote
from markdown_utils import latex_centered_image, rewrite_image_paths
from project import Project
class DocsArgs:
dump_json: str
class Docs:
def __init__(self, config: Config, projects, args):
def __init__(self, config: Config, projects: List[Project], args: DocsArgs):
self.config = config
self.projects = projects
self.args = args
self.script_dir = os.path.dirname(os.path.realpath(__file__))
# stuff related to docs
def build_index(self, filename="shuttle_index.md"):
def build_index(self, filename: str = "shuttle_index.md"):
logging.info(f"building {filename}")
repo = git.Repo(".")
readme = self.load_doc_template("shuttle_index_header.md")