Skip to content

Commit

Permalink
docs(examples): update doc links
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Oct 15, 2021
1 parent ad5ea82 commit b17f61d
Show file tree
Hide file tree
Showing 18 changed files with 53 additions and 62 deletions.
2 changes: 1 addition & 1 deletion examples/commit-heatmap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ const packageCommits = (i: number, pkg: string) =>
/**
* Assemble & output full SVG document using hiccup-svg primitives.
*
* See: https://github.com/thi-ng/umbrella/blob/develop/packages/compose/src/thread-last.ts
* See: https://docs.thi.ng/umbrella/compose/modules.html#threadLast
*/
threadLast(
commitsByPackage,
Expand Down
2 changes: 1 addition & 1 deletion examples/hdom-canvas-clock/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ start(() => {
// applied in a nested manner...
//
// see here for a list of all supported attribs:
// https://github.com/thi-ng/umbrella/blob/develop/packages/hdom-canvas/src/index.ts#L35
// https://docs.thi.ng/umbrella/hiccup-canvas/#attributes
[
"g",
{
Expand Down
2 changes: 1 addition & 1 deletion examples/hydrate-basics/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const setFreq = (x: number) => state.resetIn(["freq"], x);
const app = () => {
// HOF canvas component w/ life cycle methods see for further
// reference:
// https://github.com/thi-ng/umbrella/blob/develop/packages/hdom-components/src/canvas.ts
// https://docs.thi.ng/umbrella/hdom-components/modules.html#canvas2D
//
// when serializing to html only the component's `render` method
// will be invoked. the component's `init` is invoked later when
Expand Down
50 changes: 22 additions & 28 deletions examples/poly-spline/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { line } from "@thi.ng/geom/line";
import { pathFromCubics } from "@thi.ng/geom/path";
import { star } from "@thi.ng/geom/polygon";
import { withAttribs } from "@thi.ng/geom/with-attribs";
import { convertTree } from "@thi.ng/hiccup-svg/convert";
import { fromRAF } from "@thi.ng/rstream/raf";
import { reactive, Stream } from "@thi.ng/rstream/stream";
import { sync } from "@thi.ng/rstream/sync";
Expand Down Expand Up @@ -132,33 +131,28 @@ const app =
],
[
"div",
// all @thi.ng/geom shapes implement the `IToHiccup`
// interface and so can be used directly in
// @thi.ng/hdom-canvas visualizations. However, here we're
// using SVG and hence will need to call `convertTree()` to
// transform the hiccup format into a SVG compatible format
// see:
// https://github.com/thi-ng/umbrella/blob/develop/packages/hiccup-svg/src/convert.ts#L34
convertTree(
svgDoc(
{
width: 480,
height: 480,
viewBox: "-150 -150 300 300",
fill: "none",
stroke: "#ccc",
"stroke-width": 0.25,
},
poly,
withAttribs(pathFromCubics(cubics), {
stroke: mode ? "blue" : "red",
"stroke-width": 1,
}),
group({ stroke: "#333" }, [
...controlPoints,
...handles,
])
)
// all @thi.ng/geom shapes implement the `IToHiccup` interface
// and so can be used directly in @thi.ng/hdom-canvas
// visualizations. However, here we're using SVG and hence will
// need to provide a `convert` attribute to transform the hiccup
// format into a hiccup-svg compatible format see:
// https://docs.thi.ng/umbrella/hiccup-svg/modules.html#convertTree
svgDoc(
{
convert: true,
width: 480,
height: 480,
viewBox: "-150 -150 300 300",
fill: "none",
stroke: "#ccc",
"stroke-width": 0.25,
},
poly,
withAttribs(pathFromCubics(cubics), {
stroke: mode ? "blue" : "red",
"stroke-width": 1,
}),
group({ stroke: "#333" }, [...controlPoints, ...handles])
),
],
];
Expand Down
7 changes: 3 additions & 4 deletions examples/router-basics/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import * as routes from "./routes";
export const CONFIG: AppConfig = {
// router configuration
// docs here:
// https://github.com/thi-ng/umbrella/blob/develop/packages/router/src/api.ts#L100
// https://docs.thi.ng/umbrella/router/
router: {
// use URI hash for routes (KISS)
useFragment: true,
Expand All @@ -44,7 +44,7 @@ export const CONFIG: AppConfig = {
// and only side effect functions execute any "real" work.

// see EventBus docs here:
// https://github.com/thi-ng/umbrella/blob/develop/packages/atom/src/event-bus.ts#L14
// https://docs.thi.ng/umbrella/interceptors/#event-bus-interceptors-side-effects

events: {
// sets status to "done"
Expand Down Expand Up @@ -198,8 +198,7 @@ export const CONFIG: AppConfig = {
bodyLink: { class: "link dim black" },
card: {
container: {
class:
"mw5 center bg-white br3 pa3 pa4-ns mv3 ba b--black-10 tc",
class: "mw5 center bg-white br3 pa3 pa4-ns mv3 ba b--black-10 tc",
},
thumb: { class: "br-100 h3 w3 dib" },
title: { class: "ma1" },
Expand Down
4 changes: 2 additions & 2 deletions examples/router-basics/src/effects.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// best practice tip: define event & effect names as consts or enums
// and avoid hardcoded strings for more safety and easier refactoring
// also see pre-defined event handlers & interceptors in @thi.ng/atom:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L14
// also see pre-defined event handlers & interceptors:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L31

export const JSON = "load-json";
export const ROUTE_TO = "route-to";
4 changes: 2 additions & 2 deletions examples/router-basics/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type { Route } from "@thi.ng/router";

// the `match` arrays specify the individual route elements
// docs here:
// https://github.com/thi-ng/umbrella/blob/develop/packages/router/
// https://github.com/thi-ng/umbrella/blob/develop/packages/router/src/api.ts#L31
// https://docs.thi.ng/umbrella/router/
// https://docs.thi.ng/umbrella/router/interfaces/Route.html

export const HOME: Route = {
id: "home",
Expand Down
2 changes: 1 addition & 1 deletion examples/rstream-grid/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const CONFIG: AppConfig = {
// and only side effect functions execute any "real" work.

// Docs here:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/event-bus.ts#L14
// https://docs.thi.ng/umbrella/interceptors/#event-bus-interceptors-side-effects
events: {
// generate slider event handlers. each uses the `snapshot()`
// interceptor to record a snapshot of the current app state
Expand Down
4 changes: 2 additions & 2 deletions examples/rstream-grid/src/effects.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// best practice tip: define event & effect names as consts or enums
// and avoid hardcoded strings for more safety and easier refactoring
// also see pre-defined event handlers & interceptors in @thi.ng/atom:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L14
// also see pre-defined event handlers & interceptors:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L31

export const SAVE_SVG = "save-svg";
export const SAVE_ANIM = "save-anim";
4 changes: 2 additions & 2 deletions examples/rstream-grid/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { EV_REDO, EV_UNDO } from "@thi.ng/interceptors";

// best practice tip: define event & effect names as consts or enums
// and avoid hardcoded strings for more safety and easier refactoring
// also see pre-defined event handlers & interceptors in @thi.ng/atom:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L14
// also see pre-defined event handlers & interceptors:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L31

export const UNDO = EV_UNDO;
export const REDO = EV_REDO;
Expand Down
6 changes: 3 additions & 3 deletions examples/rstream-hdom/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const counter = (start: number, step: number) => {
const s = subscription<boolean, number>(
undefined,
// the `scan` transducer is used to provide counter functionality
// see: https://github.com/thi-ng/umbrella/blob/develop/packages/transducers/src/scan.ts
// see: https://docs.thi.ng/umbrella/transducers/modules.html#scan
{
xform: scan(
reducer(
Expand Down Expand Up @@ -141,8 +141,8 @@ const app = (ctx: any, initial: number[][]) => {
// however, by stating `reset: false` (actually the default) any
// subsequent changes to any of the inputs will not be
// synchronized see here for further details:
// https://github.com/thi-ng/umbrella/blob/develop/packages/rstream/src/stream-sync.ts#L21
// https://github.com/thi-ng/umbrella/blob/develop/packages/transducers/src/partition-sync.ts#L7
// https://docs.thi.ng/umbrella/rstream/interfaces/StreamSyncOpts.html
// https://docs.thi.ng/umbrella/transducers/modules.html#partitionSync
reset: false,
});
};
Expand Down
5 changes: 2 additions & 3 deletions examples/svg-waveform/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const CONFIG: AppConfig = {
// and only side effect functions execute any "real" work.

// Docs here:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/event-bus.ts#L14
// https://docs.thi.ng/umbrella/interceptors/#event-bus-interceptors-side-effects

events: {
// generate event handlers from imported slider definitions
Expand Down Expand Up @@ -75,8 +75,7 @@ export const CONFIG: AppConfig = {
// re-skinning of the whole app
ui: {
button: {
class:
"pointer bg-black hover-bg-blue bg-animate white pa2 mr1 w-100 ttu b tracked-tight",
class: "pointer bg-black hover-bg-blue bg-animate white pa2 mr1 w-100 ttu b tracked-tight",
},
buttongroup: { class: "flex mb2" },
footer: { class: "absolute bottom-1" },
Expand Down
4 changes: 2 additions & 2 deletions examples/svg-waveform/src/effects.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// best practice tip: define event & effect names as consts or enums
// and avoid hardcoded strings for more safety and easier refactoring
// also see pre-defined event handlers & interceptors in @thi.ng/atom:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L14
// also see pre-defined event handlers & interceptors:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L31

/**
* Effect description
Expand Down
4 changes: 2 additions & 2 deletions examples/svg-waveform/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { EV_REDO, EV_UNDO } from "@thi.ng/interceptors";

// best practice tip: define event & effect names as consts or enums
// and avoid hardcoded strings for more safety and easier refactoring
// also see pre-defined event handlers & interceptors in @thi.ng/atom:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L14
// also see pre-defined event handlers & interceptors:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L31

export const SET_AMP = "set-amp";
export const SET_FREQ = "set-freq";
Expand Down
5 changes: 2 additions & 3 deletions examples/triple-query/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const CONFIG: AppConfig = {
// and only side effect functions execute any "real" work.

// Docs here:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/event-bus.ts#L14
// https://docs.thi.ng/umbrella/interceptors/#event-bus-interceptors-side-effects

events: EVENTS,

Expand Down Expand Up @@ -52,8 +52,7 @@ export const CONFIG: AppConfig = {
// re-skinning of the whole app
ui: {
button: {
class:
"pointer bg-black hover-bg-blue bg-animate white pa2 mr1 w-100 ttu b tracked-tight noselect",
class: "pointer bg-black hover-bg-blue bg-animate white pa2 mr1 w-100 ttu b tracked-tight noselect",
},
buttonDisabled: {
class: "bg-gray white pa2 mr1 w-100 ttu b tracked-tight noselect",
Expand Down
2 changes: 1 addition & 1 deletion examples/triple-query/src/effects.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// best practice tip: define event & effect names as consts or enums
// and avoid hardcoded strings for more safety and easier refactoring
// also see pre-defined event handlers & interceptors in @thi.ng/atom:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L14
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L31

export const ADD_TRIPLE = "add-triples";
export const REMOVE_TRIPLE = "remove-triples";
4 changes: 2 additions & 2 deletions examples/triple-query/src/events.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// best practice tip: define event & effect names as consts or enums
// and avoid hardcoded strings for more safety and easier refactoring
// also see pre-defined event handlers & interceptors in @thi.ng/atom:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L14
// also see pre-defined event handlers & interceptors:
// https://github.com/thi-ng/umbrella/blob/develop/packages/interceptors/src/api.ts#L31

export const ADD_CITY = "add-city";
export const ADD_COUNTRY = "add-country";
Expand Down
4 changes: 2 additions & 2 deletions examples/webgl-shadertoy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ interface DemoUniforms extends ShaderToyUniforms {
// the 2 args given are objects containing GLSL builtin vars and uniforms
//
// see:
// https://github.com/thi-ng/umbrella/blob/develop/packages/shader-ast-glsl/src/api.ts#L22
// https://github.com/thi-ng/umbrella/blob/develop/packages/webgl-shadertoy/src/api.ts#L13
// - https://docs.thi.ng/umbrella/shader-ast-glsl/interfaces/GLSLTarget.html
// - https://docs.thi.ng/umbrella/webgl-shadertoy/modules.html#MainImageFn
const mainImage: MainImageFn<DemoUniforms> = (gl, unis) => {
// predeclare local vars / symbols
let uv: Vec2Sym;
Expand Down

0 comments on commit b17f61d

Please sign in to comment.