Skip to content

Commit

Permalink
Add node-only labels to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Apr 10, 2023
1 parent 16d214a commit 299d647
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
---
label: "File Loaders"
hide_table_of_contents: true
sidebar_class_name: node-only-category
---

# File Loaders

:::tip Compatibility
Only available on Node.js.
:::

These loaders are used to load files either given a file path or a Blob object.

import DocCardList from "@theme/DocCardList";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
sidebar_position: 1
sidebar_label: Cheerio
hide_table_of_contents: true
---

# Webpages, with Cheerio

This example goes over how to load data from webpages using Cheerio. One document will be created for each webpage.

Cheerio is a fast and lightweight library that allows you to parse and traverse HTML documents using a jQuery-like syntax. You can use Cheerio in Node.js to extract data from web pages, without having to render them in a browser.
Cheerio is a fast and lightweight library that allows you to parse and traverse HTML documents using a jQuery-like syntax. You can use Cheerio to extract data from web pages, without having to render them in a browser.

However, Cheerio does not simulate a web browser, so it cannot execute JavaScript code on the page. This means that it cannot extract data from dynamic web pages that require JavaScript to render. To do that, you can use the [PuppeteerWebBaseLoader](./web_puppeteer.md) instead.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
---
sidebar_position: 2
sidebar_label: Puppeteer
hide_table_of_contents: true
sidebar_class_name: node-only
---

# Webpages, with Puppeteer

:::tip Compatibility
Only available on Node.js.
:::

This example goes over how to load data from webpages using Puppeteer. One document will be created for each webpage.

Puppeteer is a Node.js library that provides a high-level API for controlling headless Chrome or Chromium. You can use Puppeteer to automate web page interactions, including extracting data from dynamic web pages that require JavaScript to render.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
---
sidebar_class_name: node-only
---

import CodeBlock from "@theme/CodeBlock";

# HNSWLib

:::tip Compatibility
Only available on Node.js.
:::

HNSWLib is an in-memory vectorstore that can be saved to a file. It uses [HNSWLib](https://github.com/nmslib/hnswlib).

## Setup
Expand Down
34 changes: 33 additions & 1 deletion docs/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,36 @@

.footer__copyright {
opacity: 0.6;
}
}

.node-only {
position: relative;
}

.node-only::after {
position: absolute;
right: 0.2rem;
top: 3px;
content: "Node.js";
background: #026e00;
color: #fff;
border-radius: 0.25rem;
padding: 0 0.5rem;
pointer-events: none;
}

.node-only-category {
position: relative;
}

.node-only-category::after {
position: absolute;
right: 2.9rem;
top: 3px;
content: "Node.js";
background: #026e00;
color: #fff;
border-radius: 0.25rem;
padding: 0 0.5rem;
pointer-events: none;
}

0 comments on commit 299d647

Please sign in to comment.