-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support for GitHub issue/prs to markdown #5
base: main
Are you sure you want to change the base?
Conversation
Add support for converting GitHub issues to markdown. * Add `convert_github_issue` method in `src/markitdown/_markitdown.py` to handle GitHub issue conversion. * Use `PyGithub` to fetch issue details using the provided token. * Convert the issue details to markdown format and return as `DocumentConverterResult`. * Add optional GitHub issue support with `IS_GITHUB_ISSUE_CAPABLE` flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no suggestions.
Comments skipped due to low confidence (1)
src/markitdown/_markitdown.py:1115
- The error message should specify the package name to install. Suggest changing to: 'PyGithub is not installed. Please install the package using
pip install PyGithub
to use this feature.'
raise ImportError("PyGithub is not installed. Please install it to use this feature.")
Looks good, but I'll test it when I get back in to town today. |
I think my approach won't work with the CLI tho, I need to fix that. |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
I fixed the cli issue as well. still not sure if |
parsed_url = urlparse(url) | ||
if parsed_url.hostname == "github.com" and any( | ||
x in parsed_url.path for x in ["/issues/", "/pull/"] | ||
): | ||
github_token = kwargs.get("github_token", os.getenv("GITHUB_TOKEN")) | ||
if not github_token: | ||
raise ValueError( | ||
"GitHub token is required for GitHub issue or pull request conversion." | ||
) | ||
return GitHubIssueConverter().convert( | ||
github_url=url, github_token=github_token | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afourney this was the conditional that I added since accessing GH requires API call.
Nice |
Enables the following
The output would be: