-
Notifications
You must be signed in to change notification settings - Fork 3
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
github markdown block link fixes #191
base: add/query-input-transforms
Are you sure you want to change the base?
Conversation
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.
@maxschmeling What do you think about extracting the query classes to shared code in inc/Integrations/Github
directory ? GitHub would have a static response format like Shopify so this is a good candidate for this, but the current implementation is also somewhat specific to markdown.
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.
The logic to make it work without the .md
in the path could go here -
Line 70 in bec543b
$input_variables['file_path'], |
.md
if it is absent in the path in the input variables. We would need to make it generic though as this query is generic for GitHub and specific to just a markdown file.
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.
I don't think we should move this to the integrations folder yet, though it might make sense to do that at some point. I think I'd want to do more with it rather than something that is narrowly scoped to what we're using it for.
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.
I've moved the markdown parsing/url update logic here in the query file and removed the GitHubParser file from integrations DIR.
d383ae9
to
9e89594
Compare
Enhance GitHubGetFileAsHtmlQuery with optional file extension handling. The query now accepts a default extension parameter that automatically appends to file paths when missing. Updated registration to default to '.md' for markdown files, maintaining consistency with ListFilesQuery behavior.
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.
I'm wondering if this parser logic belongs in the plugin or if it should go in custom configuration in the site code. I just wonder if it's generic enough. Thoughts?
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.
I don't think we should move this to the integrations folder yet, though it might make sense to do that at some point. I think I'd want to do more with it rather than something that is narrowly scoped to what we're using it for.
Description
Important
Depends on PR #198
This PR fixes the broken internal links to other markdown docs when using "GitHub File As HTML" block.
Changes
/
). For example in urlpage_slug/$first/$second
$first
and$second
are assigned to first and second input variables respectively. This was a blocker in using the GitHub Doc Markdown file path as url overrides since the file path contains slashes. Now if there is just one input variable, all the url overrides are treated as just one input variable. For examplepage_slug/$dir/$path/$file
will assign$dir/$path/$file
to the input variable..md
suffix.md
.Testing
http://localhost:8888/gh
./gh/${file_path}
.http://localhost:8888/gh/${file_path}
(e.g.http://localhost:8888/gh/docs/workflows/google-sheets-with-code
) and verify that the docs are rendered correctly and the internal links are working.