Code Monkey home page Code Monkey logo

docs-ui's Introduction

DataStax Docs UI

Latest UI bundle release (GitHub) Latest UI preview (GitHub Pages)

This project is used to develop and distribute the UI template for docs.datastax.com. It is a fork of the Antora Default UI that has been customized for our needs.

The repository itself produces a UI bundle that can be applied when generating a static documentation site using Antora — in our case, we apply it when generating datastax-docs-site. The UI bundle contains the HTML templates (layouts, partials, and helpers), CSS, JavaScript, fonts, and (site-wide) images. As such, it provides both the visual theme and user interactions for the documentation site.

Use the DataStax Docs UI

To use the DataStax Docs UI with Antora, add the following configuration to your playbook file:

ui:
  bundle:
    url: https://github.com/riptano/ui-docs/releases/latest/download/ui-bundle.zip
    snapshot: true
ℹ️

The snapshot flag tells Antora to fetch the UI when the --fetch command-line flag is present. This setting is required because updates to the UI bundle are pushed to the same URL. If the URL were to be unique, this setting would not be required.

Read on to learn how to develop the UI.

Development quickstart

This section offers a basic tutorial to teach you how to set up the UI project, preview it locally, and bundle it for use with Antora. A more comprehensive tutorial can be found in the documentation at docs.antora.org/antora-ui-default/.

Prerequisites

To preview and bundle the UI, you need the following software on your computer:

git

First, make sure you have git installed.

git --version

If not, download and install the git package for your system.

Node.js

Next, make sure that you have Node.js installed (which also provides npm).

node --version

If this command fails with an error, you don’t have Node.js installed. If the command doesn’t report an LTS version of Node.js, it means you don’t have a suitable version of Node.js installed.

While you can install Node.js from the official packages, we strongly recommend that you use nvm (Node Version Manager) to manage your Node.js installation(s). Follow the nvm installation instructions to set up nvm on your machine.

Once you’ve installed nvm, open a new terminal and install Node.js LTS using the following command:

nvm install --lts

You can switch to this version of Node.js at any time using the following command:

nvm use --lts

To make Node.js LTS the default in new terminals, type:

nvm alias default node

Now that you have Node.js installed, you can proceed with installing the Gulp CLI.

Gulp CLI

You’ll need the Gulp command-line interface (CLI) to run the build. The Gulp CLI package provides the gulp command which, in turn, executes the version of Gulp declared by the project.

You can install the Gulp CLI globally (which resolves to a location in your user directory if you’re using nvm) using the following command:

npm install -g gulp-cli

Verify the Gulp CLI is installed and on your PATH by running:

gulp --version

If you prefer to install global packages using Yarn, run this command instead:

yarn global add gulp-cli

Alternately, you can use the gulp command that is installed by the project’s dependencies.

npx --offline gulp --version

Now that you have the prerequisites installed, you can fetch and build the UI project.

Clone and initialize the UI project

Clone the default UI project using git:

git clone https://github.com/riptano/docs-ui &&
cd "`basename $_`"

The example above clones the DataStax Docs UI project and then switches to the project folder on your filesystem. Stay in this project folder when executing all subsequent commands.

Use npm to install the project’s dependencies inside the project. In your terminal, execute the following command:

npm install

This command installs the dependencies listed in package.json into the node_modules/ folder inside the project. This folder does not get included in the UI bundle and should not be committed to the source control repository.

💡

If you prefer to install packages using Yarn, run this command instead:

yarn

Preview the UI

The default UI project is configured to preview offline. The files in the preview-src/ folder provide the sample content that allow you to see the UI in action. In this folder, you’ll primarily find pages written in AsciiDoc. These pages provide a representative sample and kitchen sink of content from the real site.

To build the UI and preview it in a local web server, run the preview command:

gulp preview

You’ll see a URL listed in the output of this command:

[12:00:00] Starting server...
[12:00:00] Server started http://localhost:5252
[12:00:00] Running server

Navigate to this URL to preview the site locally.

While this command is running, any changes you make to the source files will be instantly reflected in the browser. This works by monitoring the project for changes, running the preview:build task if a change is detected, and sending the updates to the browser.

Press Ctrl+C to stop the preview server and end the continuous build.

ℹ️

Opening or updating a pull request against the main branch triggers an automatic gulp preview deployment to GitHub Pages so that reviewers can view your latest changes without having to run the preview locally.

Package for use with Antora

If you need to package the UI so you can use it to generate the documentation site locally, run the following command:

gulp bundle

If any errors are reported by lint, you’ll need to fix them.

When the command completes successfully, the UI bundle will be available at build/ui-bundle.zip. You can point Antora at the local path to this bundle using the --ui-bundle-url command-line option or the ui.bundle.url key in the site playbook.

If you have the preview running, and you want to bundle without causing the preview to be clobbered, use:

gulp bundle:pack

The UI bundle will again be available at build/ui-bundle.zip.

ℹ️

UI bundles for the DataStax documentation site are automatically published via automation. See Automatic UI bundle release.

Source maps

The build consolidates all the CSS and client-side JavaScript into combined files, site.css and site.js, respectively, in order to reduce the size of the bundle. Source maps correlate these combined files with their original sources.

