-
Notifications
You must be signed in to change notification settings - Fork 35
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
Adds a client feature comparison table for a future clients overview page #166
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: lior sventitzky <[email protected]>
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.
It needs some adjustments and I have some general approach questions but quite good work on this!
One general comment that I couldn't stick anywhere: Make sure your final PR includes README instructions on how this works.
config.toml
Outdated
@@ -48,4 +49,16 @@ publish_hold = [ | |||
"/topics/internals/", | |||
"/topics/protocol/", | |||
"/topics/rdd/" | |||
] | |||
|
|||
recommended_clients_paths = [ |
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.
Two questions here:
config.toml
is a site-level configuration (e.g. included on every page). Is there a better place for this data? I would guess either the macro can load a arbitrary file or include a recommended flag in the JSON file itself. It could also be stored in custom frontmatter (see added custom frontmatter for topics, override for about/history #167), which might be a flexible alternative to present different recommendations on different pages.- How was the 'recommendation' list arrived at?
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.
- Seems like the custom frontmatter is the best option here as it would also help with avoiding checking for slug
- about the list - Introduce Valkey client overview valkey-doc#164 (comment)
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.
templates/client_feature_table.html
Outdated
<hr/> | ||
<h2>Feature Comparison Table</h2> | ||
{% if page.slug == "valkey-clients" %} | ||
<div style="margin: 20px 0; padding: 10px; border: 2px solid #dcdcdc; background-color: #f9f9f9; border-radius: 5px; overflow-x: auto;"> |
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.
please use proper CSS classes throughout and define styles with SASS.
Inline styles are difficult to maintain and make consistent style changes across the site.
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.
Added, I put it in the _valkey.scss file - hope this is the right place?
templates/docs-page.html
Outdated
@@ -38,11 +38,14 @@ <h1 class="page-title">Documentation: {{ frontmatter_title }}</h1> | |||
{% else %} | |||
{{ content_with_fixed_links | markdown | safe }} | |||
{% endif %} | |||
{% if page.slug == "valkey-clients" %} |
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 unclear why page.slug
is being checked here and on client_feature_table.html
.
On the topic of comparing for the page slug: Is there are more elegant way of doing this? Right now it ties it to a specific page - what if we wanted to include the table on other pages? Ideally this could be achieved without touching the template, only the content.
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.
No reason, just forgot to remove it from previous versions. Removed it now.
About comparing for slug, I tried to avoid this and couldn't find another solution, but now that I see #167 , I could maybe create a custom frontmatter with a custom template for this topic that would override the default topic template, which would render all client specific content (the table, but also all of the client list section as per this comment). Does this sound better?
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.
Yeah, so what we can do is add some flag to [extra]
section of the front matter (maybe include_client_table
) and the template checks for that and adds it. Lots of ways to do this, but the general approach is a lot more flexible.
You could even some configuration, e.g. show only python clients or clients that support some feature. Definitely don't need that now, but think about it when implementing something to replace the slug comparison.
Signed-off-by: lior sventitzky <[email protected]>
Signed-off-by: Kyle J. Davis <[email protected]>
Signed-off-by: lior sventitzky <[email protected]>
However, for some reason when I run this locally, the page loads extremely slowly when I try to reach it through the regular docs-by-topics list in the website, but loads normally when I reach it through the Alphabetical index. Do you have any idea why could that be? Maybe something with the custom frontmatter? @stockholmux |
Description
Adds logic to support a client feature comparison table to be added to the clients documentation topics page (dependent on it being merged). The table renders from the json clients files in the docs repo.
Issues Resolved
#161
Dependent on these PRs being merged - #164 and #167
Check List
--signoff
By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License.