Skip to content

Commit 08deb9b

Browse files
authored
Link to Pursuit API reference from docs pages (#77)
1 parent 903e877 commit 08deb9b

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

docs/App.jsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { attachGlobalComponentStyles } from "purs/Lumi.Components.Styles";
2828
attachGlobalComponentStyles();
2929

3030
const repoSourceBasePath = `https://github.com/lumihq/purescript-lumi-components/blob/${COMMITHASH}`;
31+
const pursuitBasePath = `https://pursuit.purescript.org/packages/purescript-lumi-components/${VERSION.replace('v', '')}`;
3132

3233
const fromComponentPath = title => ({
3334
docs: Loadable({
@@ -42,7 +43,8 @@ const fromComponentPath = title => ({
4243
title,
4344
path: `/${changeCase.hyphen(title)}`,
4445
componentSource: `${repoSourceBasePath}/src/Lumi/Components/${title}.purs`,
45-
exampleSource: `${repoSourceBasePath}/docs/Examples/${title}.example.purs`
46+
exampleSource: `${repoSourceBasePath}/docs/Examples/${title}.example.purs`,
47+
apiReference: `${pursuitBasePath}/docs/Lumi.Components.${title}`
4648
});
4749

4850
const componentLoaders = [
@@ -179,11 +181,23 @@ const renderRoute = component => (
179181
target="_blank"
180182
href={component.exampleSource}
181183
style={{
182-
marginLeft: "8px"
184+
marginLeft: "8px",
185+
marginRight: "8px"
183186
}}
184187
>
185188
Example Source
186189
</a>,
190+
"|",
191+
<a
192+
className="lumi"
193+
target="_blank"
194+
href={component.apiReference}
195+
style={{
196+
marginLeft: "8px"
197+
}}
198+
>
199+
API Reference
200+
</a>,
187201
<div
188202
style={{
189203
flex: "1",

0 commit comments

Comments
 (0)