Skip to content

Commit 423bbb3

Browse files
committed
Add pdoc
Signed-off-by: Andrew Stein <steinlink@gmail.com>
1 parent c603ab7 commit 423bbb3

25 files changed

Lines changed: 488 additions & 153 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ vcpkg
6060
venv/
6161
rust/perspective-python/perspective_python-*.data
6262
.pytest-cache/
63+
docs/static/python
64+

docs/docusaurus.config.js

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ const examples = fs.readdirSync("static/blocks").map((ex) => {
3939
};
4040
});
4141

42+
function link(title, path) {
43+
return `<a class="dropdown__link" href="${path}"> ${title}</a>`;
44+
}
45+
4246
/** @type {import('@docusaurus/types').Config} */
4347
const config = {
4448
title: "Perspective",
@@ -119,20 +123,73 @@ const config = {
119123
label: "Docs",
120124
items: [
121125
{
122-
href: "/guide/",
123-
label: "User Guide",
126+
type: "html",
127+
value: `<a class="dropdown__link" style="font-size:16px;padding:0.25rem 0rem" href="/guide/">User Guide</a>`,
128+
},
129+
{
130+
type: "html",
131+
value: '<span style="user-select:none">Python API</span>',
132+
},
133+
{
134+
type: "html",
135+
value: `<a class="dropdown__link" href="/python/"><code>perspective</code></a>`,
136+
},
137+
{
138+
type: "html",
139+
value: `<a class="dropdown__link" href="/python/perspective/widget.html"><code>perspective.widget</code></a>`,
140+
},
141+
{
142+
type: "html",
143+
value: `<a class="dropdown__link" href="/python/perspective/handlers/aiohttp.html"><code>perspective.handlers.aiohttp</code></a>`,
144+
},
145+
{
146+
type: "html",
147+
value: `<a class="dropdown__link" href="/python/perspective/handlers/starlette.html"><code>perspective.handlers.starlette</code></a>`,
148+
},
149+
{
150+
type: "html",
151+
value: `<a class="dropdown__link" href="/python/perspective/handlers/tornado.html"><code>perspective.handlers.tornado</code></a>`,
152+
},
153+
{
154+
type: "html",
155+
value: '<span style="user-select:none">JavaScript API</span>',
156+
},
157+
{
158+
type: "html",
159+
value: link(
160+
"<code>@finos/perspective-viewer</code>",
161+
"/viewer/modules/perspective-viewer.html"
162+
),
163+
},
164+
{
165+
type: "html",
166+
value: link(
167+
"<code>@finos/perspective</code> Browser",
168+
"/browser/modules/src_ts_perspective.browser.ts.html"
169+
),
170+
},
171+
{
172+
type: "html",
173+
value: link(
174+
"<code>@finos/perspective</code> Node.js",
175+
"/node/modules/src_ts_perspective.node.ts.html"
176+
),
177+
},
178+
{
179+
type: "html",
180+
value: '<span style="user-select:none">Rust API</span>',
124181
},
125182
{
126183
type: "html",
127-
value: `<a class="dropdown__link" href="https://docs.rs/perspective-js/latest/perspective_js/"><code>@finos/perspective</code> JavaScript API</a>`,
184+
value: `<a class="dropdown__link" href="https://docs.rs/perspective-js/latest/perspective_js/"><code>perspective-js</code></a>`,
128185
},
129186
{
130187
type: "html",
131-
value: `<a class="dropdown__link" href="https://docs.rs/perspective-python/latest/perspective_python/"><code>perspective-python</code> Python API</a>`,
188+
value: `<a class="dropdown__link" href="https://docs.rs/perspective-python/latest/perspective_python/"><code>perspective-python</code></a>`,
132189
},
133190
{
134191
type: "html",
135-
value: `<a class="dropdown__link" href="https://docs.rs/perspective/latest/perspective/"><code>perspective</code> Rust API</a>`,
192+
value: `<a class="dropdown__link" href="https://docs.rs/perspective/latest/perspective/"><code>perspective</code></a>`,
136193
},
137194
],
138195
},

examples/webpack-example/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232
},
3333
{
3434
test: /(perspective\-server\.wasm|perspective\-viewer\.wasm)$/,
35-
type: "asset/resource"
35+
type: "asset/resource",
3636
},
3737
{
3838
test: /\.arrow$/,

rust/perspective-client/src/rust/client.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ mod name_registry {
120120
pub type ReconnectCallback =
121121
Arc<dyn Fn() -> LocalBoxFuture<'static, Result<(), Box<dyn Error>>> + Send + Sync>;
122122

123-
/// An instance of a [`Client`] is a unique connection to a single
123+
/// An instance of a [`Client`] is a connection to a single
124124
/// `perspective_server::Server`, whether locally in-memory or remote over some
125125
/// transport like a WebSocket.
126126
///
@@ -411,6 +411,7 @@ impl Client {
411411
/// - CSV
412412
/// - JSON row-oriented
413413
/// - JSON column-oriented
414+
/// - NDJSON
414415
///
415416
/// When instantiated with _data_, the schema is inferred from this data.
416417
/// While this is convenient, inferrence is sometimes imperfect e.g.

rust/perspective-client/src/rust/session.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ type ProxyCallbackError = Box<dyn StdError + Send + Sync>;
5454
type ProxyCallback = Arc<dyn Fn(&[u8]) -> Result<(), ProxyCallbackError> + Send + Sync>;
5555

5656
/// A [`Session`] implementation which tunnels through another [`Client`].
57+
/// @private
5758
#[derive(Clone)]
5859
pub struct ProxySession {
5960
parent: Client,

rust/perspective-client/src/rust/table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl Table {
211211
/// ..default()
212212
/// };
213213
/// let table = client.table("x,y\n1,2\n3,4", options).await;
214-
/// let tables = client.open_table("table_one").await;
214+
/// let index = table.get_index()
215215
/// ```
216216
pub fn get_index(&self) -> Option<String> {
217217
self.options.index.as_ref().map(|index| index.to_owned())

rust/perspective-client/src/rust/view.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ impl View {
262262
}
263263
}
264264

265-
/// A copy of the config object passed to the [`Table::view`] method which
266-
/// created this [`View`].
265+
/// A copy of the [`ViewConfig`] object passed to the [`Table::view`] method
266+
/// which created this [`View`].
267267
pub async fn get_config(&self) -> ClientResult<crate::config::ViewConfig> {
268268
let msg = self.client_message(ClientReq::ViewGetConfigReq(ViewGetConfigReq {}));
269269
match self.client.oneshot(&msg).await? {

rust/perspective-js/src/rust/client.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl ProxySession {
7777
}
7878
}
7979

80-
/// An instance of a [`Client`] is a unique connection to a single
80+
/// An instance of a [`Client`] is a connection to a single
8181
/// `perspective_server::Server`, whether locally in-memory or remote over some
8282
/// transport like a WebSocket.
8383
///
@@ -299,6 +299,7 @@ impl Client {
299299
/// - CSV
300300
/// - JSON row-oriented
301301
/// - JSON column-oriented
302+
/// - NDJSON
302303
///
303304
/// When instantiated with _data_, the schema is inferred from this data.
304305
/// While this is convenient, inferrence is sometimes imperfect e.g.

rust/perspective-js/src/rust/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
clippy::all,
1919
clippy::panic_in_result_fn,
2020
clippy::await_holding_refcell_ref,
21+
rustdoc::broken_intra_doc_links,
2122
unstable_features
2223
)]
2324
#![allow(non_snake_case)]

rust/perspective-js/src/rust/table.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ impl Table {
245245
}
246246

247247
/// Replace all rows in this [`Table`] with the input data, coerced to this
248-
/// [`Table`]'s existing [`Schema`], notifying any derived [`View`] and
249-
/// [`View::on_update`] callbacks.
248+
/// [`Table`]'s existing [`perspective_client::Schema`], notifying any
249+
/// derived [`View`] and [`View::on_update`] callbacks.
250250
///
251251
/// Calling [`Table::replace`] is an easy way to replace _all_ the data in a
252252
/// [`Table`] without losing any derived [`View`] instances or

0 commit comments

Comments
 (0)