This “source mapping” is accomplished by generating additional map files that make this association. These map files sit adjacent to the combined files in the build folder. The mapping they provide allows the debugger to present the original source rather than the obfuscated file, an essential tool for debugging.

In preview mode, source maps are enabled automatically, so there’s nothing you have to do to make use of them. If you need to include source maps in the bundle, you can do so by setting the SOURCEMAPS environment variable to true when you run the bundle command:

SOURCEMAPS=true gulp bundle

In this case, the bundle will include the source maps, which can be used for debugging your production site.

Using TailwindCSS

This project uses TailwindCSS. To learn more see TailwindCSS README.

Automatic UI bundle release

Once you’re satisfied with the changes you’ve made to the UI, you’ll need to open a pull request to merge your changes into the main branch. Upon merging a pull request into main, the following automation occurs:

  1. A new UI bundle is built using gulp bundle (linting also occurs during this step).

  2. Assuming a successful build, a new tag is applied to the latest commit (incremented from the previous prod-# tag).

  3. A new prod-# release is published with auto-generated release notes and the UI bundle release asset.

💡

If you don’t want your pull request to trigger an automatic release, e.g. you’re only making updates to the README or preview-src files, you can skip the automation by including [no-release] in the commit message.

Once the release is published, you can apply it by updating your Antora playbook to point to the new UI bundle URL. To apply it to the DataStax documentation site, you’ll need to update the playbook in the datastax-docs-site repository.

Software

Original Copyright © 2017-present OpenDevise Inc. and the Antora Project.

Modifications and additions Copyright © 2023-present DataStax Inc..

Use of this software is granted under the terms of the Mozilla Public License Version 2.0 (MPL-2.0). See LICENSE to find the full license text.

Branding and design

Copyright © DataStax Inc. 2023-present. All rights reserved.

docs-ui's People

Contributors

brunchboy avatar colegoldsmith avatar cristatus avatar danyill avatar djencks avatar edward-encoord avatar eric-schneider avatar eskwayrd avatar estela-beatriz avatar ferdnyc avatar fviolette avatar gabeseltzer avatar ggrossetie avatar graphitefriction avatar hemangajmera avatar hsablonniere avatar johnsmartco avatar josuebran avatar konrumi avatar kurtenj avatar martinhiller avatar mlr avatar mojavelinux avatar pbokoc avatar pierrer avatar rben01 avatar severeoverfl0w avatar sharom avatar snova-pavela avatar tgirard12 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs-ui's Issues

Extend icon library

It would be nice to have easy access to additional icons, e.g. code languages and brands, and invoke them in the same/similar way to how we invoke Material icons. The current solution is to add icons as you would any other image, which usually results in poor-looking icons that don't support light/dark mode out of the box.

image

image

Nested items in unordered list don't use correct symbols

Maybe this was a conscious design choice (I don't remember), but usually the symbol for an unordered list item changes depending on the level of nesting. Currently all levels of nesting use the same disc symbol (see preview). Whereas the AsciiDoc/Antora default UIs (example) use disc, circle, and then square for all subsequent levels.

image

image

CQL highlighting

JIRA: DOC-3966

To provide a better user experience for CQL users, we should support CQL language syntax highlighting in code blocks.

Background

The DataStax docs have never had true CQL highlighting. Like the Astra Portal UI, the docs site previously used the SQL definition behind the scenes (the current docs UI doesn't provide any highlighting for CQL). But while the SQL and CQL grammars are similar, they are not the same, and it's important for DataStax as a company to provide the best docs experience for CQL users.

Unfortunately, there is no CQL definition available for highlight.js or any of the common highlighter libraries. Luckily, Therapon Skoteiniotis created an initial beta of a highlight.js language definition for CQL: https://github.com/riptano/highlightjs-cql.

The definition should be considered BETA for now. Not all of the syntax has been tested and some highlighting might appear incorrect (there are a lot of context sensitive keywords in SQL in general and CQL inherits some of it).

Requirements

  1. Complete the repo setup.
  • Should align with best practices of other 3rd party highlightjs definition projects. See Language contributor checklist and SUPPORTED_LANGUAGES.md.
  • The CI works for PRs. The CI will not work for publishing to NPM since we do not have a TOKEN from a valid account in NPM. So that will fail at the moment.
  • The links in the package.json file (to issues and homepages) are a guess since we're not sure which organization the repo will eventually live in yet, or whether it will be made public.
  1. Test the definition against Cassandra 4 CQL grammar and fix any reported issues.
  2. Import the library into the Docs UI.

Stretch goals

  1. Test and update the definition to support the Cassandra 5 CQL grammar. The definition should support the vector type and any other CQL changes in Cassandra 5.
  2. Open-source the definition and publish to NPM under the official DataStax account.
  1. If there's a need, work with the FE team to integrate the highlighter into the Astra Portal UI. (Probably requires porting the definition to Prism.)

Clickable icons for custom anchors

We have a legacy ticket open to enhance our old Antora UI to provide clickable icons for custom anchors (DOC-4076). This was a feature that existed in the old DITA UI but did not get ported into our Antora UI.

The request is to provide clickable anchor link icons, like the auto-generated ones we currently have on section titles, but on elements where a custom AsciiDoc ID has been defined. These can be block and inline elements, such as list items, tables, etc.

STEM support

There are certain pages in the docs where we may need to display equations and other types of math. Currently, we have to manually create SVG files to present this kind of information, which is labor-intensive to create, update, and make compatible with our CSS styles.

To alleviate this problem, the AsciiDoc language provides STEM support for embedding math-mode macros from LaTeX and/or AsciiMath notation as block or inline elements (see docs-ui preview). These elements act as passthroughs to preserve the expressions as entered. The expressions are then passed on to the converter to be processed and rendered for display using a STEM provider (e.g., MathJax).

The STEM provider must be configured in the output converter to render the expressions. As far as implementation goes, we should thoroughly review the discussion in Antora Issue #184 and investigate the options presented. The simplest approach would probably be to load MathJax via CDN on just the pages that use stem. (That's the approach the Apache Cassandra project went with: apache/cassandra-website#215.) However, as pointed out in the Antora discussion, using a CDN is a security risk. But coming up with an offline alternative might be tricky. The offline approach presented in this comment might be a good place to start since it appears to have the semi-endorsement of the Antora maintainers.

Add inline image support to `svg` macro; attempt feature parity with built-in `image:` and `image::` macros

Note: The goal of this ticket is to allow the svg macro to be used for inline images. This is not to be confused with the opts=inline SVG attribute, which the svg macro already uses by default.

The svg macro syntax currently supports inline usage (svg:) and block usage (svg::). However, it appears that the macro only truly supports block images. This limits the macro's versatility and causes confusion for writers when the inline usage produces unexpected results.

Inline image support

There are cases where we'd like to be able to use the macro for inline images. For example, to achieve a table that looks like the following:

image

You would expect the syntax to look like this:

|===
|Embedding provider |External |Astra-hosted |Docs

|svg:ROOT:ui/icons/microsoft-azure-openai.svg[] Azure OpenAI <-- Macro inline with text
|[.material-icons]#check#
|
|xref:integrations:embedding-providers/azure-openai.adoc[Get started]
|===

However, because the macro generates a block image, the inline text gets bumped down into a new paragraph below the icon:

image

Feature parity with built-in image:: and image: macros

It would be ideal if the svg: and svg:: macro usages mirrored their image: and image:: counterparts in terms of their supported attributes and values.

Left nav issues

There are two major issues with the left nav.

Parent nav items can't be links

The UI currently doesn't support the following nav configuration:

* xref:parent-page.adoc[]
** xref:child-page.adoc[]

The parent page doesn't present as a link. This has forced us to use an undesirable workaround of making the parent page a child of itself, for example:

* Parent page
** xref:parent-page.adoc[]
** xref:child-page.adoc[]

image

A list title is required

IMPORTANT: As @mlr pointed out below, this should be fixed as of #103.

Currently, the UI requires the nav to have at least one list title element, otherwise it won't render anything at all.

✅ Does render

.Some title
* xref:page-1.adoc
* xref:page-2.adoc
* xref:page-3.adoc
* xref:page-4.adoc

❌ Does not render

* xref:page-1.adoc
* xref:page-2.adoc
* xref:page-3.adoc
* xref:page-4.adoc

Some products don't have enough pages to warrant using list titles. However, we've had to add at least one so that nav will at least show the pages in the first place:

image

Improve collapsible block styles; give special treatment for collapsible "results"

We need to give some love to the collapsible block.

Current styling:
image

The current styling doesn't match the original spec.

Original spec:

image

Collapsible results

In the past we've used tabsets to show a command and its output/results in separate tabs (example):

image

However, this presents a problem since many of our code examples span multiple API clients. If someone can switch between Python, TypeScript, and Java, we would need to provide separate results for each client and this gets messy.

The current workaround is to switch to using a collapsible section underneath the corresponding code block. In fact, the original spec actually hinted at this workaround:

image

This was a late addition to the spec that didn't get much discussion and was never implemented in the new UI. The downside of a collapsible block is that it currently presents a small clickable target that isn't as easy to notice/use as tabs are.

We should consider enhancing the UI to treat command + results as a special case that warrants its own special UI treatment. If possible, we should consider implementing this on the AsciiDoc side in such a way that doesn't require (but still allows) using the full collapsible block syntax.

Hover-over popups

There are any number of reasons that hover-over popups would be a great addition to these docs. Popups for glossary terms, or additional explanation that would be cumbersome in the text. File pathnames, that sort of thing.

Have you considered adding that capability to the publishing?

Here are examples:

  1. http://creativeindividual.co.uk/2011/02/create-a-pop-up-div-in-jquery/
  2. This is actually a click-on popup from old DSE docs:
    Screenshot 2024-02-13 at 13 32 17

Update favicon

The UI currently gets its favicon by referencing www.datastax.com/favicon.ico. See head-meta.hbs:

<link rel="icon" href="https://www.datastax.com/favicon.ico">

The benefit of this approach, in theory, is that we would always display the same favicon as WWW. However, Marketing recently updated the favicon to a .png file, which resulted in the favicon 404'ing on all of our docs pages.

Marketing temporarily restored the previous file for us, but going forward we need to make a decision: Update the URL to use favicon.png, or start self-hosting the favicon in our own UI.

I think it's highly unlikely that the WWW favicon URL will change again unless/until web standards start favoring a different file format (.ico files were in use for over two decades). However, if we want to take an offline-first approach for the sake of durability and archivability, then it probably makes sense to start self-hosting.

If we go the self-hosted route, the Antora Default UI provides the following example (modified for PNG):

<link rel="icon" href="{{{uiRootPath}}}/img/favicon.png" type="image/png">

Since our site is published to docs.datastax.com/en, the above example would put the favicon at docs.datastax.com/en/_/img/favicon.png. I assume this is fine, but we'd want to confirm that it's ok not to have our favicon at the site root.

Rethink the location of page metadata elements

Original Basecamp task: https://3.basecamp.com/5214332/buckets/27604022/card_tables/cards/6687556414
Original reporter: @djsauble

The :page-colab-link:, :page-time-commitment:, :page-skill-level:, and # steps UI components contain useful information, but they're using a lot of valuable real estate right now. There's a ~100px high strip of screen under the title that's occupied by this information right now. Let's find a more efficient way to display it.

Some ideas:

  • Shrink the space requirements (e.g. from ~100px to ~40px)
  • Move these components inline with the page title
    • Consider pushing the right nav down so the page title can take up the entire width of the screen (minus the primary nav). Then, put the time commitment, skill level, and # steps to the immediate right of the page title, and float the Colab link to the right of the page (inline with the page title).

Wide leftnav in UI

Nav is a little wide - horizontal scrolls bar shows but doesn't scroll

Screenshot 2024-02-07 at 1 37 38 PM

Link to glossary does not contain site path

Despite the fact that the glossary link is referencing the site.path (see here) the final build is still lacking the /en prefix.

As a result the docs pages link to /glossary instead of /en/glossary

I've attempted variations including double curly and using site.url but was not able to determine the cause. This seems to be the only place this occurs. I'm not sure if it has to do with the partial or what.

For the time being a redirect is relocating users to the correct page.

Update format of page `<title>` tag

The Marketing team suggested that we update the format of the <title> tag for pages on the docs site. The goal is to make the titles more descriptive and useful when they appear in Google search results.

Currently, the page <title> tag is constructed as follows:

    <title>PAGE TITLE :: SITE TITLE</title>
  • PAGE TITLE - the AsciiDoc page title (value following single = at the top of each adoc page)
  • Two colons ::
  • SITE TITLE - the Antora site title (site.title key in the playbook)

Marketing recommends the following format:

    <title>PAGE TITLE | COMPONENT TITLE | SITE TITLE</title>
  • Adds the name of the component (product name) in which the page resides.
  • Replaces the two colons with a vertical bar |.

Additional requirements

Marketing had some additional suggestions:

  1. If the page title already contains the component title, then we should not include component title in the <title> tag.

    • If possible, we should try and implement a matching rule that looks for the component title within the page title, and if true, either removes or supresses the component title from the <title> tag of the page.
    • Currently, the titles of our landing pages are the same as the component titles. So if we can't implement the above solution, then we should try to at least remove the component title from the <title> tag of landing pages, specifically.
  2. (DEFERRED - will open a separate issue for this in the future) In some cases, a component title might not be well-known or descriptive enough for all users. For example, some users may not know that Starlight for Kafka falls under the umbrella of "Streaming".

    • We should maybe look into whether it's possible to customize the format of the <title> tag for specific components. For example:

          <title>PAGE TITLE | COMPONENT TITLE | Streaming | SITE TITLE</title>
  3. Apparently, studies show that click-through rate is higher for search results that are in title case (we use sentence case).

    • After some light searching, it doesn't seem to be common practice for documentation websites to use different cases for the <title> tag vs <h1>. Therefore, I think we should set aside this recommendation for the time being.

Algolia considerations

We need to look into why Algolia is presenting generic page titles in search analytics. It may be related to the page title tag. For more info, see the following Slack thread: https://datastax.slack.com/archives/C04B8E5LQ7L/p1710778039481909

Remove/fix animation for accordion

When you expand a nav element, the expansion happens downward, and the content within a section animates upward. This is quite disorienting and doesn't make a ton of sense. Can we remove the animation on the content within a nav element?

Bundle release improvements

Two things:

  1. [bug] It appears that when at least two PRs are merged in rapid succession, the workflow creates the correct number of tags, but sets them both on the same (most recent?) commit. This results in multiple releases with the same content. See prod-6 and prod-7: https://github.com/riptano/docs-ui/releases
  2. [enhancement] We probably shouldn't generate a new release for updates to preview-src/* and README.adoc.

Add component title to left nav

We don't provide users with an easy way to identify which component they're currently viewing. This is a big problem for wayfinding (especially for users arriving from Google search), and will continue to be a problem even after we introduce the global nav.

A good first step would be to add the component title to the top of the left nav. It should probably also be a link to the component start page (same as the breadcrumb). If the component has a version switcher, the title should sit adjacent to the version dropdown toggle.

NOTE: we should make sure to test long component titles to ensure that long titles wrap appropriately.

image (9)

Site search enhancements

Our current site search is powered by Algolia DocSearch. DocSearch is an off-the-shelf collection of a couple different Algolia components, optimized for relatively small documentation websites. DocSearch is way better than our previous Algolia implementation in almost every respect, including better/faster search results, as well as pre-built UI that comes has keyboard shortcuts and accessibility features.

However, although DocSearch is very powerful and easy to implement out of the box, it lacks customizability. In particular, it doesn't provide filtering and really allow for rich UI customization beyond color and component sizing.

We need to take a comprehensive look at our current site search experience to determine whether we want to make any further UX/UI enhancements (including product filtering) and create a list of those requirements. Once we have those requirements, we need to assess whether it's possible to satisfy those those requirements using DocSearch. If DocSearch isn't up to the task, then we'll need to build a new search experience from the ground up using standard Algolia components.

Interactive graphic

Our old UI has a feature that allows writers to place an interactive "slideshow" of images within a page. So far, this has only been utilized in the ZDM documentation. However, even though this feature hasn't been widely adopted in our other docs (and despite its very basic functionality), internal and external users have praised it for helping them understand a very complex process (ZDM) without having to vertically scroll through images.

In order for the ZDM docs to have parity in the new UI, we need to implement a similar feature in the new UI that offers an equivalent or better experience.

The widget is completely user-directed, and doesn't have (or need) automatic playback. It has basic navigation controls to move forward/backward between slides, and has the option to restart the slideshow on the last slide.

Because the slides are quite size-restricted within the widget, users can click on a slide to open it in a lightbox. Therefore to replicate the current UX, this feature will depend on #68.

Each "slide" consists of an image and a description. Here's the syntax:

[.swiper]
====
[.slide]
--
.Walk through the illustrated migration phases
Discover the migration concepts, software components, and sequence of operations.

image:migration-introduction9.png["Introductory page prompts you to click the Start button to begin the graphical presentation."]
--

...

[.slide]
-- 
.Phase 5: Connect directly to Target
In this phase, move your client applications off the ZDM Proxy and connect the apps directly to Target. Once that happens, the migration is complete.

image:migration-phase5ra9.png["Illustrates migration Phase 5, as summarized in the text. Back and Restart buttons are available for navigation within the graphic."]
--
====

Improve tab title wrapping

For tabsets, the tab titles should have a more elegant text wrapping solution that allows tab titles to automatically scale appropriately across different width constraints.

We should probably set a minimum and maximum tab title width that looks good, and then allow for wrapping to a second line when the width is constrained. Not sure if we should allow wrapping to a third line, but we should set a maximum number of lines to wrap, after which the title overflows into ellipses (or something along those lines).

Review and update section/block title styles

In AsciiDoc, there two important types of titles: section titles and block titles.

Section titles are prefixed with a section marker (=, ==, ===, ====), which indicates the HTML heading level for that section. In the current UI, section titles below H2 are not clearly differentiated. Although they have special spacing, they are not very visually distinct from one another, and they also tend to visually blend together with block titles and even bold paragraph text.

Block titles are any title placed on a block (line prefixed with a dot . above the block). This can be a title on a list, table, image, code snippet, admonition, sidebar, etc.. These title elements are often given unique styling depending on the type of block they're defined on. For example, image titles are placed below the image.

The differentiation problem is coming to a head with @djsauble's work to update the client references in https://github.com/riptano/astra-vector-docs/pull/311 (see example). The preferred design goes down to H4, but the headings just seem to get lost. This has the potential to be exacerbated by updates to the collapsible block in #94.

image

Image lightbox enhancements and fixes

NOTE: This issue should probably be worked on in conjunction with #83.

We need to make some enhancements to the image lightbox (#68):

  1. The lightbox doesn't currently support images that use the svg:: macro. This is problematic because we use this macro to support embedded SVGs that honor our CSS styles for light and dark mode (example).

  2. We should probably add a background to the lightbox that's the same size as the image. Currently, images with transparent backgrounds look messy when overlaid on top of page content (example).
    image

  3. We need to be able to selectively turn off the lightbox for certain images (both block and inline images). We could probably handle this with a role similar to the remove-ext-icon role that we use for selectively disabling the external link icon.
    Currently, the lightbox is enabled for the badge icons on the Connection methods comparison page, which is a little silly:
    image
    But more importantly, when we enable the lightbox for the svg:: macro, we'll need to be able to turn off the lightbox for the graphics on the landing page:
    image

Lightbox for block images

By default, images are constrained by the width of the article body. Users should have the ability to enlarge an image if they so choose. Our old UI has rudimentary lightbox library that allows the user to click an image to open a larger version in a lightbox. We should consider adding a similar feature to the new UI.

My preference would be to work with the Antora community on implementing Issue-140 (MR-126). Based on the conversation in the aforementioned merge request, it seems that there are still a few additional enhancements that need to be made.

NOTE: This enhancement is currently a dependency of #73. The lightbox library we choose should probably be used to power the interactive graphic in addition to the other images on the site.

Deep linking to individual tabs

There are several use-cases where we'd like to be able to deep link directly to a tab (or nested tab). For example, we'd like to be able to link directly to a particular client example (or even a nested tab within that client example).

image

For ease of use, the implementation should leverage the existing approach to creating anchors in AsciiDoc. There are a couple of open issues in the Asciidoctor Tabs project that appear to relate to this requirement:

We should do a holistic assessment of the technical requirements and determine whether certain parts of the implementation should depend on the extension itself rather than our own custom code. If we do our own custom implementation, there’s a chance that it might not play nice with future updates to the official extension (it’s still in beta, after all). If we determine that we are indeed dependent on upstream enhancements, we should probably open an issue in the Asciidoctor Tabs project (and/or comment on the existing issues noted above) to discuss our findings with the maintainers and potentially contribute the necessary enhancements.

New vector docs Leftnav accessibility: in light mode, some headings fail color contrast?

Hey guys, let me know what you find.

For our Leftnav, in Light node, If i'm checking the correct set of foreground text color & background color hex # values, I think certain headings fail WCAG accessibility requirements.

https://webaim.org/resources/contrastchecker/?fcolor=8E9093&bcolor=F7F7F7

Do I have the right values?

Please refer to the leftnav when viewed from a page like https://docs.datastax.com/en/astra/astra-db-vector/api-reference/data-api-commands.html#advanced-feature-indexing-clause-on-createcollection , and the attached screenshot. I tried to inspect the css colors but not sure if I've got the right values in that webaim comparison.

If we fail accessibility color contrast, it could be difficult for people who have low vision or who are color blind.

Screenshot 2024-02-01 at 11 34 18 AM

Hover-over popups

There are any number of reasons that hover-over popups would be a great addition to these docs. Popups for glossary terms, or additional explanation that would be cumbersome in the text. File pathnames, that sort of thing.

Have you considered adding that capability to the publishing?

TypeScript syntax highlighting issue

Reported by @toptobes:

Syntax highlighting breaks when you have an immediately-invoked function expression (IIFE) that's an arrow function:

image (9)

Works fine with old-school function expressions:

image (10)

All I can say is that when making an IIFE using an arrow function, it renders the body of it improperly (as shown in the first image), But for some reason, renders properly when you declare an interface before it (so I'd imagine it might work if you declare a class or type before it? Haven't tested it yet though.)

image (8)

Custom text formatting and code snippet placeholders

In the Google Developer Docs Style Guide, there are some recommendations for using enhanced text formatting for things like placeholders (both inline and in code blocks).

AsciiDoc provides pretty straightforward support for custom inline styles:

This command installs the dependencies listed in [.path]_package.json_ into the [.path]_node_modules/_ folder inside the project.

But code blocks are a bit trickier, and will likely require appropriate substitutions depending on whether we decide to use roles or HTML passthrough.

Investigate asset file fingerprinting

When we temporarily pulled the global nav after launching the unified site on new AWS infrastructure, some users experienced UI issues like the top part of the page being cut off:

Screen Shot 2024-05-07 at 11 13 23 AM

@mlr thinks this is likely the browser caching old styles, and that the usual way to mitigate this is asset file fingerprinting. However, we're not sure if that’s something Antora supports out of the box. We should investigate if asset file fingerprinting is a desirable and achievable solution to this problem, since we will be adding more rich UI experiences in the near future.

Make `cql` an alias for `sql` in highlight.js config

We currently set [source,cql] on code blocks containing CQL statements. However, since there is no CQL definition available for highlight.js, these code blocks have no syntax highlighting. (Note: we currently have issue #76 to develop a CQL definition ourselves.)

Until such time that a CQL definition becomes available, we should consider making cql an alias for the built-in sql definition in highlight.js. The languages are similar enough that if we applied SQL highlighting to CQL code blocks, the sacrifice in technical accuracy would probably be outweighed by the value users would gain by having at least rudimentary highlighting.

Manual controls to expand, collapse, and minimize the left nav

In the old UI, we provide manual controls for the following:

  • Minimize or expand the entire left nav (more important of the two behaviors)
  • Expand or collapse all nested items in the left nav

This feature was added at the request of a few internal users, and is something we should at least consider adding back to the new UI. The Astra Portal allows manual control to minimize/expand the left-nav, but the new docs UI only offers this control at smaller screen widths.

image

image

image

Improve in-page ToC

We should consider making some usability improvements to the in-page ToC (right-hand nav).

On width-constrained screens, we simply move the ToC to the top of the page. This means that if you land on a section in the middle of the page (either from xref or search) you won't even see the ToC, and using it requires you to scroll all the way back to the top. Also, since the ToC doesn't collapse, large ToCs take up a lot of real estate. We should consider better collapse behaviors that are more useful and take up less room.

We might also consider making visual improvements so that it's easier to identify which page section you're currently scrolling offer better support for third-level section headers.

Need better handling of long monospace strings

Long monospace strings can break certain elements. Below I've provided examples of how this can break tables and horizontal description lists, but there may be more cases that I haven't discovered yet.

Tables

image

Example AsciiDoc:

[cols="2,3"]
|===
| Metric | Description

| `astra_db_rate_limited_requests:rate1m` and `astra_db_rate_limited_requests:rate5m`
| A calculated rate of change for the number of failed operations due to an {astra_db} xref:databases:database-limits.adoc[rate limit].
Using these rates, alert if the value is greater than 0.

| `astra_db_read_requests_failures:rate1m` and `astra_db_read_requests_failures:rate5m`
| A calculated rate of change for the number of failed reads.
Cassandra drivers retry failed operations, but significant failures can be problematic.
Using these rates, alert if the value is greater than 0.
Warn alert on low amount.
High alert on larger amounts; determine potentially as a percentage of read throughput.

| `astra_db_read_requests_timeouts:rate1m` and `astra_db_read_requests_timeouts:rate5m`
| A calculated rate of change for read timeouts.
Timeouts happen when operations against the database take longer than the server side timeout.
Using these rates, alert if the value is greater than 0.

| `astra_db_read_requests_unavailables:rate1m` and `astra_db_read_requests_unavailables:rate5m`
| A calculated rate of change for reads where service is not available to complete a specific request.
Using these rates, alert if the value is greater than 0.

| `astra_db_write_requests_failures:rate1m` and `astra_db_write_requests_failures:rate5m`
| A calculated rate of change for the number of failed writes.
Cassandra drivers retry failed operations, but significant failures can be problematic.
Using these rates, alert if the value is greater than 0.
Warn alert on low amount.
High alert on larger amounts; determine potentially as a percentage of read throughput.

| `astra_db_write_requests_timeouts:rate1m` and `astra_db_write_requests_timeouts:rate5m`
| A calculated rate of change for timeouts, which occur when operations take longer than the server side timeout.
Using these rates, compare with write_requests_failures.

| `astra_db_write_requests_unavailables:rate1m` and `astra_db_write_requests_unavailables:rate5m`
| A calculated rate of change for unavailable errors, which occur when the service is not available to service a particular request.
Using these rates, compare with write_requests_failures.

| `astra_db_range_requests_failures:rate1m` and `astra_db_range_requests_failures:rate5m`
| A calculated rate of change for the number of range reads that failed.
Cassandra drivers retry failed operations, but significant failures can be problematic.
Using these rates, alert if the value is greater than 0.
Warn alert on low amount.
High alert on larger amounts; determine potentially as a percentage of read throughput.

| `astra_db_range_requests_timeouts:rate1m` and `astra_db_range_requests_timeouts:rate5m`
| A calculated rate of change for timeouts, which are a subset of total failures.
Use this metric to understand if failures are due to timeouts.
Using these rates, compare with range_requests_failures.

| `astra_db_range_requests_unavailables:rate1m` and `astra_db_range_requests_unavailables:rate5m`
| A calculated rate of change for unavailable errors, which are a subset of total failures.
Use this metric to understand if failures are due to timeouts.
Using these rates, compare with range_requests_failures.

| `astra_db_write_latency_seconds:rate1m` and `astra_db_write_latency_seconds:rate5m`
| A calculated rate of change for write throughput.
Alert based on your application Service Level Objective (business requirement).

| `astra_db_write_latency_seconds_P$QUANTILE:rate1m` and `astra_db_write_latency_seconds_P$QUANTILE:rate5m`
| A calculated rate of change for write latency, where $QUANTILE is a histogram quantile of 99, 95, 90, 75, or 50 (e.g. `astra_db_write_latency_seconds_P99:rate1m`).
Alert based on your application Service Level Objective (business requirement).

| `astra_db_write_requests_mutation_size_bytesP$QUANTILE:rate1m` and `astra_db_write_requests_mutation_size_bytesP$QUANTILE:rate5m`
| A calculated rate of change for how big writes are over time, where $QUANTILE is a histogram quantile of 99, 95, 90, 75, or 50.
For example, `astra_db_write_requests_mutation_size_bytesP99:rate5m`.

| `astra_db_read_latency_seconds:rate1m` and `astra_db_read_latency_seconds:rate5m`
| A calculated rate of change for read latency.
Alert based on your application Service Level Objective (business requirement).

| `astra_db_read_latency_secondsP$QUANTILE:rate1m` and `astra_db_read_latency_secondsP$QUANTILE:rate5m`
| A calculated rate of change read latency, where $QUANTILE is a histogram quantile of 99, 95, 90, 75, or 50. For example, `astra_db_read_latency_secondsP99:rate1m`.
Alert based on your application Service Level Objective (business requirement).

| `astra_db_range_latency_seconds:rate1m` and `astra_db_range_latency_seconds:rate5m`
| A calculated rate of change for range read throughput.
Alert based on your application Service Level Objective (business requirement).

| `astra_db_range_latency_secondsP$QUANTILE:rate1m` and `astra_db_range_latency_secondsP$QUANTILE:rate5m`
| A calculated rate of change of range read for latency, where $QUANTILE is a histogram quantile of 99, 95, 90, 75, or 50. For example, `astra_db_range_latency_secondsP99`.
Alert based on your application Service Level Objective (business requirement).
|===

Horizontal description lists

NOTE: You'll notice that monospace appears with incorrect formatting when in a description list. This is either the same or similar to one of the issues being fixed in #103.

image

Example AsciiDoc:

[horizontal]
`astra_db_rate_limited_requests:rate1m` and `astra_db_rate_limited_requests:rate5m`::
A calculated rate of change for the number of failed operations due to an {astra_db} xref:databases:database-limits.adoc[rate limit].
Using these rates, alert if the value is greater than 0.

`astra_db_read_requests_failures:rate1m` and `astra_db_read_requests_failures:rate5m`::
A calculated rate of change for the number of failed reads.
Cassandra drivers retry failed operations, but significant failures can be problematic.
Using these rates, alert if the value is greater than 0.
Warn alert on low amount.
High alert on larger amounts; determine potentially as a percentage of read throughput.

`astra_db_read_requests_timeouts:rate1m` and `astra_db_read_requests_timeouts:rate5m`::
A calculated rate of change for read timeouts.
Timeouts happen when operations against the database take longer than the server side timeout.
Using these rates, alert if the value is greater than 0.

`astra_db_read_requests_unavailables:rate1m` and `astra_db_read_requests_unavailables:rate5m`::
A calculated rate of change for reads where service is not available to complete a specific request.
Using these rates, alert if the value is greater than 0.

`astra_db_write_requests_failures:rate1m` and `astra_db_write_requests_failures:rate5m`::
A calculated rate of change for the number of failed writes.
Cassandra drivers retry failed operations, but significant failures can be problematic.
Using these rates, alert if the value is greater than 0.
Warn alert on low amount.
High alert on larger amounts; determine potentially as a percentage of read throughput.

`astra_db_write_requests_timeouts:rate1m` and `astra_db_write_requests_timeouts:rate5m`::
A calculated rate of change for timeouts, which occur when operations take longer than the server side timeout.
Using these rates, compare with write_requests_failures.

`astra_db_write_requests_unavailables:rate1m` and `astra_db_write_requests_unavailables:rate5m`::
A calculated rate of change for unavailable errors, which occur when the service is not available to service a particular request.
Using these rates, compare with write_requests_failures.

`astra_db_range_requests_failures:rate1m` and `astra_db_range_requests_failures:rate5m`::
A calculated rate of change for the number of range reads that failed.
Cassandra drivers retry failed operations, but significant failures can be problematic.
Using these rates, alert if the value is greater than 0.
Warn alert on low amount.
High alert on larger amounts; determine potentially as a percentage of read throughput.

`astra_db_range_requests_timeouts:rate1m` and `astra_db_range_requests_timeouts:rate5m`::
A calculated rate of change for timeouts, which are a subset of total failures.
Use this metric to understand if failures are due to timeouts.
Using these rates, compare with range_requests_failures.

`astra_db_range_requests_unavailables:rate1m` and `astra_db_range_requests_unavailables:rate5m`::
A calculated rate of change for unavailable errors, which are a subset of total failures.
Use this metric to understand if failures are due to timeouts.
Using these rates, compare with range_requests_failures.

`astra_db_write_latency_seconds:rate1m` and `astra_db_write_latency_seconds:rate5m`::
A calculated rate of change for write throughput.
Alert based on your application Service Level Objective (business requirement).

`astra_db_write_latency_seconds_P$QUANTILE:rate1m` and `astra_db_write_latency_seconds_P$QUANTILE:rate5m`::
A calculated rate of change for write latency, where $QUANTILE is a histogram quantile of 99, 95, 90, 75, or 50 (e.g. `astra_db_write_latency_seconds_P99:rate1m`).
Alert based on your application Service Level Objective (business requirement).

`astra_db_write_requests_mutation_size_bytesP$QUANTILE:rate1m` and `astra_db_write_requests_mutation_size_bytesP$QUANTILE:rate5m`::
A calculated rate of change for how big writes are over time, where $QUANTILE is a histogram quantile of 99, 95, 90, 75, or 50.
For example, `astra_db_write_requests_mutation_size_bytesP99:rate5m`.

`astra_db_read_latency_seconds:rate1m` and `astra_db_read_latency_seconds:rate5m`::
A calculated rate of change for read latency.
Alert based on your application Service Level Objective (business requirement).

`astra_db_read_latency_secondsP$QUANTILE:rate1m` and `astra_db_read_latency_secondsP$QUANTILE:rate5m`::
A calculated rate of change read latency, where $QUANTILE is a histogram quantile of 99, 95, 90, 75, or 50. For example, `astra_db_read_latency_secondsP99:rate1m`.
Alert based on your application Service Level Objective (business requirement).

`astra_db_range_latency_seconds:rate1m` and `astra_db_range_latency_seconds:rate5m`::
A calculated rate of change for range read throughput.
Alert based on your application Service Level Objective (business requirement).

`astra_db_range_latency_secondsP$QUANTILE:rate1m` and `astra_db_range_latency_secondsP$QUANTILE:rate5m`::
A calculated rate of change of range read for latency, where $QUANTILE is a histogram quantile of 99, 95, 90, 75, or 50. For example, `astra_db_range_latency_secondsP99`.
Alert based on your application Service Level Objective (business requirement).

Admonitions don't scale down properly in tables

We generally scale down all elements within a table (e.g. smaller font/symbol size) to mitigate the inherent space constraints. However, admonitions (and their contents) don't appear to follow the same scaling factor, and seem to render just as they do when outside of a table. See the complex table example in the UI preview: https://riptano.github.io/docs-ui/main/asciidoc/tables.html#complex-table-w-asciidoc-content

IMO we should probably scale down at least the content of an admonition when it appears in a table. But perhaps we should scale down other aspects like the label/symbol and the top color bar.

image

Expand/collapse functionality for sub-headings in the left nav

Headings in the left nav have expand/collapse functionality and default to collapsed state on page load. Sub-headings should behave the same way. However, currently, you can't expand/collapse sub-headings at all, and they default to open.

For example, see the sub-headings in the Databases section:

Screen Shot 2024-01-16 at 7 02 35 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.