Skip to content

Commit

Permalink
Improved exports and API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
karelklima committed Jan 7, 2024
1 parent ae0e7a1 commit c043fae
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/basic/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const PersonSchema = {
// Create a resource using the data schema and context above
const Persons = createLens(PersonSchema, options);

// List all persons
// List some persons
const persons = await Persons.find({ take: 10 });
for (const person of persons) {
console.log(person.name); // string
Expand Down
1 change: 0 additions & 1 deletion mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export type {
SchemaSearchInterface,
SchemaUpdateInterface,
SupportedDataTypes,
SupportedNativeTypes,
} from "./library/schema/mod.ts";

export * from "./library/lens/mod.ts";
Expand Down
7 changes: 1 addition & 6 deletions tests/test_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { assertEquals, Comunica } from "./test_deps.ts";
const NOLOG = Deno.args.includes("--nolog");
export const logQuery = NOLOG ? () => {} : console.log;

import { DataFactory, N3, quadsToGraph, type RDF } from "ldkit/rdf";
import { DataFactory, N3, type RDF } from "ldkit/rdf";
import { ldkit, schema, xsd } from "ldkit/namespaces";
import { Options, type QueryContext } from "ldkit";

Expand Down Expand Up @@ -79,11 +79,6 @@ export const ttl = (turtle: string) => {
return quads;
};

export const createGraph = (turtle: string) => {
const quads = ttl(turtle);
return quadsToGraph(quads);
};

export const createStore = () =>
new N3.Store(undefined, {
factory: DF(),
Expand Down
16 changes: 16 additions & 0 deletions www/doc.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ const toRemoteSourceUrl = (target: string, line?: number) => {
return `${prefix}${rootModule}${suffix}`;
};

const ignoredSymbols = [
"Date",
"Iterable",
"Partial",
"Promise",
"Response",
"Unite",
"T",
"QueryEngineProxy",
"QueryBuilder",
"ExpandedSchema",
];

export default {
resolveHref(current, symbol, _namespace, property) {
const path = toApiPath(current);
Expand All @@ -27,6 +40,9 @@ export default {
: `${path}`;
},
lookupHref(current, namespace, symbol) {
if (ignoredSymbols.includes(symbol)) {
return undefined;
}
const path = toApiPath(current);
return namespace ? `${path}~${namespace}.${symbol}` : `${path}~${symbol}`;
},
Expand Down

0 comments on commit c043fae

Please sign in to comment.