-
Notifications
You must be signed in to change notification settings - Fork 39
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
base: main
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.
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.
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.
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
|
I fail to see in the diff what the URL of this page will be. I suggest we put it under the root, at We already have links to 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. |
@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? |
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.
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
templates/client-list.html
Outdated
{% 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> |
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.
needs a id
with slugified client.name
as to allow for deep linking to a specific client.
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
Signed-off-by: lior sventitzky <[email protected]>
Signed-off-by: lior sventitzky <[email protected]>
Signed-off-by: lior sventitzky <[email protected]>
Signed-off-by: lior sventitzky <[email protected]>
…d paths Signed-off-by: lior sventitzky <[email protected]>
…link to clients folder Signed-off-by: lior sventitzky <[email protected]>
Signed-off-by: lior sventitzky <[email protected]>
Signed-off-by: lior sventitzky <[email protected]>
f8ee2d8
to
8e69fbc
Compare
Summarizing the big changes I added -
|
Signed-off-by: lior sventitzky <[email protected]>
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 -
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, calledbuild-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 theclient-list.html
template to render the specified clients' data. This template also includes theclient-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
--signoff
By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License.