MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / compute_github_pages_url

Function compute_github_pages_url

codewiki/cli/utils/instructions.py:10–30  ·  view source on GitHub ↗

Compute expected GitHub Pages URL from repository URL. Args: repo_url: GitHub repository URL repo_name: Repository name Returns: Expected GitHub Pages URL

(repo_url: str, repo_name: str)

Source from the content-addressed store, hash-verified

8
9
10def compute_github_pages_url(repo_url: str, repo_name: str) -> str:
11 """
12 Compute expected GitHub Pages URL from repository URL.
13
14 Args:
15 repo_url: GitHub repository URL
16 repo_name: Repository name
17
18 Returns:
19 Expected GitHub Pages URL
20 """
21 # Extract owner from GitHub URL
22 # e.g., "https://github.com/owner/repo" -> "owner"
23 if "github.com" in repo_url:
24 parts = repo_url.rstrip("/").split("/")
25 if len(parts) >= 2:
26 owner = parts[-2]
27 repo = parts[-1].replace(".git", "")
28 return f"https://{owner}.github.io/{repo}/"
29
30 return f"https://YOUR_USERNAME.github.io/{repo_name}/"
31
32
33def get_pr_creation_url(repo_url: str, branch_name: str) -> str:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected