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 clients overview page #166

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

Conversation

liorsve
Copy link

@liorsve liorsve commented Nov 25, 2024

Description

Adds a client page to docs on the website. The page is added to the top nav docs, called "Client Libraries", and its url is top level valkey.io/clients .
This PR is dependent on the complimentary docs PR being merged.

How it works -

  • The init-topics.sh script was modified to expect the path to the clients docs folder as its second argument. It creates a symlink to it, called build-clients. The clients folder in docs holds json files specifying each client's details and features.
  • content/clients/_index.md has in its frontmatter the list of paths to the clients appearing in this page. This list is used by the client-list.html template to render the specified clients' data. This template also includes the client-feature-table.html template that renders the same json files to produce a table comparing which features each client implements.

Issues Resolved

#161
Dependent on this PR being merged - #164

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.

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.

Copy link
Author

@liorsve liorsve Dec 16, 2024

Choose a reason for hiding this comment

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

So what I merged (before seeing your comment) in order to avoid changing thedocs-page.html template, is to just override it completely with a custom template that renders everything that needs to be rendered from jsons. Then no flags/changes to docs-page.html are needed. WDYT? @stockholmux

@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.

@zuiderkwast
Copy link
Contributor

I fail to see in the diff what the URL of this page will be.

I suggest we put it under the root, at https://valkey.io/clients/. It doesn't really belong under topics.

We already have links to ../clients/ from topics and commands pages, because the corresponding page in the old redis website had this location too. By keeping this, we don't need to update the links in the doc repo.

I don't have a strong opinion about this though. If there is another plan, then we can just update the links in the docs to point to the right path, because I prefer that they make sense for doc writers.

@liorsve
Copy link
Author

liorsve commented Dec 18, 2024

@zuiderkwast I have no problem moving this, we haven't discussed it and I just put it in topics as a starting point for discussion, so we'll have some kind of visualization. Also it would simplify things if it's not under topics, cause then maybe I won't have to use the topic custom frontmatter PR. Where do you suggest placing this on the website?

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.

This belongs in the top nav documentation drop down and on the /docs/ page as well. But the url should be top level (e.g. valkey.io/clients

{% set client = load_data(path = docs::client_json_path(client_path= path), format="json") %}
{% if client.language == language %}
<div class="client-item">
<h3>{{ client.name }}</h3>
Copy link
Member

Choose a reason for hiding this comment

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

needs a id with slugified client.name as to allow for deep linking to a specific client.

Copy link
Author

Choose a reason for hiding this comment

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

Added

@liorsve liorsve changed the title Adds a client feature comparison table for a future clients overview page Adds a clients overview page Jan 7, 2025
@liorsve liorsve force-pushed the website-clients-page branch from f8ee2d8 to 8e69fbc Compare January 9, 2025 13:55
@liorsve
Copy link
Author

liorsve commented Jan 9, 2025

Summarizing the big changes I added -

  1. The page moved from being a topic to the top nav docs, called "Client Libraries". With url valkey.io/clients.
  2. Because this is not a topic anymore and it requires creating a symlink to the clients folder in docs, it needs to be included in the shell script. But it's only for creating the symlink and it doesn't create any stub files like the current init-topics.sh does for topics, so it's a relatively little addition. So I though it's better to avoid adding a separate init-clients.sh file, and instead modify init-topics.sh to be init-topics-and-clients, and have it expect the path to topics as its first arg, and the path to clients as its second arg. README was updated accordingly.
  3. I moved here the markdown content for this page (i.e. explanations about the different client features), which previously was loaded from topics in the docs repo.
  4. Updated clients paths according to the change in structure of the clients folder in the docs repo PR - #164.

Signed-off-by: lior sventitzky <[email protected]>
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.

3 participants