Skip to content

Commit

Permalink
Merge pull request #21 from lsst-sqre/tickets/DM-30839
Browse files Browse the repository at this point in the history
DM-30839: Add in-app documentation for DP0.1
  • Loading branch information
jonathansick authored Jun 24, 2021
2 parents 54ea45f + 212b9c0 commit d770281
Show file tree
Hide file tree
Showing 10 changed files with 528 additions and 18 deletions.
13 changes: 10 additions & 3 deletions components/footer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import styled from 'styled-components';
import Image from 'next/image';
import Link from 'next/link';

import { ContentMaxWidth } from '../styles/sizes';

Expand Down Expand Up @@ -37,13 +38,20 @@ const FundingNotice = styled.div`
font-size: 0.8rem;
`;

const FooterNav = styled.nav`
margin-bottom: 2rem;
`;

/*
* Footer component (contained within a Page component).
*/
export default function Footer() {
return (
<StyledFooter>
<div className="content">
<FooterNav>
<Link href="/terms">Acceptable use policy</Link>
</FooterNav>
<FundingNotice>
<p>
<a href="https://www.nsf.gov/">NSF</a> and{' '}
Expand All @@ -55,9 +63,8 @@ export default function Footer() {
<a href="http://www.aura-astronomy.org/">AURA</a>) under a
cooperative agreement with NSF, and DOE funding is managed by SLAC
under contract by DOE. The operations phase of Rubin Observatory is
operated jointly by NSF’s National Optical-Infrared Astronomy
Research Laboratory (
<a href="https://noirlab.edu/public/">NOIRLab</a>) and SLAC National
operated jointly by NSF’s{' '}
<a href="https://noirlab.edu/public/">NOIRLab</a> and SLAC National
Accelerator Laboratory (
<a href="https://www6.slac.stanford.edu/">SLAC</a>).
</p>
Expand Down
10 changes: 7 additions & 3 deletions components/headerNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@ export default function HeaderNav({ loginData }) {
</NavItem>

<NavItem>
<Link href="/nb">Notebooks</Link>
<a href="/nb">Notebooks</a>
</NavItem>

<NavItem>
<Link href="/">APIs</Link>
<Link href="/api-aspect">APIs</Link>
</NavItem>

<NavItem>
<Link href="/">Documentation</Link>
<Link href="/docs">Documentation</Link>
</NavItem>

<NavItem>
<Link href="/support">Support</Link>
</NavItem>

<NavItem>
Expand Down
18 changes: 10 additions & 8 deletions components/hero.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,16 @@ export default function Hero() {
</div>
</ServiceCard>
<ServiceCard>
<a href="/">
<h2 className="title">APIs</h2>
<p className="subtitle">
Learn how to programatically access data with Virtual
Observatory interfaces
</p>
<StyledAspectIllustration src="/undraw_server_status_5pbv.svg" />
</a>
<div className="upper container">
<a href="/api-aspect">
<h2 className="title">APIs</h2>
<p className="subtitle">
Learn how to programatically access data with Virtual
Observatory interfaces
</p>
<StyledAspectIllustration src="/undraw_server_status_5pbv.svg" />
</a>
</div>
</ServiceCard>
</ServiceCardContainer>
</ContentContainer>
Expand Down
8 changes: 4 additions & 4 deletions components/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import getConfig from 'next/config';

const Meta = () => {
const { publicRuntimeConfig } = getConfig();
const { siteTitle, siteDescription } = publicRuntimeConfig;
const { siteName, siteDescription } = publicRuntimeConfig;

return (
<Head>
Expand All @@ -12,7 +12,7 @@ const Meta = () => {
content="width=device-width, initial-scale=1"
key="viewport"
/>
<meta charSet="utf-8" key="viewport" />
<meta charSet="utf-8" key="charset" />
<link
rel="icon"
type="image/svg+xml"
Expand All @@ -24,10 +24,10 @@ const Meta = () => {
href="/rubin-favicon-transparent-32px.png"
key="altfavicon"
/>
<title key="title">{siteTitle}</title>
<title key="title">{siteName}</title>
<meta name="description" key="description" content={siteDescription} />

<meta property="og:title" key="ogtitle" content={siteTitle} />
<meta property="og:title" key="ogtitle" content={siteName} />
<meta
property="og:description"
key="ogdescription"
Expand Down
24 changes: 24 additions & 0 deletions components/typography.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import styled from 'styled-components';

export const Lede = styled.p`
font-size: 1.3rem;
margin-bottom: 2rem;
`;

export const CtaLink = styled.a`
display: inline-block;
font-size: 1.3rem;
padding: 1rem;
border-radius: 0.5rem;
--tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
--tw-ring-offset-shadow: 0 0 transparent;
--tw-ring-shadow: 0 0 transparent;
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000),
var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
border: solid 1px transparent;
background-color: var(--sqo-doc-card-background-color);
&:hover {
border: solid 1px var(--rsd-color-primary-600);
}
`;
103 changes: 103 additions & 0 deletions pages/api-aspect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import Head from 'next/head';
import getConfig from 'next/config';
import PropTypes from 'prop-types';
import { Lede } from '../components/typography';

const pageDescription =
'Integrate Rubin data into your analysis tools with APIs.';

export default function ApiAspectPage({ publicRuntimeConfig }) {
return (
<>
<Head>
<title key="title">APIs | {publicRuntimeConfig.siteName}</title>
<meta name="description" key="description" content={pageDescription} />
<meta
property="og:title"
key="ogtitle"
content="Rubin Science Platform APIs"
/>
<meta
property="og:description"
key="ogdescription"
content={pageDescription}
/>
</Head>

<h1>Rubin Science Platform APIs</h1>

<Lede>{pageDescription}</Lede>

<h2>Table Access Protocol</h2>

<p>
You can access catalog data using the Table Access Protocol (TAP)
service with popular tools such as{' '}
<a href="http://www.star.bris.ac.uk/~mbt/topcat/">TOPCAT</a> (GUI) and{' '}
<a href="https://pyvo.readthedocs.io/en/latest/index.html">pyvo</a>{' '}
(Python package). The TAP endpoint is:
</p>

<pre>
<code>https://data.lsst.cloud/api/tap</code>
</pre>

<p>
To access the TAP service, you also need an{' '}
<strong>access token</strong>:
<ol>
<li>
Log into the Science Platform by clicking on the{' '}
<strong>Log In</strong> button at the top-right of this page (if you
aren't already logged in).
</li>
<li>
Click on{' '}
<a href="/auth/tokens">
<strong>Security tokens</strong>
</a>{' '}
from your user menu at the top-right of this page.
</li>
<li>
On the <strong>Tokens</strong> page, click on{' '}
<strong>Create Token</strong>.
</li>
<li>
Fill out the fields:
<ol>
<li>
Type a token name, such as <code>tap</code>
</li>
<li>
Select the <strong>read:tap</strong> scope.
</li>
<li>
Choose an expiration timeline. The default,{' '}
<strong>Never</strong>, is good for tokens that you manage
yourself.
</li>
<li>
Click on <strong>Create</strong>.
</li>
</ol>
</li>
<li>Copy the token string and use it in any TAP client.</li>
</ol>
</p>
</>
);
}

ApiAspectPage.propTypes = {
publicRuntimeConfig: PropTypes.object,
};

export async function getServerSideProps() {
const { serverRuntimeConfig, publicRuntimeConfig } = getConfig();
return {
props: {
serverRuntimeConfig,
publicRuntimeConfig,
},
};
}
Loading

0 comments on commit d770281

Please sign in to comment.