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

Add GitHub File as HTML block #25

Merged
merged 29 commits into from
Sep 10, 2024
Merged

Add GitHub File as HTML block #25

merged 29 commits into from
Sep 10, 2024

Conversation

mhsdef
Copy link
Contributor

@mhsdef mhsdef commented Sep 1, 2024

This PR adds a GitHub File as HTML block. The main query, for now, requires a file extension hardcoded in registration to determine the types of files to list.

The file that is selected is fetched from GitHub as HTML and inserted into the current page via a pattern that binds the source to a paragraph block. Not ideal semantically, but, the best we have there in binding at the moment. The result renders nicely in spite of the <p> wrapping.

@mhsdef mhsdef self-assigned this Sep 1, 2024
@mhsdef mhsdef changed the base branch from trunk to hewsut/move-response-processing-to-query-context September 1, 2024 15:34
@mhsdef mhsdef requested a review from chriszarate September 1, 2024 15:36
@mhsdef mhsdef changed the base branch from hewsut/move-response-processing-to-query-context to trunk September 1, 2024 15:39
public function get_endpoint( array $input_variables ): string {
return sprintf(
'https://api.github.com/repos/%s/%s/contents/%s?ref=%s',
$this->get_datasource()->repo_owner,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be an input variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like yes.

I'll tweak. I need to get my head screwed on better in this part. The way inputs and outputs pipe between each other is still pretty magic to me.

@mhsdef mhsdef merged commit 7c36bc9 into trunk Sep 10, 2024
5 checks passed
@mhsdef mhsdef deleted the hewsut/add-github-block branch September 10, 2024 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants