-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
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, |
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.
Shouldn't this be an input variable?
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.
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.
…hewsut/add-github-block
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.