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

Adds a client feature comparison table for a future clients overview page #166

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

liorsve
Copy link

@liorsve liorsve commented Nov 25, 2024

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

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License.

Signed-off-by: lior sventitzky <[email protected]>
Copy link
Member

@stockholmux stockholmux left a 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.

build/init-topics.sh Outdated Show resolved Hide resolved
config.toml Show resolved Hide resolved
config.toml Outdated
@@ -48,4 +49,16 @@ publish_hold = [
"/topics/internals/",
"/topics/protocol/",
"/topics/rdd/"
]

recommended_clients_paths = [
Copy link
Member

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?

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Alright @liorsve, we're dependent on #164 make sense.

<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;">
Copy link
Member

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.

Copy link
Author

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?

config.toml Outdated Show resolved Hide resolved
@@ -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" %}
Copy link
Member

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.

Copy link
Author

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?

Copy link
Member

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.

@liorsve
Copy link
Author

liorsve commented Dec 1, 2024

  • cherry-picked added custom frontmatter for topics, override for about/history #167
  • added a custom frontmatter that overrides the default topics template, and contains the list of recommended clients' paths
  • created a new custom template for the clients page topic, which renders all client specific content from the json client files in valkey-doc/clients (github url, installation and description), and includes the feature comparison table.

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

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