GithubOpenFileHandler

class GithubOpenFileHandler(githubRepository: String, branch: String = "main", server: String = "https://github.com") : UrlOpenFileHandler

An OpenFileHandler that opens files in GitHub's web interface.

This handler generates URLs that point to specific files and line numbers in a GitHub repository, allowing users to view the source code of previews directly in their web browser.

Parameters

githubRepository

The GitHub repository in format "owner/repository"

branch

The branch name to link to (defaults to "main")

server

The GitHub server URL (defaults to "https://github.com" for public GitHub)

Constructors

Link copied to clipboard
constructor(githubRepository: String, branch: String = "main", server: String = "https://github.com")

Functions

Link copied to clipboard
open override fun configure(): UriHandler

If there is data that needs to be prepared in the Composable function, specify it here.

Link copied to clipboard
open override fun openFile(params: OpenFileHandler.Params<UriHandler>)

Open a file in the project.