Skip to content

Commit d8dfb29

Browse files
Decouple docs from DataStax docs site (#661)
1 parent 4c4167d commit d8dfb29

33 files changed

Lines changed: 187 additions & 5533 deletions

docs/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/*

docs/README.adoc

Lines changed: 14 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,158 +1,34 @@
1-
= {product} Docs
1+
= {product} documentation
22
// Variables:
33
:product: RAGStack
4-
:repo-name: ragstack-ai
5-
:github-org: datastax
64
// Settings:
75
:toc: macro
6+
:idprefix:
7+
:idseparator: -
88
:!example-caption:
99
:experimental:
1010
:hide-uri-scheme:
11+
ifndef::env-github[:icons: font]
1112
ifdef::env-github[]
12-
:icons: font
13-
:toclevels: 1
14-
:toc-title: Contents
13+
:toclevels: 2
1514
:tip-caption: :bulb:
16-
:note-caption: :information_source:
15+
:note-caption: :paperclip:
1716
:important-caption: :heavy_exclamation_mark:
1817
:caution-caption: :fire:
1918
:warning-caption: :warning:
2019
:badges:
2120
endif::[]
22-
// Project URLs:
23-
:url-github-org: https://github.com/{github-org}
24-
:url-project-repo: {url-github-org}/{repo-name}
25-
:url-ui-repo: https://github.com/riptano/docs-ui
26-
:url-playbook-repo: https://github.com/riptano/datastax-docs-site
27-
:url-contribute:
28-
:url-datastax: https://datastax.com
29-
:url-datastax-docs: https://docs.datastax.com
30-
:url-docs-preview: http://docs-preview.datastax.com
3121
// External URLs:
32-
:asciidoc-language: https://docs.asciidoctor.org/asciidoc/latest/
22+
:url-asciidoc-lang: https://docs.asciidoctor.org/asciidoc/latest/
23+
:url-antora-docs: https://docs.antora.org/antora/latest/
3324

34-
This repository contains the source files for the {product} documentation.
3525

36-
toc::[]
26+
The {product} documentation is written in https://docs.asciidoctor.org/asciidoc/latest/[AsciiDoc].
27+
The source files in the `link:modules/[]` folder are organized into a documentation component as identified by the `link:antora.yml[]` file.
3728

38-
== Get started
29+
== Build the docs
3930

40-
The documentation is written in {asciidoc-language}[AsciiDoc]-formatted source files located in the `modules` directory.
31+
You can use https://antora.org/[Antora] to build a static HTML version of the documentation.
4132

42-
=== Make a simple update
43-
44-
For simple updates like fixing typos or modifying existing prose, it's easiest to edit the source files directly on GitHub.
45-
46-
NOTE: You'll need Write privileges on the repository to edit files directly on GitHub.
47-
48-
. Find the file you want to edit in the `modules` directory.
49-
50-
. Click the *Edit* icon in the upper-right corner of the file view.
51-
52-
. Make your changes in the editor.
53-
54-
. Click *Commit changes...*
55-
56-
. Enter a description for your commit and click *Propose changes*.
57-
58-
. On the *Open a pull request* screen, enter a title and description for your change, assign reviewers, then click *Create pull request*.
59-
60-
. Once the pull request is open, an automatic draft preview build is triggered.
61-
Once complete, the build system posts a comment on the pull request with a link to the draft site for you to preview your changes.
62-
63-
=== Edit docs locally
64-
65-
If you need to make substantial updates to the documentation, you'll want to clone the repository so you can work with the source files locally.
66-
67-
. Clone this repository
68-
+
69-
[source,bash,subs="attributes"]
70-
----
71-
git clone {url-project-repo}.git
72-
----
73-
74-
. https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic[Create a _classic_ personal access token] for your GitHub account.
75-
When configuring the token, set the *Expiration* to at least 90 days and select everything under the *Repo* https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes[scope].
76-
+
77-
[IMPORTANT]
78-
====
79-
Copy your personal access token to a temporary location -- you'll need it later.
80-
====
81-
82-
. https://docs.github.com/en/enterprise-cloud@latest/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on[Authorize your personal access token] so that it can access repositories in the Riptano and DataStax organizations in GitHub.
83-
84-
. https://docs.antora.org/antora/latest/playbook/private-repository-auth/#populate-credentials-directly[Populate the credential store] with your personal access token.
85-
For most people this means doing the following:
86-
+
87-
.. Create the file `$HOME/.git-credentials` and open it in your editor.
88-
.. Add the following line:
89-
+
90-
[source,subs="verbatim,quotes"]
91-
----
92-
https://**TOKEN**:@github.com
93-
----
94-
+
95-
Replace *`TOKEN`* with the personal access token you copied from GitHub.
96-
.. Save and close the file.
97-
98-
. If you don't already have Node.js installed, do the following:
99-
100-
.. Install https://github.com/nvm-sh/nvm[nvm].
101-
+
102-
If you're on macOS, you can install nvm using https://brew.sh/[Homebrew]:
103-
+
104-
[source,bash]
105-
----
106-
brew install nvm
107-
----
108-
109-
.. Use nvm to install Node.js.
110-
+
111-
[source,bash]
112-
----
113-
nvm install --lts
114-
----
115-
+
116-
[source,bash]
117-
----
118-
nvm use --lts
119-
----
120-
+
121-
[source,bash]
122-
----
123-
nvm alias default node
124-
----
125-
126-
. Install the project dependencies.
127-
+
128-
[source,bash,subs="attributes"]
129-
----
130-
cd {repo-name}
131-
----
132-
+
133-
[source,bash]
134-
----
135-
npm install
136-
----
137-
138-
. Build the site.
139-
+
140-
[source,bash]
141-
----
142-
npm run build:local
143-
----
144-
+
145-
If the build was successful, you'll see the following output in your terminal:
146-
+
147-
[source,console,subs="attributes"]
148-
----
149-
Site generation complete!
150-
Open file:///Users/USERNAME/repos/{repo-name}/build/site/index.html in a browser to view your site.
151-
----
152-
+
153-
To view the site, paste the entire `\file:///` path into your browser's address bar and press kbd:[Return].
154-
155-
[#publish-docs]
156-
== Publish docs
157-
158-
To learn how to publish documentation to {url-datastax-docs}, see the {url-playbook-repo}#deploy-production[datastax-docs-site README].
33+
To build and preview the documentation locally, follow the instructions in the file link:local-antora-playbook.yml[] at the root of this repository.
34+
To learn more about how to build a documentation site with Antora, see the https://docs.antora.org/antora/latest/install-and-run-quickstart/[Install and Run Antora Quickstart].
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module.exports.register = function ({ config }) {
2+
const { addToNavigation, unlistedPagesHeading = 'Unlisted Pages' } = config
3+
const logger = this.getLogger('unlisted-pages-extension')
4+
this
5+
.on('navigationBuilt', ({ contentCatalog }) => {
6+
contentCatalog.getComponents().forEach(({ versions }) => {
7+
versions.forEach(({ name: component, version, navigation: nav, url: defaultUrl }) => {
8+
const navEntriesByUrl = getNavEntriesByUrl(nav)
9+
const unlistedPages = contentCatalog
10+
.findBy({ component, version, family: 'page' })
11+
.filter((page) => page.out)
12+
.reduce((collector, page) => {
13+
if ((page.pub.url in navEntriesByUrl) || page.pub.url === defaultUrl) return collector
14+
logger.warn({ file: page.src, source: page.src.origin }, 'detected unlisted page')
15+
return collector.concat(page)
16+
}, [])
17+
if (unlistedPages.length && addToNavigation) {
18+
nav.push({
19+
content: unlistedPagesHeading,
20+
items: unlistedPages.map((page) => {
21+
const title = 'navtitle' in page.asciidoc
22+
? page.asciidoc.navtitle
23+
: (page.src.module === 'ROOT' ? '' : page.src.module + ':') + page.src.relative
24+
return { content: title, url: page.pub.url, urlType: 'internal' }
25+
}),
26+
root: true,
27+
})
28+
}
29+
})
30+
})
31+
})
32+
}
33+
34+
function getNavEntriesByUrl (items = [], accum = {}) {
35+
items.forEach((item) => {
36+
if (item.urlType === 'internal') accum[item.url.split('#')[0]] = item
37+
getNavEntriesByUrl(item.items, accum)
38+
})
39+
return accum
40+
}

docs/antora.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ title: 'RAGStack'
44
start_page: ROOT:index.adoc
55
asciidoc:
66
attributes:
7-
company: 'DataStax'
7+
datastax: 'DataStax'
88
product: 'RAGStack'
9-
db-cassandra: 'Astra DB Serverless (Non-Vector)'
10-
db-vector: 'Astra DB Serverless'
119
db-serverless: 'Astra DB Serverless'
10+
astra-db: 'Astra DB'
1211
astra-ui: 'Astra Portal'
13-
graph-store: 'Graph Store'
1412
nav:
1513
- modules/ROOT/nav.adoc

docs/extensions/assets-processor.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)