-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from eli64s/refactor/readme-builder
Refactor ReadmeBuilder to Class-Based Design and Enhance Configuration
- Loading branch information
Showing
22 changed files
with
625 additions
and
588 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
"""Enum classes for the readmeai package.""" | ||
|
||
from enum import Enum | ||
|
||
|
||
class GitService(str, Enum): | ||
""" | ||
Enum class for Git service details. | ||
""" | ||
|
||
LOCAL = "local" | ||
GITHUB = "github.com" | ||
GITLAB = "gitlab.com" | ||
BITBUCKET = "bitbucket.org" | ||
|
||
@property | ||
def api_url(self): | ||
"""Gets the API URL for the Git service.""" | ||
return { | ||
GitService.LOCAL: None, | ||
GitService.GITHUB: "https://api.github.com/repos/", | ||
GitService.GITLAB: "https://api.gitlab.com/v4/projects/", | ||
GitService.BITBUCKET: "https://api.bitbucket.org/2.0/repositories/", | ||
}.get(self, None) | ||
|
||
@property | ||
def file_url_template(self): | ||
"""Gets the file URL template for the Git service.""" | ||
return { | ||
GitService.LOCAL: "{file_path}", | ||
GitService.GITHUB: "https://github.com/{full_name}/blob/main/{file_path}", | ||
GitService.GITLAB: "https://gitlab.com/{full_name}/-/blob/master/{file_path}", | ||
GitService.BITBUCKET: "https://bitbucket.org/{full_name}/src/master/{file_path}", | ||
}.get(self, None) | ||
|
||
|
||
class BadgeOptions(str, Enum): | ||
""" | ||
Enum for CLI options for README file badge icons. | ||
""" | ||
|
||
DEFAULT = "default" | ||
FLAT = "flat" | ||
FLAT_SQUARE = "flat-square" | ||
FOR_THE_BADGE = "for-the-badge" | ||
PLASTIC = "plastic" | ||
SKILLS = "skills" | ||
SKILLS_LIGHT = "skills-light" | ||
SOCIAL = "social" | ||
|
||
|
||
class ImageOptions(str, Enum): | ||
""" | ||
Enum for CLI options for README file header images. | ||
""" | ||
|
||
CUSTOM = "CUSTOM" | ||
DEFAULT = "https://raw.githubusercontent.com/PKief/vscode-material-icon-theme/ec559a9f6bfd399b82bb44393651661b08aaf7ba/icons/folder-markdown-open.svg" | ||
BLACK = "https://img.icons8.com/external-tal-revivo-regular-tal-revivo/96/external-readme-is-a-easy-to-build-a-developer-hub-that-adapts-to-the-user-logo-regular-tal-revivo.png" | ||
GREY = "https://img.icons8.com/external-tal-revivo-filled-tal-revivo/96/external-markdown-a-lightweight-markup-language-with-plain-text-formatting-syntax-logo-filled-tal-revivo.png" | ||
PURPLE = "https://img.icons8.com/external-tal-revivo-duo-tal-revivo/100/external-markdown-a-lightweight-markup-language-with-plain-text-formatting-syntax-logo-duo-tal-revivo.png" | ||
YELLOW = "https://img.icons8.com/pulsar-color/96/markdown.png" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.