Skip to content

Commit 1c7a120

Browse files
rafapaezbasrafapaezbas
andauthored
Custom header anchors (#82)
* generate custom header anchors * implemented anchor navigation * fixed scroll to bottom anchors --------- Co-authored-by: rafapaezbas <[email protected]>
1 parent dc7a025 commit 1c7a120

File tree

11 files changed

+426
-389
lines changed

11 files changed

+426
-389
lines changed

building-blocks/autobase.md

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,32 @@ Notable features include:
1717
- [Create a new instance](autobase.md#installation)
1818
- Basic:
1919
- Properties:
20-
- [base.inputs](autobase.md#baseinputs)
21-
- [base.outputs](autobase.md#baseoutputs)
22-
- [base.localInput](autobase.md#baselocalinput)
23-
- [base.localOutput](autobase.md#baselocaloutput)
20+
- [base.inputs](autobase.md#base.inputs)
21+
- [base.outputs](autobase.md#base.outputs)
22+
- [base.localInput](autobase.md#base.localinput)
23+
- [base.localOutput](autobase.md#base.localoutput)
2424
- Methods:
25-
- [base.clock()](autobase.md#const-clock--baseclock)
26-
- [base.isAutobase(core)](autobase.md#await-autobaseisautobasecore)
27-
- [base.append(value, [clock], [input])](autobase.md#await-baseappendvalue-clock-input)
28-
- [base.latest([input1, input2, ...])](autobase.md#const-clock--await-baselatestinput1-input2)
29-
- [base.addInput(input)](autobase.md#await-baseaddinputinput)
30-
- [base.removeInput(input)](autobase.md#await-baseremoveinputinput)
31-
- [base.addOutput(output)](autobase.md#await-baseaddoutputoutput)
32-
- [base.removeOutput(output)](autobase.md#await-baseremoveoutputoutput)
25+
- [base.clock()](autobase.md#base.clock)
26+
- [base.isAutobase(core)](autobase.md#base.isautobase)
27+
- [base.append(value, [clock], [input])](autobase.md#base.append)
28+
- [base.latest([input1, input2, ...])](autobase.md#base.latest)
29+
- [base.addInput(input)](autobase.md#base.addinput)
30+
- [base.removeInput(input)](autobase.md#base.removeinput)
31+
- [base.addOutput(output)](autobase.md#base.addoutput)
32+
- [base.removeOutput(output)](autobase.md#base.removeoutput)
3333
- Streams:
3434
- Methods:
35-
- [base.createCausalStream()](autobase.md#const-stream--basecreatecausalstream)
36-
- [base.createReadStream([options])](autobase.md#const-stream--basecreatereadstreamoptions)
35+
- [base.createCausalStream()](autobase.md#base.createcasualstream)
36+
- [base.createReadStream([options])](autobase.md#base.createreadstream)
3737
- Linearized Views:
3838
- Properties:
39-
- [view.status](autobase.md#viewstatus)
40-
- [view.length](autobase.md#viewlength)
39+
- [view.status](autobase.md#view.status)
40+
- [view.length](autobase.md#view.length)
4141
- Methods:
42-
- [base.start({ apply, unwrap } = {})](autobase.md#basestart-apply-unwrap)
43-
- [view.update()](autobase.md#await-viewupdate)
44-
- [view.get(idx, [options])](autobase.md#const-entry--await-viewgetidx-options)
45-
- [view.append([blocks])](autobase.md#await-viewappendblocks)
42+
- [base.start({ apply, unwrap } = {})](autobase.md#base.start)
43+
- [view.update()](autobase.md#view.update)
44+
- [view.get(idx, [options])](autobase.md#view.get)
45+
- [view.append([blocks])](autobase.md#view.append)
4646

4747

4848
### Installation
@@ -76,23 +76,23 @@ The following table describes the properties of the optional `options` object.
7676

7777
#### Properties
7878

79-
#### **`base.inputs`**
79+
#### **`base.inputs`** {#base.inputs}
8080

8181
The list of input Hypercores.
8282

83-
#### **`base.outputs`**
83+
#### **`base.outputs`** {#base.outputs}
8484

8585
The list of output Hypercores containing persisted linearized views.
8686

87-
#### **`base.localInput`**
87+
#### **`base.localInput`** {#base.localInput}
8888

89-
If non-null, this Hypercore will be appended to in [base.append](autobase.md#await-baseappendvalue-clock-input) operations.
89+
If non-null, this Hypercore will be appended to in [base.append](autobase.md#base.append) operations.
9090

91-
#### **`base.localOutput`**
91+
#### **`base.localOutput`** {#base.localoutput}
9292

9393
If non-null `base.view` will be persisted into this Hypercore.
9494

95-
#### **`base.started`**
95+
#### **`base.started`** {#base.started}
9696

9797
A Boolean indicating if `base.view` has been created.
9898

@@ -103,23 +103,23 @@ See the [linearized views section](autobase.md#linearized-views) for details abo
103103

104104
#### Methods
105105

106-
#### **`const clock = base.clock()`**
106+
#### **`const clock = base.clock()`** {#base.clock}
107107

108108
Returns a Map containing the latest lengths for all Autobase inputs.
109109

110110
The Map has the form: `(hex-encoded-key) -> (Hypercore length)`
111111

112-
#### **`await Autobase.isAutobase(core)`**
112+
#### **`await Autobase.isAutobase(core)`** {#base.isautobase}
113113

114114
Returns `true` if `core` is an Autobase input or an output.
115115

116-
#### **`await base.append(value, [clock], [input])`**
116+
#### **`await base.append(value, [clock], [input])`** {#base.append}
117117

118118
Append a new value to the autobase.
119119

120120
* `clock`: The causal clock defaults to base.latest.
121121

122-
#### **`const clock = await base.latest([input1, input2, ...])`**
122+
#### **`const clock = await base.latest([input1, input2, ...])`** {#base.latest}
123123

124124
Generate a causal clock linking the latest entries of each input.
125125

@@ -131,13 +131,13 @@ This is unlikely to be needed generally, prefer to use [`append`](autobase.md#aw
131131
await base.append('hello world')
132132
```
133133

134-
#### **`await base.addInput(input)`**
134+
#### **`await base.addInput(input)`** {#base.addinput}
135135

136136
Adds a new input Hypercore.
137137

138138
* `input` must either be a fresh Hypercore, or a Hypercore that has previously been used as an Autobase input.
139139

140-
#### **`await base.removeInput(input)`**
140+
#### **`await base.removeInput(input)`** {#base.removeinput}
141141

142142
Removes an input Hypercore.
143143

@@ -149,15 +149,15 @@ Removing an input, and then subsequently linearizing the Autobase into an existi
149149
Future releases will see the addition of 'soft removal', which will freeze an input at a specific length, and no process blocks past that length, while still preserving that input's history in linearized views. For most applications, soft removal matches the intuition behind 'removing a user'.
150150
{% endhint %}
151151

152-
#### **`await base.addOutput(output)`**
152+
#### **`await base.addOutput(output)`** {#base.addoutput}
153153

154154
Adds a new output Hypercore.
155155

156156
* `output` must be either a fresh Hypercore or a Hypercore that was previously used as an Autobase output.
157157

158158
If `base.outputs` is not empty, Autobase will do 'remote linearizing': `base.view.update()` will treat these outputs as the 'trunk', minimizing the amount of local re-processing they need to do during updates.
159159

160-
#### **`await base.removeOutput(output)`**
160+
#### **`await base.removeOutput(output)`** {#base.removeoutput}
161161

162162
Removes an output Hypercore. `output` can be either a Hypercore or a Hypercore key.
163163

@@ -179,7 +179,7 @@ They should fail in the presence of unavailable nodes -- the deterministic order
179179

180180
The simplest kind of linearized view (`const view = base.linearize()`), is just a Hypercore containing the results of a causal stream in reversed order (block N in the index will not be causally dependent on block N+1).
181181

182-
#### **`const stream = base.createCausalStream()`**
182+
#### **`const stream = base.createCausalStream()`** {#base.createcasualstream}
183183

184184
Generate a Readable stream of input blocks with deterministic, causal ordering.
185185

@@ -191,7 +191,7 @@ If an input node is causally-dependent on another node that is not available, th
191191

192192
Similar to `Hypercore.createReadStream()`, this stream starts at the beginning of each input, and does not guarantee the same deterministic ordering as the causal stream. Unlike causal streams, which are used mainly for indexing, read streams can be used to observe updates. And as they move forward in time, they can be live.
193193

194-
#### **`const stream = base.createReadStream([options])`**
194+
#### **`const stream = base.createReadStream([options])`** {#base.createreadstream}
195195

196196
Generate a Readable stream of input blocks, from earliest to latest.
197197

@@ -256,7 +256,7 @@ console.log(base.view.length)
256256

257257
#### View Creation
258258

259-
#### **`base.start({ apply, unwrap } = {})`**
259+
#### **`base.start({ apply, unwrap } = {})`** {#base.start}
260260

261261
Creates a new linearized view, and sets it on `base.view`. The view mirrors the Hypercore API wherever possible, meaning it can be used as a drop-in replacement for a Hypercore instance.
262262

@@ -271,7 +271,7 @@ When calling `base.start` manually, it must only be called once.
271271
| **`unwrap`** | Set this to auto unwrap the gets to only return .value | Boolean | `false` |
272272
| **`apply`** | The apply function described above | Function | `(batch) => {}` |
273273

274-
#### **`view.status`**
274+
#### **`view.status`** {#view.status}
275275

276276
The status of the last linearize operation.
277277

@@ -280,15 +280,15 @@ Returns an object of the form `{ added: N, removed: M }` where:
280280
* `added` indicates how many nodes were appended to the output during the linearization
281281
* `removed` indicates how many nodes were truncated from the output during the linearization
282282

283-
#### **`view.length`**
283+
#### **`view.length`** {#view.length}
284284

285285
The length of the view. Similar to `hypercore.length`.
286286

287-
#### **`await view.update()`**
287+
#### **`await view.update()`** {#view.update}
288288

289289
Ensures the view is up-to-date.
290290

291-
#### **`const entry = await view.get(idx, [options])`**
291+
#### **`const entry = await view.get(idx, [options])`** {#view.get}
292292

293293
Gets an entry from the view. If set `unwrap` to true, it returns `entry.value`. Otherwise, it returns an entry similar to this:
294294

@@ -299,6 +299,6 @@ Gets an entry from the view. If set `unwrap` to true, it returns `entry.value`.
299299
}
300300
```
301301

302-
#### **`await view.append([blocks])`**
302+
#### **`await view.append([blocks])`** {#view.append}
303303

304304
This operation can only be performed inside the `apply` function.

0 commit comments

Comments
 (0)