Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[frontend] fixed autodoc error #192

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions doc-build/docer/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from docer.core.autodoc import AutoDoc
from docer.core.docs import DocManager
from docer.core.doctest import DocTest
from docer.core.git import GitClient


@click.command(help="Extract the docs from the versions given in the main branch")
Expand Down Expand Up @@ -40,6 +41,7 @@ def extract(cache, owner, project, ref):
@click.option('-n', '--name', help="name of the folder containing the docs", default=None)
def autodoc(cache, owner, project, ref, name):
auto_doc = AutoDoc()
git_client = GitClient(root_directory=cache, owner=owner, project=project)

doc_dir = os.path.join(cache, 'docs')

Expand All @@ -50,12 +52,13 @@ def _convert(tag_ver, version_dir):
version_tag=tag_ver,
)

# generate the github url based on page info
pip_link = "git+https://github.com/{repo_owner}/{repo_name}.git@{version_tag}".format(**page_info)
# git checkout to the specified ref
git_client.checkout(ref)

# install this url via pip
# such that the autodoc is with respect the specified version
subprocess.check_call(['pip', 'install', '--force-reinstall', pip_link])
with git_client._change_dir(git_client.repo_directory):
subprocess.check_call(['pip', 'install', '--force-reinstall', "."])

# convert all docs in place
auto_doc.convert_to_mdx_in_place(version_dir, page_info)
Expand Down
Loading