Skip to content

Commit 2b4e603

Browse files
push the step changes (#28)
1 parent cfe8cfb commit 2b4e603

File tree

3 files changed

+32
-15
lines changed

3 files changed

+32
-15
lines changed

preview-src/examples/quickstart.adoc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ image::ROOT:template-examples/quickstart-overview.png["Tutorial overview"]
1919

2020
To get started, ensure you have an {astra-link}[active Astra account] with the requisite permissions.
2121

22-
=== [.step]#1# Install the Python SDK and open a Python REPL.
22+
[.step]
23+
=== Install the Python SDK and open a Python REPL.
2324

2425
[source,shell]
2526
----
@@ -36,7 +37,8 @@ python
3637
Additional clients, such as {astra-nodejs-link}[Node.js] and {astra-json-link}[JSON API], are available.
3738
====
3839

39-
=== [.step]#2# Connect to Astra and create a database.
40+
[.step]
41+
=== Connect to Astra and create a database.
4042

4143
[source,python]
4244
----
@@ -60,7 +62,8 @@ db.create_table(table_name)
6062

6163
== Core steps
6264

63-
=== [.step]#3# Prepare and ingest data.
65+
[.step]
66+
=== Prepare and ingest data.
6467

6568
[source,python]
6669
----
@@ -74,7 +77,8 @@ for data in sample_vectors:
7477
db.insert_record(table_name, data)
7578
----
7679

77-
=== [.step]#4# Perform a similarity search.
80+
[.step]
81+
=== Perform a similarity search.
7882

7983
[source,python]
8084
----
@@ -83,7 +87,8 @@ query_vector = [0.2, 0.3, 0.4]
8387
results = db.similarity_search(table_name, query_vector, k=5)
8488
----
8589

86-
=== [.step]#5# Show the results.
90+
[.step]
91+
=== Show the results.
8792

8893
[source,python]
8994
----
@@ -94,7 +99,8 @@ for result in results:
9499

95100
== Cleanup
96101

97-
=== [.step]#6# Delete all resources.
102+
[.step.step-reset]
103+
=== Delete all resources.
98104

99105
[source,python]
100106
----

src/css/doc.css

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
padding-right: calc(24 / var(--rem-base) * 1rem);
99
padding-left: calc(24 / var(--rem-base) * 1rem);
1010
padding-bottom: var(--ds-space-10);
11+
counter-reset: step;
1112
}
1213

1314
@media screen and (min-width: 1024px) {
@@ -995,8 +996,24 @@
995996
padding: 0.25rem 0;
996997
}
997998

998-
.doc .conum[data-value],
999-
.doc .step {
999+
.step-reset {
1000+
counter-reset: step;
1001+
}
1002+
1003+
.doc .step h2::before,
1004+
.doc .step h3::before,
1005+
.doc .step h4::before {
1006+
counter-increment: step;
1007+
content: counter(step) ". ";
1008+
}
1009+
1010+
.doc .step h2 .anchor,
1011+
.doc .step h3 .anchor,
1012+
.doc .step h4 .anchor {
1013+
margin-left: -4.25ex;
1014+
}
1015+
1016+
.doc .conum[data-value] {
10001017
@include text-overline;
10011018

10021019
color: var(--ds-text-inverse);
@@ -1020,12 +1037,6 @@
10201037
display: none;
10211038
}
10221039

1023-
.doc .step {
1024-
position: relative;
1025-
top: -0.25em;
1026-
margin-right: var(--ds-space-q);
1027-
}
1028-
10291040
.doc hr {
10301041
border: solid var(--section-divider-color);
10311042
border-width: 2px 0 0;

src/helpers/stepcount.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

33
module.exports = (html) => {
4-
const matches = html.toString().match(/class="step"/g)
4+
const matches = html.toString().match(/class(?=="((.*?\s)?step(\s.*?)?)")/g)
55
if (!matches) return undefined
66
return matches.length
77
}

0 commit comments

Comments
 (0)