Browse Source

feat: updated layout, shiki, table conversion, sections:

fix/enable-imgix
Thomas Osmonson 4 years ago
parent
commit
f8ee419fa0
  1. 6
      lib/rehype-plugins.js
  2. 4
      lib/remark-plugins.js
  3. 42
      lib/remark-sectons.js
  4. 2
      next.config.js
  5. 42
      package.json
  6. 7
      src/common/data/mdx.ts
  7. 5
      src/components/color-modes/styles.tsx
  8. 1
      src/components/example.tsx
  9. 99
      src/components/header.tsx
  10. 10
      src/components/icons/search.tsx
  11. 44
      src/components/mdx/components/code.tsx
  12. 11
      src/components/mdx/components/heading.tsx
  13. 1
      src/components/mdx/components/index.ts
  14. 12
      src/components/mdx/components/section.tsx
  15. 31
      src/components/mdx/md-contents.tsx
  16. 2
      src/components/mdx/mdx-components.tsx
  17. 166
      src/components/mdx/styles.tsx
  18. 6
      src/components/mdx/typography.ts
  19. 54
      src/components/search.tsx
  20. 4
      src/components/side-nav.tsx
  21. 70
      src/includes/required-fields.md
  22. 24
      src/includes/scaffolding.md
  23. 28
      src/pages/android/tutorial.md
  24. 38
      src/pages/develop/deploy-tips.md
  25. 22
      src/pages/ios/tutorial.md
  26. 9
      src/pages/org/terms.md
  27. 26
      src/pages/org/wallet-use.md
  28. 80
      src/pages/storage/gaia-admin.md
  29. 145
      src/pages/storage/overview.md
  30. 1006
      yarn.lock

6
lib/rehype-plugins.js

@ -0,0 +1,6 @@
const memoize = require('micro-memoize');
const { rehypeVscode } = require('unified-vscode');
const rehypePlugins = [memoize(rehypeVscode)];
module.exports = { rehypePlugins };

4
lib/remark-plugins.js

@ -2,7 +2,6 @@ const memoize = require('micro-memoize');
const path = require('path'); const path = require('path');
const include = require('./remark-include'); const include = require('./remark-include');
const vscode = require('remark-vscode');
const emoji = require('remark-emoji'); const emoji = require('remark-emoji');
const paragraphAlerts = require('./remark-paragraph-alerts'); const paragraphAlerts = require('./remark-paragraph-alerts');
const images = require('remark-images'); const images = require('remark-images');
@ -10,10 +9,10 @@ const unwrapImages = require('remark-unwrap-images');
const normalizeHeadings = require('remark-normalize-headings'); const normalizeHeadings = require('remark-normalize-headings');
const slug = require('remark-slug'); const slug = require('remark-slug');
const headingID = require('remark-heading-id'); const headingID = require('remark-heading-id');
const sectionize = require('remark-sectionize')
const remarkPlugins = [ const remarkPlugins = [
[memoize(include), { resolveFrom: path.join(__dirname, '../src/includes') }], [memoize(include), { resolveFrom: path.join(__dirname, '../src/includes') }],
memoize(vscode),
memoize(paragraphAlerts), memoize(paragraphAlerts),
memoize(emoji), memoize(emoji),
memoize(images), memoize(images),
@ -21,6 +20,7 @@ const remarkPlugins = [
memoize(normalizeHeadings), memoize(normalizeHeadings),
memoize(slug), memoize(slug),
memoize(headingID), memoize(headingID),
memoize(sectionize),
]; ];
module.exports = { remarkPlugins }; module.exports = { remarkPlugins };

42
lib/remark-sectons.js

@ -0,0 +1,42 @@
// https://github.com/jake-low/remark-sectionize
const findAfter = require('unist-util-find-after');
const visit = require('unist-util-visit-parents');
const MAX_HEADING_DEPTH = 6;
module.exports = plugin;
function plugin() {
return transform;
}
function transform(tree) {
for (let depth = MAX_HEADING_DEPTH; depth > 0; depth--) {
visit(tree, node => node.type === 'heading' && node.depth === depth, sectionize);
}
}
function sectionize(node, ancestors) {
const start = node;
const depth = start.depth;
const parent = ancestors[ancestors.length - 1];
const isEnd = node => (node.type === 'heading' && node.depth <= depth) || node.type === 'export';
const end = findAfter(parent, start, isEnd);
const startIndex = parent.children.indexOf(start);
const endIndex = parent.children.indexOf(end);
const between = parent.children.slice(startIndex, endIndex > 0 ? endIndex : undefined);
const section = {
type: 'section',
depth: depth,
children: between,
data: {
hName: 'section',
},
};
parent.children.splice(startIndex, section.children.length, section);
}

2
next.config.js

@ -3,6 +3,7 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
}); });
const path = require('path'); const path = require('path');
const { remarkPlugins } = require('./lib/remark-plugins'); const { remarkPlugins } = require('./lib/remark-plugins');
const { rehypePlugins } = require('./lib/rehype-plugins');
module.exports = withBundleAnalyzer({ module.exports = withBundleAnalyzer({
experimental: { experimental: {
@ -20,6 +21,7 @@ module.exports = withBundleAnalyzer({
loader: '@mdx-js/loader', loader: '@mdx-js/loader',
options: { options: {
remarkPlugins, remarkPlugins,
rehypePlugins,
}, },
}, },
path.join(__dirname, './lib/md-loader'), path.join(__dirname, './lib/md-loader'),

42
package.json

@ -2,26 +2,22 @@
"name": "@blockstack/docs", "name": "@blockstack/docs",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@blockstack/ui": "^2.12.2-beta.0", "@blockstack/ui": "2.12.2-beta.0",
"@docsearch/react": "^1.0.0-alpha.24", "@docsearch/react": "^1.0.0-alpha.24",
"@hashicorp/remark-plugins": "^3.0.0", "@hashicorp/remark-plugins": "^3.0.0",
"@mapbox/rehype-prism": "^0.5.0", "@mdx-js/loader": "1.6.15",
"@mdx-js/loader": "1.6.13", "@mdx-js/mdx": "^1.6.15",
"@mdx-js/mdx": "^1.6.13", "@mdx-js/react": "^1.6.15",
"@mdx-js/react": "^1.6.13",
"@mdx-js/runtime": "^1.6.13",
"@next/mdx": "^9.4.4", "@next/mdx": "^9.4.4",
"@philpl/buble": "^0.19.7",
"@reach/accordion": "^0.10.5", "@reach/accordion": "^0.10.5",
"@reach/tooltip": "^0.10.5", "@reach/tooltip": "^0.10.5",
"@styled-system/theme-get": "^5.1.2", "@styled-system/theme-get": "^5.1.2",
"@types/mdx-js__react": "^1.5.2", "@types/mdx-js__react": "^1.5.2",
"@types/node": "^14.0.14", "@types/node": "^14.0.27",
"@types/nprogress": "^0.2.0", "@types/nprogress": "^0.2.0",
"@types/reach__tooltip": "^0.2.0", "@types/reach__tooltip": "^0.2.0",
"algoliasearch": "^4.3.1", "algoliasearch": "^4.3.1",
"babel-plugin-macros": "^2.8.0", "babel-plugin-macros": "^2.8.0",
"babel-plugin-prismjs": "^2.0.1",
"cache-manager": "^3.3.0", "cache-manager": "^3.3.0",
"cache-manager-fs-hash": "^0.0.9", "cache-manager-fs-hash": "^0.0.9",
"csvtojson": "^2.0.10", "csvtojson": "^2.0.10",
@ -32,17 +28,14 @@
"fs-extra": "^9.0.1", "fs-extra": "^9.0.1",
"github-slugger": "^1.3.0", "github-slugger": "^1.3.0",
"gray-matter": "^4.0.2", "gray-matter": "^4.0.2",
"hast-util-to-string": "^1.0.4",
"html-react-parser": "^0.13.0", "html-react-parser": "^0.13.0",
"jsx-to-string": "^1.4.0",
"lodash.debounce": "^4.0.8", "lodash.debounce": "^4.0.8",
"mdi-react": "7.3.0", "mdi-react": "7.3.0",
"micro-memoize": "^4.0.9", "micro-memoize": "^4.0.9",
"next": "^9.5.1-canary.0", "next": "^9.5.1-canary.0",
"next-google-fonts": "^1.1.0", "next-google-fonts": "^1.1.0",
"next-mdx-enhanced": "^3.0.0",
"next-mdx-remote": "^0.6.0", "next-mdx-remote": "^0.6.0",
"next-optimized-images": "^2.6.1",
"nookies": "^2.3.2",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"p-all": "^3.0.0", "p-all": "^3.0.0",
"preact": "^10.4.4", "preact": "^10.4.4",
@ -50,17 +43,7 @@
"preact-ssr-prepass": "^1.1.0", "preact-ssr-prepass": "^1.1.0",
"prettier": "^2.0.5", "prettier": "^2.0.5",
"preval.macro": "^5.0.0", "preval.macro": "^5.0.0",
"prism-react-renderer": "^1.1.1",
"prismjs": "^1.20.0",
"react-children-utilities": "^2.1.3",
"react-gesture-responder": "^2.1.0", "react-gesture-responder": "^2.1.0",
"react-headroom": "^3.0.0",
"react-icons": "^3.9.0",
"react-is": "^16.13.1",
"react-live": "^2.2.2",
"react-simple-code-editor": "^0.11.0",
"react-virtualized-auto-sizer": "^1.0.2",
"react-window": "^1.8.5",
"remark": "^12.0.1", "remark": "^12.0.1",
"remark-emoji": "2.1.0", "remark-emoji": "2.1.0",
"remark-external-links": "^6.1.0", "remark-external-links": "^6.1.0",
@ -70,16 +53,16 @@
"remark-images": "2.0.0", "remark-images": "2.0.0",
"remark-normalize-headings": "^2.0.0", "remark-normalize-headings": "^2.0.0",
"remark-parse": "^8.0.3", "remark-parse": "^8.0.3",
"remark-sectionize": "^1.1.1",
"remark-slug": "6.0.0", "remark-slug": "6.0.0",
"remark-squeeze-paragraphs": "^4.0.0", "remark-squeeze-paragraphs": "^4.0.0",
"remark-unwrap-images": "2.0.0", "remark-unwrap-images": "2.0.0",
"remark-vscode": "^1.0.0-beta.2", "remark-vscode": "^1.0.0-beta.2",
"store": "^2.0.12",
"strip-markdown": "^3.1.2", "strip-markdown": "^3.1.2",
"swr": "^0.2.3", "swr": "^0.2.3",
"touchable-hook": "^1.3.0",
"turndown": "^6.0.0", "turndown": "^6.0.0",
"typescript": "^3.9.7", "typescript": "^3.9.7",
"unified-vscode": "^1.0.0-beta.0",
"unist-builder": "^2.0.3", "unist-builder": "^2.0.3",
"unist-util-is": "^4.0.2", "unist-util-is": "^4.0.2",
"unist-util-select": "^3.0.1", "unist-util-select": "^3.0.1",
@ -91,13 +74,13 @@
"@blockstack/eslint-config": "^1.0.5", "@blockstack/eslint-config": "^1.0.5",
"@blockstack/prettier-config": "^0.0.6", "@blockstack/prettier-config": "^0.0.6",
"@next/bundle-analyzer": "^9.4.4", "@next/bundle-analyzer": "^9.4.4",
"babel-plugin-styled-components": "^1.10.7", "babel-plugin-styled-components": "^1.11.0",
"next-transpile-modules": "^3.3.0", "next-transpile-modules": "^4.0.2",
"react": "^16.13.0", "react": "^16.13.0",
"react-dom": "^16.13.0", "react-dom": "^16.13.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"styled-components": "^5.0.1", "styled-components": "^5.0.1",
"tsconfig-paths-webpack-plugin": "^3.2.0" "tsconfig-paths-webpack-plugin": "^3.3.0"
}, },
"private": true, "private": true,
"scripts": { "scripts": {
@ -116,7 +99,8 @@
"typecheck:watch": "npm run typecheck -- --watch" "typecheck:watch": "npm run typecheck -- --watch"
}, },
"resolutions": { "resolutions": {
"preact": "^10.4.4" "preact": "^10.4.4",
"@blockstack/ui": "2.12.2-beta.0"
}, },
"prettier": "@blockstack/prettier-config" "prettier": "@blockstack/prettier-config"
} }

7
src/common/data/mdx.ts

@ -1,11 +1,14 @@
import { MDXComponents } from '@components/mdx/mdx-components'; import { MDXComponents } from '@components/mdx/mdx-components';
import renderToString from 'next-mdx-remote/render-to-string'; import renderToString from 'next-mdx-remote/render-to-string';
const { remarkPlugins } = require('../../../lib/remark-plugins'); const { remarkPlugins } = require('../../../lib/remark-plugins');
const { rehypePlugins } = require('../../../lib/rehype-plugins');
export const wrapValueInTicks = value => '`' + value.replace('`', '').replace('`', '') + '`'; export const wrapValueInTicks = value => '`' + value.replace('`', '').replace('`', '') + '`';
export const convertRemoteDataToMDX = async (arr: any[], key: string) => export const convertRemoteDataToMDX = async (arr: any[], key: string) =>
Promise.all(arr.map(entry => renderToString(entry[key], MDXComponents, { remarkPlugins }))); Promise.all(
arr.map(entry => renderToString(entry[key], MDXComponents, { remarkPlugins, rehypePlugins }))
);
export const renderMdx = async (content: string) => export const renderMdx = async (content: string) =>
renderToString(content, MDXComponents, { remarkPlugins }); renderToString(content, MDXComponents, { remarkPlugins, rehypePlugins });

5
src/components/color-modes/styles.tsx

@ -4,17 +4,20 @@ import { generateCssVariables } from '@blockstack/ui';
export const ColorModes = createGlobalStyle` export const ColorModes = createGlobalStyle`
:root{ :root{
${generateCssVariables('light')}; ${generateCssVariables('light')};
--colors-highlight-line-bg: rgba(255,255,255,0.08);
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root { :root {
${generateCssVariables('dark')}; ${generateCssVariables('dark')};
--colors-highlight-line-bg: rgba(255,255,255,0.04);
} }
} }
@media (prefers-color-scheme: light) { @media (prefers-color-scheme: light) {
:root { :root {
${generateCssVariables('light')}; ${generateCssVariables('light')};
--colors-highlight-line-bg: rgba(255,255,255,0.08);
} }
} }
@ -24,9 +27,11 @@ export const ColorModes = createGlobalStyle`
&.light { &.light {
${generateCssVariables('light')}; ${generateCssVariables('light')};
--colors-highlight-line-bg: rgba(255,255,255,0.08);
} }
&.dark { &.dark {
${generateCssVariables('dark')}; ${generateCssVariables('dark')};
--colors-highlight-line-bg: rgba(255,255,255,0.04);
} }
} }

1
src/components/example.tsx

@ -12,7 +12,6 @@ import {
FlexProps, FlexProps,
} from '@blockstack/ui'; } from '@blockstack/ui';
import { Caption, Text } from '@components/typography'; import { Caption, Text } from '@components/typography';
import jsxToString from 'jsx-to-string';
import { border } from '@common/utils'; import { border } from '@common/utils';

99
src/components/header.tsx

@ -1,5 +1,14 @@
import React from 'react'; import React from 'react';
import { Flex, Box, BlockstackIcon, Stack, color, space, ChevronIcon } from '@blockstack/ui'; import {
Flex,
Box,
BlockstackIcon,
Stack,
color,
space,
ChevronIcon,
BoxProps,
} from '@blockstack/ui';
import { Link, Text, LinkProps } from '@components/typography'; import { Link, Text, LinkProps } from '@components/typography';
import MenuIcon from 'mdi-react/MenuIcon'; import MenuIcon from 'mdi-react/MenuIcon';
import CloseIcon from 'mdi-react/CloseIcon'; import CloseIcon from 'mdi-react/CloseIcon';
@ -11,10 +20,7 @@ import { css } from '@styled-system/css';
import NextLink from 'next/link'; import NextLink from 'next/link';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { ColorModeButton } from '@components/color-mode-button'; import { ColorModeButton } from '@components/color-mode-button';
import dynamic from 'next/dynamic';
const Search = dynamic(() => import('./search'));
import Headroom from 'react-headroom';
import { border } from '@common/utils';
const MenuButton = ({ ...rest }: any) => { const MenuButton = ({ ...rest }: any) => {
const { isOpen, handleOpen, handleClose } = useMobileMenuState(); const { isOpen, handleOpen, handleClose } = useMobileMenuState();
const Icon = isOpen ? CloseIcon : MenuIcon; const Icon = isOpen ? CloseIcon : MenuIcon;
@ -109,33 +115,37 @@ const nav = [
{ label: 'Run a node' }, { label: 'Run a node' },
{ label: 'Build on Blockstack' }, { label: 'Build on Blockstack' },
]; ];
const SubBar: React.FC<any> = props => (
<Flex
position="sticky"
zIndex={99}
top={0}
align="center"
height="60px"
bg={color('bg')}
borderBottom={border()}
{...props}
>
<Flex
px={space(['extra-loose', 'extra-loose', 'base', 'base'])}
flexGrow={1}
justifyContent="space-between"
align="center"
maxWidth="1280px"
mx="auto"
>
<BreadCrumbs />
<Search />
</Flex>
</Flex>
);
export const HEADER_HEIGHT = 132; export const HEADER_HEIGHT = 132;
const HeaderTextItem: React.FC<BoxProps> = ({ children, ...rest }) => (
<Text
color={color('invert')}
css={css({
fontWeight: 500,
fontSize: '16px',
lineHeight: '24px',
padding: '0.05px 0',
'::before': {
content: "''",
marginTop: '-0.38948863636363634em',
display: 'block',
height: 0,
},
'::after': {
content: "''",
marginBottom: '-0.38948863636363634em',
display: 'block',
height: 0,
},
...rest,
})}
>
{' '}
{children}
</Text>
);
const Header = ({ hideSubBar, ...rest }: any) => { const Header = ({ hideSubBar, ...rest }: any) => {
return ( return (
<> <>
@ -157,32 +167,10 @@ const Header = ({ hideSubBar, ...rest }: any) => {
<Link as="a"> <Link as="a">
<Flex align="center"> <Flex align="center">
<Box color={color('invert')} mr={space('tight')}> <Box color={color('invert')} mr={space('tight')}>
<BlockstackIcon size="20px" /> <BlockstackIcon size="18px" />
</Box> </Box>
<Box> <Box>
<Text <HeaderTextItem>Blockstack</HeaderTextItem>
color={color('invert')}
css={css({
fontWeight: 500,
fontSize: '13.75px',
lineHeight: '14px',
padding: '0.05px 0',
':before': {
content: "''",
marginTop: '-0.14909090909090908em',
display: 'block',
height: 0,
},
':after': {
content: "''",
marginBottom: '-0.14909090909090908em',
display: 'block',
height: 0,
},
})}
>
Blockstack
</Text>
</Box> </Box>
</Flex> </Flex>
</Link> </Link>
@ -192,9 +180,7 @@ const Header = ({ hideSubBar, ...rest }: any) => {
<Stack mr={space('base')} isInline spacing={space('base')}> <Stack mr={space('base')} isInline spacing={space('base')}>
{nav.map(item => ( {nav.map(item => (
<Box> <Box>
<Text fontSize="14px" fontWeight="600"> <HeaderTextItem>{item.label}</HeaderTextItem>
{item.label}
</Text>
</Box> </Box>
))} ))}
</Stack> </Stack>
@ -205,7 +191,6 @@ const Header = ({ hideSubBar, ...rest }: any) => {
</Flex> </Flex>
</Flex> </Flex>
</HeaderWrapper> </HeaderWrapper>
{!hideSubBar && <SubBar />}
</> </>
); );
}; };

10
src/components/icons/search.tsx

@ -0,0 +1,10 @@
import React from 'react';
import { BaseSvg, SvgProps } from '@components/icons/_base';
export const SearchIcon: SvgProps = props => (
<BaseSvg {...props}>
<path stroke="none" d="M0 0h24v24H0z" />
<circle cx="10" cy="10" r="7" />
<line x1="21" y1="21" x2="15" y2="15" />
</BaseSvg>
);

44
src/components/mdx/components/code.tsx

@ -4,9 +4,40 @@ import { Box, BoxProps, color, themeColor } from '@blockstack/ui';
import { border } from '@common/utils'; import { border } from '@common/utils';
import { css } from '@styled-system/css'; import { css } from '@styled-system/css';
import { Text } from '@components/typography'; import { Text } from '@components/typography';
import { useColorMode } from '@pages/_app';
export const Code: React.FC<any> = React.memo( const getHighlightLineNumbers = (str: string): number[] | undefined => {
React.forwardRef(({ children, ...rest }, ref) => { if (!str) return;
let numbers: number[] | undefined = undefined;
numbers = str.split(',').flatMap(s => {
if (!s.includes('-')) return +s;
const [min, max] = s.split('-');
// @ts-ignore
const final = Array.from({ length: max - min + 1 }, (_, n) => n + +min);
return final;
});
return numbers;
};
export const Code: React.FC<BoxProps & { highlight?: string }> = React.forwardRef(
({ children, highlight, ...rest }, ref) => {
const [mode] = useColorMode();
const numbers = getHighlightLineNumbers(highlight);
const generateCssStylesForHighlightedLines = (numbers: number[] = []) => {
const record = {};
const style = {
bg: 'var(--colors-highlight-line-bg)',
'&::before': {
borderRightColor: themeColor('ink.600'),
},
};
numbers.forEach(number => {
record[`&:nth-of-type(${number})`] = style;
});
return record;
};
return ( return (
<Box ref={ref as any} overflowX="auto"> <Box ref={ref as any} overflowX="auto">
<Box <Box
@ -18,12 +49,7 @@ export const Code: React.FC<any> = React.memo(
minWidth: 'fit-content', minWidth: 'fit-content',
'.token-line': { '.token-line': {
display: 'inline-block', display: 'inline-block',
'&.token-line--highlighted': { ...generateCssStylesForHighlightedLines(numbers),
bg: 'rgba(255,255,255,0.05)',
'&::before': {
borderRightColor: themeColor('ink.600'),
},
},
}, },
})} })}
{...rest} {...rest}
@ -34,7 +60,7 @@ export const Code: React.FC<any> = React.memo(
</Box> </Box>
</Box> </Box>
); );
}) }
); );
const preProps = { const preProps = {

11
src/components/mdx/components/heading.tsx

@ -17,8 +17,8 @@ const LinkButton = React.memo(({ link, onClick, ...rest }: BoxProps & { link: st
const url = const url =
typeof document !== 'undefined' && document.location.origin + document.location.pathname + link; typeof document !== 'undefined' && document.location.origin + document.location.pathname + link;
const { onCopy } = useClipboard(url); const { hasCopied, onCopy } = useClipboard(url);
const label = 'Copy url'; const label = hasCopied ? 'Copied!' : 'Copy url';
return ( return (
<Box <Box
as="span" as="span"
@ -27,6 +27,7 @@ const LinkButton = React.memo(({ link, onClick, ...rest }: BoxProps & { link: st
onClick && onClick(e); onClick && onClick(e);
onCopy?.(); onCopy?.();
}} }}
transform="translateY(-5px)"
{...rest} {...rest}
> >
<Tooltip label={label} aria-label={label}> <Tooltip label={label} aria-label={label}>
@ -99,15 +100,19 @@ export const Heading = ({ as, children, id, ...rest }: FlexProps) => {
display: 'flex', display: 'flex',
// @ts-ignore // @ts-ignore
justifyContent: 'flex-start', justifyContent: 'flex-start',
textDecoration: id && hover ? 'underline' : 'unset',
// @ts-ignore
cursor: id && hover ? 'pointer' : 'unset',
...rest, ...rest,
})} })}
onClick={id && handleLinkClick}
> >
<Box as="span" display="inline-block"> <Box as="span" display="inline-block">
{children} {children}
</Box> </Box>
<AnchorOffset id={id} /> <AnchorOffset id={id} />
{id && isActive && <Hashtag />} {id && isActive && <Hashtag />}
{id && <LinkButton opacity={hover || active ? 1 : 0} onClick={handleLinkClick} link={link} />} {id && <LinkButton opacity={hover || active ? 1 : 0} link={link} />}
</Title> </Title>
); );
}; };

1
src/components/mdx/components/index.ts

@ -5,3 +5,4 @@ export * from './link';
export * from './list'; export * from './list';
export * from './table'; export * from './table';
export * from './typography'; export * from './typography';
export * from './section';

12
src/components/mdx/components/section.tsx

@ -0,0 +1,12 @@
import React from 'react';
import { Box, BoxProps } from '@blockstack/ui';
export const Section: React.FC<BoxProps> = React.memo(
React.forwardRef(({ children, ...rest }, ref) => {
return (
<Box ref={ref as any} as="section" {...rest}>
{children}
</Box>
);
})
);

31
src/components/mdx/md-contents.tsx

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { space } from '@blockstack/ui'; import { Box, space } from '@blockstack/ui';
import { ContentWrapper } from '../content-wrapper'; import { ContentWrapper } from '../content-wrapper';
import { TableOfContents } from '@components/toc'; import { TableOfContents } from '@components/toc';
@ -7,7 +7,9 @@ import { TableOfContents } from '@components/toc';
import { css } from '@styled-system/css'; import { css } from '@styled-system/css';
import { TOC_WIDTH } from '@common/constants'; import { TOC_WIDTH } from '@common/constants';
import { styleOverwrites } from '@components/mdx/styles'; import { styleOverwrites } from '@components/mdx/styles';
import dynamic from 'next/dynamic';
import { border } from '@common/utils';
const Search = dynamic(() => import('@components/search'));
export const MDContents: React.FC<any> = React.memo(({ headings, children }) => ( export const MDContents: React.FC<any> = React.memo(({ headings, children }) => (
<> <>
<ContentWrapper <ContentWrapper
@ -20,16 +22,19 @@ export const MDContents: React.FC<any> = React.memo(({ headings, children }) =>
> >
{children} {children}
</ContentWrapper> </ContentWrapper>
{headings?.length > 1 ? ( <Box>
<TableOfContents <Box position="sticky" top={0} pt="64px" pl={space('extra-loose')}>
display={['none', 'none', 'none', 'block']} <Search mb={space('base')} />
position="sticky" {headings?.length > 1 ? (
top={space('base')} <TableOfContents
pt="64px" pl={space('base')}
pl={space('extra-loose')} borderLeft={border()}
headings={headings} display={['none', 'none', 'none', 'block']}
limit={2} headings={headings}
/> limit={2}
) : null} />
) : null}
</Box>
</Box>
</> </>
)); ));

2
src/components/mdx/mdx-components.tsx

@ -20,6 +20,7 @@ import {
Hr, Hr,
Li, Li,
Sup, Sup,
Section,
} from '@components/mdx/components'; } from '@components/mdx/components';
import { Img } from '@components/mdx/image'; import { Img } from '@components/mdx/image';
import { Code } from '@components/mdx/components'; import { Code } from '@components/mdx/components';
@ -47,4 +48,5 @@ export const MDXComponents = {
img: Img, img: Img,
blockquote: Blockquote, blockquote: Blockquote,
sup: Sup, sup: Sup,
section: Section,
}; };

166
src/components/mdx/styles.tsx

@ -107,33 +107,93 @@ p, ul, ol, table {
`; `;
export const styleOverwrites = { export const styleOverwrites = {
'& > *:not(pre):not(ul):not(ol):not(img):not([data-reach-accordion])': { section: {
px: space('extra-loose'), '& > *:not(pre):not(ul):not(ol):not(img):not([data-reach-accordion]):not(section)': {
px: space('extra-loose'),
},
'ul, ol': {
pr: space('extra-loose'),
pl: '64px',
'ul, ol': {
pl: space('extra-loose'),
},
},
'*:not(pre) a > code': {
color: color('accent'),
textDecoration: 'inherit',
},
pre: {
px: space(['none', 'none', 'extra-loose', 'extra-loose']),
},
img: {
mx: 'auto',
},
}, },
'& > ul, & > ol': { pre: {
pr: space('extra-loose'), display: 'block',
pl: '64px ', my: space('extra-loose'),
'& > div': {
borderRight: [0, 0, border()],
borderLeft: [0, 0, border()],
borderBottom: border(),
borderTop: border(),
borderRadius: [0, 0, '12px'],
bg: themeColor('ink'),
},
'& > div > code': {
whiteSpace: 'pre',
overflowX: 'auto',
maxWidth: '100%',
'& + h2, & + h3': {
mt: space('extra-loose'),
},
'& + h4, & + h5, & + h6, & + blockquote, & + ul, & + ol': {
mt: 0,
},
counterReset: 'line',
'& .token-line': {
'.comment': {
color: 'rgba(255,255,255,0.5) !important',
},
display: 'flex',
fontSize: '14px',
'&::before': {
counterIncrement: 'line',
content: 'counter(line, decimal-leading-zero)',
display: 'grid',
placeItems: 'center',
color: themeColor('ink.400'),
mr: '16px',
width: '42px',
fontSize: '12px',
borderRight: '1px solid rgb(39,41,46)',
},
pr: space(['base-loose', 'base-loose', 'extra-loose', 'extra-loose']),
},
boxShadow: 'none',
},
}, },
'p, li': { 'p, li, a': {
display: 'inline-block', display: 'inline-block',
fontSize: '16.5px', fontSize: '16px',
lineHeight: '28px', lineHeight: '28px',
':before': { padding: '0.05px 0',
'::before': {
content: "''", content: "''",
marginTop: '-0.4878787878787879em', marginTop: '-0.5144886363636364em',
display: 'block', display: 'block',
height: 0, height: 0,
}, },
':after': { '::after': {
content: "''", content: "''",
marginBottom: '-0.4878787878787879em', marginBottom: '-0.5144886363636364em',
display: 'block', display: 'block',
height: 0, height: 0,
}, },
}, },
li: { li: {
display: 'list-item', display: 'list-item',
pb: 0, pb: space('base-tight'),
':last-child': { ':last-child': {
mb: 0, mb: 0,
pb: 0, pb: 0,
@ -141,10 +201,6 @@ export const styleOverwrites = {
'*:last-child:not(pre):not(blockquote)': { '*:last-child:not(pre):not(blockquote)': {
mb: 0, mb: 0,
}, },
pre: {
display: 'block',
my: space('extra-loose'),
},
p: { p: {
display: 'inline', display: 'inline',
}, },
@ -170,63 +226,12 @@ export const styleOverwrites = {
display: 'inline-block', display: 'inline-block',
mt: space('extra-loose'), mt: space('extra-loose'),
}, },
'& > *:not(pre) a > code': {
color: color('accent'),
textDecoration: 'inherit',
},
'li pre': { 'li pre': {
'& > div': { '& > div': {
border: border(), border: border(),
borderRadius: '12px', borderRadius: '12px',
}, },
}, },
pre: {
my: space('extra-loose'),
'& > div': {
borderRight: [0, 0, border()],
borderLeft: [0, 0, border()],
borderBottom: border(),
borderTop: border(),
borderRadius: [0, 0, '12px'],
bg: themeColor('ink'),
},
'& > div > code': {
whiteSpace: 'pre',
overflowX: 'auto',
maxWidth: '100%',
'& + h2, & + h3': {
mt: space('extra-loose'),
},
'& + h4, & + h5, & + h6, & + blockquote, & + ul, & + ol': {
mt: 0,
},
counterReset: 'line',
'& .token-line': {
'.comment': {
color: 'rgba(255,255,255,0.5) !important',
},
display: 'flex',
fontSize: '14px',
'&::before': {
counterIncrement: 'line',
content: 'counter(line, decimal-leading-zero)',
display: 'grid',
placeItems: 'center',
color: themeColor('ink.400'),
mr: '16px',
width: '42px',
fontSize: '12px',
borderRight: '1px solid rgb(39,41,46)',
},
pr: space(['base-loose', 'base-loose', 'extra-loose', 'extra-loose']),
},
boxShadow: 'none',
},
},
'& > pre': {
px: space(['none', 'none', 'extra-loose', 'extra-loose']),
},
h2: { h2: {
mt: '64px', mt: '64px',
'&, & > *': { '&, & > *': {
@ -238,7 +243,7 @@ export const styleOverwrites = {
mr: '2px', mr: '2px',
fontSize: '22px', fontSize: '22px',
}, },
'& + h3': { '& + section > h3': {
mt: 0, mt: 0,
}, },
}, },
@ -247,7 +252,7 @@ export const styleOverwrites = {
'&, & > *': { '&, & > *': {
...getHeadingStyles('h3'), ...getHeadingStyles('h3'),
}, },
'& + h4': { '& + section > h4': {
mt: 0, mt: 0,
}, },
}, },
@ -256,7 +261,7 @@ export const styleOverwrites = {
'&, & > *': { '&, & > *': {
...getHeadingStyles('h4'), ...getHeadingStyles('h4'),
}, },
'& + h5': { '& + section > h5': {
mt: 0, mt: 0,
}, },
}, },
@ -296,9 +301,6 @@ export const styleOverwrites = {
'ol, ul': { 'ol, ul': {
mb: 0, mb: 0,
mt: space('extra-loose'), mt: space('extra-loose'),
'& + blockquote, & + pre': {
// mt: space('extra-tight'),
},
}, },
blockquote: { blockquote: {
'& + blockquote': { '& + blockquote': {
@ -317,10 +319,22 @@ export const styleOverwrites = {
img: { img: {
my: space('extra-loose'), my: space('extra-loose'),
}, },
'& > img': {
mx: 'auto',
},
table: { table: {
'*': {
fontSize: '14px',
lineHeight: '24px',
'::before': {
display: 'none',
},
'::after': {
display: 'none',
},
'& code': {
fontSize: '10px',
lineHeight: '12px',
transform: 'translateY(4px)',
},
},
'& code': { '& code': {
maxWidth: '100%', maxWidth: '100%',
overflowX: 'auto', overflowX: 'auto',

6
src/components/mdx/typography.ts

@ -6,18 +6,18 @@ export const baseTypeStyles = {
const h1 = { const h1 = {
fontWeight: 'bolder', fontWeight: 'bolder',
fontSize: '44px', fontSize: ['38px', '38px', '44px'],
lineHeight: '52px', lineHeight: '52px',
padding: '0.05px 0', padding: '0.05px 0',
':before': { ':before': {
content: "''", content: "''",
marginTop: '-0.2284090909090909em', marginTop: ['-0.32188995215311006em', '-0.32188995215311006em', '-0.2284090909090909em'],
display: 'block', display: 'block',
height: 0, height: 0,
}, },
':after': { ':after': {
content: "''", content: "''",
marginBottom: '-0.22840909090909092em', marginBottom: ['-0.32188995215311006em', '-0.32188995215311006em', '-0.22840909090909092em'],
display: 'block', display: 'block',
height: 0, height: 0,
}, },

54
src/components/search.tsx

@ -1,10 +1,9 @@
import React from 'react'; import React from 'react';
import { Box, Flex, Portal, space, Fade, themeColor, color } from '@blockstack/ui'; import { Box, Flex, Portal, space, Fade, themeColor, color, BoxProps } from '@blockstack/ui';
import { useDocSearchKeyboardEvents } from '@docsearch/react'; import { useDocSearchKeyboardEvents } from '@docsearch/react';
import { border } from '@common/utils';
import { Text } from '@components/typography'; import { Text } from '@components/typography';
import SearchIcon from 'mdi-react/SearchIcon'; import { SearchIcon } from '@components/icons/search';
import Router from 'next/router'; import Router from 'next/router';
import Link from 'next/link'; import Link from 'next/link';
@ -42,7 +41,7 @@ const searchOptions = {
let DocSearchModal: any = null; let DocSearchModal: any = null;
export const SearchBox: React.FC<any> = React.memo(() => { export const SearchBox: React.FC<BoxProps> = React.memo(props => {
const [isOpen, setIsOpen] = React.useState(false); const [isOpen, setIsOpen] = React.useState(false);
const importDocSearchModalIfNeeded = React.useCallback(function importDocSearchModalIfNeeded() { const importDocSearchModalIfNeeded = React.useCallback(function importDocSearchModalIfNeeded() {
@ -75,28 +74,45 @@ export const SearchBox: React.FC<any> = React.memo(() => {
return ( return (
<> <>
{ <Portal>
<Portal> <Fade in={isOpen}>
<Fade in={isOpen}> {styles => (
{styles => ( <Box position="absolute" zIndex={9999} style={styles}>
<Box position="absolute" zIndex={9999} style={styles}> <DocSearchModal
<DocSearchModal {...searchOptions} onClose={onClose} hitComponent={Hit} /> initialScrollY={window.scrollY}
</Box> {...searchOptions}
)} onClose={onClose}
</Fade> hitComponent={Hit}
</Portal> />
} </Box>
<Box minWidth="200px" display={['none', 'none', 'block', 'block']}> )}
</Fade>
</Portal>
<Box
bg={color('bg-alt')}
minWidth="200px"
borderRadius="12px"
display={['none', 'none', 'block', 'block']}
border="1px solid"
borderColor={isOpen ? 'rgba(170, 179, 255, 0.8)' : color('bg-alt')}
boxShadow={
isOpen ? '0 0 0 3px rgba(170, 179, 255, 0.25)' : '0 0 0 3px rgba(170, 179, 255, 0)'
}
transition="border-color 0.2s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.2s cubic-bezier(0.23, 1, 0.32, 1)"
_hover={{
borderColor: 'rgba(170, 179, 255, 0.8)',
boxShadow: '0 0 0 3px rgba(170, 179, 255, 0.25)',
}}
{...props}
>
<Flex <Flex
onClick={onOpen} onClick={onOpen}
border={border()}
borderRadius="6px"
px={space('base-tight')} px={space('base-tight')}
py={space('tight')} py={space('tight')}
align="center" align="center"
_hover={{ borderColor: themeColor('blue.400'), cursor: 'pointer' }} _hover={{ borderColor: themeColor('blue.400'), cursor: 'pointer' }}
> >
<Box mr={space('tight')}> <Box transform="scaleX(-1)" mr={space('tight')} color={color('text-caption')}>
<SearchIcon size="18px" /> <SearchIcon size="18px" />
</Box> </Box>
<Text fontSize={'14px'} color={color('text-caption')}> <Text fontSize={'14px'} color={color('text-caption')}>

4
src/components/side-nav.tsx

@ -22,8 +22,8 @@ const Wrapper: React.FC<BoxProps & { containerProps?: BoxProps }> = ({
overflow="auto" overflow="auto"
pb="62px" pb="62px"
px={space('base')} px={space('base')}
top="60px" top={0}
pt={space('base')} pt="64px"
{...containerProps} {...containerProps}
> >
{children} {children}

70
src/includes/required-fields.md

@ -1,56 +1,14 @@
<table class="uk-table-striped uk-table-small"> | Field | Description |
<thead> | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
<tr> | Your Name | Your first and last name. |
<th class="uk-width-1-2"><strong>Field</strong></th> | Your Email | A valid email address. If you are submitting an example of Animal Kingdom sample,this is the email where we will send you instructions for getting your Zero to DApp t-shirt. |
<th>Description</th> | App Name | Name of your application. If you are submitting an example of Animal Kingdom sample, enter USERNAME: Animal Kingdom. |
</tr> | Short description | Describe your application. |
</thead> | Website | The URL of the website where you deployed your application. |
<tr> | App icon URL | URL_DEPLOYED_SITE/icon-192x192.png for example, https://animalkingdoms.netlify.com/icon-192x192.png |
<td><strong>Your Name</strong></td> | Open Source URL | The URL where your source code lives. If you are submitting an example of Animal Kingdom sample, you can leave this blank for a sample application. |
<td>Your first and last name.</td> | Twitter Handle | Optionally enter a Twitter handle for your application, for example `@coolapp`. |
</tr> | Category | If you are submitting an example of Animal Kingdom sample, make sure you choose the Sample Blockstack Apps category. |
<tr> | Blockchain | If you are submitting an example of Animal Kingdom sample, leave this as is. |
<td><strong>Your Email</strong></td> | Storage | Choose Gaia if you are using it. |
<td>A valid email address. If you are submitting an example of Animal Kingdom sample,this is the email where we will send you instructions for getting your Zero to DApp t-shirt.</td> | Authentication | Choose Blockstack; Blockstack Authentication is required to participate in Animal Kingdom. |
</tr>
<tr>
<td><strong>App Name</strong></td>
<td>Name of your application. If you are submitting an example of Animal Kingdom sample, enter <code>USERNAME: Animal Kingdom</code>.</td>
</tr>
<tr>
<td><strong>Short description</strong></td>
<td>Describe your application.&nbsp;&nbsp;</td>
</tr>
<tr>
<td><strong>Website</strong></td>
<td>The URL of the website where you deployed your application.&nbsp;&nbsp;</td>
</tr>
<tr>
<td><strong>App icon URL</strong></td>
<td> <code>URL_DEPLOYED_SITE/icon-192x192.png</code> for example, <code>https://animalkingdoms.netlify.com/icon-192x192.png</code> &nbsp;&nbsp;</td>
</tr>
<tr>
<td><strong>Open Source URL</strong></td>
<td>The URL where your source code lives. If you are submitting an example of Animal Kingdom sample, you can leave this blank for a sample application.&nbsp;&nbsp;</td>
</tr>
<tr>
<td><strong>Twitter Handle</strong></td>
<td>Optionally enter a Twitter handle for your application, for example `@coolapp`.</td>
</tr>
<tr>
<td><strong>Category</strong></td>
<td>If you are submitting an example of Animal Kingdom sample, make sure you choose the <strong>Sample Blockstack Apps</strong> category.</td>
</tr>
<tr>
<td><strong>Blockchain</strong></td>
<td>If you are submitting an example of Animal Kingdom sample, leave this as is.</td>
</tr>
<tr>
<td><strong>Storage</strong></td>
<td>Choose Gaia if you are using it.</td>
</tr>
<tr>
<td><strong>Authentication</strong></td>
<td>Choose Blockstack; Blockstack Authentication is required to participate in Animal Kingdom.</td>
</tr>
</table>

24
src/includes/scaffolding.md

@ -1,23 +1,9 @@
You use the Blockstack App Generator to create scaffolding for a starter application. The generator can create scaffolding for any of these frameworks: You use the Blockstack App Generator to create scaffolding for a starter application. The generator can create scaffolding for any of these frameworks:
<table class="uk-table"> | Framework | Use this command to install |
<tr> | ---------------- | ---------------------------------- |
<th>Framework</th> | Plain Javascript | `npx generator-blockstack --plain` |
<th>Use this command to install</th> | React | `npx generator-blockstack --react` |
</tr> | Vue | `npx generator-blockstack --vue` |
<tr>
<td>Plain Javascript</td>
<td><code> npx generator-blockstack --plain</code></td>
</tr>
<tr>
<td>React</td>
<td><code> npx generator-blockstack --react</code></td>
</tr>
<tr>
<td>Vue</td>
<td><code> npx generator-blockstack --vue
</code></td>
</tr>
</table>
For example, to install a Vue scaffolding, you would use the `npx generator-blockstack --vue` command. For example, to install a Vue scaffolding, you would use the `npx generator-blockstack --vue` command.

28
src/pages/android/tutorial.md

@ -184,28 +184,12 @@ iniatial state by creating an emulator to run it in. Open Android Studio and do
3. Enter these fields in the **Create Android Project** page. 3. Enter these fields in the **Create Android Project** page.
<table class="uk-table"> | Name | Hello Android |
<tr> | ---------------- | --------------------------------------------------- |
<th>Name</th> | Package name | `blockstack.id.USERNAME.hello` |
<td><code>Hello Android</code></td> | Project location | `/home/USERNAME/AndroidStudioProjects/helloandroid` |
</tr> | Language | Select (Kotlin) |
<tr> | Minimum SDK | Select (API 21: Android 5.0 (Lollipop)) |
<th>Package name</th>
<td><code>blockstack.id.<i>USERNAME</i>.hello</code></td>
</tr>
<tr>
<th>Project location</th>
<td><code>/home/<i>USERNAME</i>/AndroidStudioProjects/helloandroid</code></td>
</tr>
<tr>
<th>Language</th>
<td>Select (Kotlin)</td>
</tr>
<tr>
<th>Minimum SDK</th>
<td>Select (API 21: Android 5.0 (Lollipop))</td>
</tr>
</table>
![](images/configure-activity.png) ![](images/configure-activity.png)

38
src/pages/develop/deploy-tips.md

@ -16,36 +16,14 @@ Before users can interact with your application, you must deploy it on a server
If you first populated your application with the Blockstack application generator, your application contains the starting blocks for configuring, building, and deploying your app. For example, the React template builds out a scaffolding with the following building blocks. If you first populated your application with the Blockstack application generator, your application contains the starting blocks for configuring, building, and deploying your app. For example, the React template builds out a scaffolding with the following building blocks.
<table class="uk-table"> | File or Directory | Description |
<tr> | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
<th>File or Directory</th> | node_modules/react-scripts | A set of scripts for that helps you kick off React projects without configuring, so you do not have to set up your project by yourself. |
<th>Description</th> | package.json | Contains a scripts section that includes a reference to the react-scripts, which are a dependency. This script creates a build directory containing your files for deployment. |
</tr> | public/favicon.ico | An example shortcut icon. |
<tr> | public/index.html | An entry page for an application. |
<td><code>node_modules/react-scripts</code></td> | public/manifest.json | A JSON file that describes your web application to the browser. |
<td>A set of scripts for that helps you kick off React projects without configuring, so you do not have to set up your project by yourself.</td> | cors | Contains example deployment files for cross-origin request configuration. |
</tr>
<tr>
<td><code>package.json</code></td>
<td>Contains a scripts section that includes a reference to the react-scripts, which are a dependency. This script creates a <code>build</code> directory containing your files for deployment.</td>
</tr>
<tr>
<td><code>public/favicon.ico</code></td>
<td>An example shortcut icon.</td>
</tr>
<tr>
<td><code>public/index.html</code></td>
<td>An entry page for an application.</td>
</tr>
<tr>
<td><code>public/manifest.json</code></td>
<td>A JSON file that describes your web application to the browser.&nbsp;&nbsp;</td>
</tr>
<tr>
<td><code>cors</code></td>
<td>Contains example deployment files for cross-origin request configuration.</td>
</tr>
</table>
If you use the generator to build Javascript or Vue scaffolding, your project configuration files will be different. If you use the generator to build Javascript or Vue scaffolding, your project configuration files will be different.

22
src/pages/ios/tutorial.md

@ -261,22 +261,12 @@ menu items and therefore these procedures may be differœent on your version.
5. On the **Choose options for your new project** dialog, set the following: 5. On the **Choose options for your new project** dialog, set the following:
<table class="uk-table uk-table-small"> | Product Name | `hello-blockstack-ios` |
<tr> | ----------------- | ---------------------- |
<th>Product Name</th> | Organization Name | USERNAME |
<td><code>hello-blockstack-ios</code></td> | User Interface | Storyboard |
</tr>
<tr> ![](images/choose-new-options.png)
<th>Organization Name</th>
<td><code><i>USERNAME</i></code></td>
</tr>
<tr>
<th>User Interface</th>
<td>Storyboard</td>
</tr>
</table>
![](images/choose-new-options.png)
6. Press **Next**. 6. Press **Next**.

9
src/pages/org/terms.md

@ -8,12 +8,3 @@ import { Glossary } from '@components/glossary'
# Glossary # Glossary
<Glossary data={props.glossary} /> <Glossary data={props.glossary} />
<!-- <table class="uk-table uk-table-large uk-table-striped"> -->
<!-- {% for member in site.data.glossary %} -->
<!-- <tr> -->
<!-- <th>{{ member.Term }}</th> -->
<!-- <td>{{ member.Definition }}</td> -->
<!-- </tr> -->
<!-- {% endfor %} -->
<!-- </table> -->

26
src/pages/org/wallet-use.md

@ -63,24 +63,11 @@ When you start the Stacks Wallet it prompts you to create a new or choose an exi
Initialize and configure your wallet according to the manufacturer's instructions before you use it with the Stacks Wallet software. Some hardware wallets require that you have additional software installed to support the hardware wallets interactions with the Stacks Wallet. Initialize and configure your wallet according to the manufacturer's instructions before you use it with the Stacks Wallet software. Some hardware wallets require that you have additional software installed to support the hardware wallets interactions with the Stacks Wallet.
<table class="uk-table uk-table-small uk-table-divider"> | Hardware wallet | Prerequisite software |
<tr> | --------------- | ---------------------------------------------------------------------- |
<th>Hardware wallet</th> | Trezor One | [Trezor Bridge](https://doc.satoshilabs.com/trezor-user/download.html) |
<th>Prerequisite software</th> | Ledger Nano S | None. |
</tr> | Ledger Blue | None. |
<tr>
<td>Trezor One</td>
<td><a href="https://doc.satoshilabs.com/trezor-user/download.html" target="\_blank">Trezor Bridge</a></td>
</tr>
<tr>
<td>Ledger Nano S</td>
<td>None.</td>
</tr>
<tr>
<td>Ledger Blue</td>
<td>None.</td>
</tr>
</table>
Make sure you have installed any prerequisite software. It is a good idea to connect your hardware wallet to your computer before starting the Stacks Wallet software, but it is not required. Make sure you have installed any prerequisite software. It is a good idea to connect your hardware wallet to your computer before starting the Stacks Wallet software, but it is not required.
@ -200,8 +187,7 @@ If you attempt to send STX with your wallet and you do not have enough Bitcoin t
To increase your Bitcoin for transactions, do the following: To increase your Bitcoin for transactions, do the following:
1. Click the <span class="uk-margin-small-center" uk-icon="cog"></span> 1. Click the settings icon in the upper right corner of the wallet.
(settings icon) in the upper right corner of the wallet.
The system opens the **Settings** dialog. The system opens the **Settings** dialog.

80
src/pages/storage/gaia-admin.md

@ -51,74 +51,24 @@ The `port` is the port where Gaia is running. The `apiKeys` field is key used fo
The `argsTransport` section configures the hub logging. The service uses the `winston` logging service. Refer to their documentation for full details on the [logging configuration options](https://github.com/winstonjs/winston). The `argsTransport` section configures the hub logging. The service uses the `winston` logging service. Refer to their documentation for full details on the [logging configuration options](https://github.com/winstonjs/winston).
<table class="uk-table uk-table-small uk-table-divider"> | Field | Description |
<thead> | --------------- | ------------------------------------------------------------------------ |
<tr> | level | Lowest level this transport will log. (default: `info`) |
<th>Field</th> | handleException | Set to true to have this transport handle exceptions. (default: `false`) |
<th>Description</th> | timestamp | The timestamp when the message was received. |
</tr> | stringify | Converts the output to a JSON string. |
</thead> | colorize | Colorizes the standard logging level |
<tbody> | json | Log format. |
<tr>
<td><code>level</code></td>
<td>Lowest level this transport will log. (default: <code>info</code>)</td>
</tr>
<tr>
<td><code>handleException</code></td>
<td>Set to true to have this transport handle exceptions. (default: <code>false</code>)</td>
</tr>
<tr>
<td><code>timestamp</code></td>
<td>The timestamp when the message was received.</td>
</tr>
<tr>
<td><code>stringify</code></td>
<td>Converts the output to a JSON string.</td>
</tr>
<tr>
<td><code>colorize</code></td>
<td>Colorizes the standard logging level</td>
</tr>
<tr>
<td><code>json</code></td>
<td>Log format.</td>
</tr>
</tbody>
</table>
The `reloadSettings` configure the command that is used to reload your Gaia hub. The `reloadSettings` configure the command that is used to reload your Gaia hub.
<table class="uk-table uk-table-small uk-table-divider"> | Field | Description |
<thead> | ------- | ------------------------------------------------------------------------------------------------------------------- |
<tr> | command | A command which reloads the Gaia hub service. |
<th>Field</th> | argv | An array containing the command arguments. |
<th>Description</th> | env | This is a key/value list of any environment variables that need to be set for the command to run. This is optional. |
</tr> | setuid | This is the UID under which the command will be run. This is optional. |
</thead> | setgid | This is the GID under which the command will run. This is optional. |
<tbody>
<tr>
<td><code>command</code></td>
<td>A command which reloads the Gaia hub service.</td>
</tr>
<tr>
<td><code>argv</code></td>
<td>An array containing the command arguments.</td>
</tr>
<tr>
<td><code>env</code></td>
<td>This is a key/value list of any environment variables
that need to be set for the command to run. This is optional.</td>
</tr>
<tr>
<td><code>setuid</code></td>
<td>This is the UID under which the command will be run. This is optional.</td>
</tr>
<tr>
<td><code>setgid</code></td>
<td>This is the GID under which the command will run. This is optional.</td>
</tr>
</tbody>
</table>
## Using the admin service APIs ## Using the admin service APIs

145
src/pages/storage/overview.md

@ -53,133 +53,18 @@ Client libraries (such as `blockstack.js`) are capable of providing these guaran
Here's how Gaia stacks up against other decentralized storage systems. Features Here's how Gaia stacks up against other decentralized storage systems. Features
that are common to all storage systems are omitted for brevity. that are common to all storage systems are omitted for brevity.
<table class="uk-table uk-table-striped"> | Features | [Gaia](https://github.com/blockstack/gaia) | [Sia](https://sia.tech/) | [Storj](https://storj.io/) | [IPFS](https://ipfs.io/) | [DAT](https://datproject.org/) | [SSB](https://www.scuttlebutt.nz/) |
<thead> | ------------------------------------------ | ------------------------------------------ | ------------------------ | -------------------------- | ------------------------ | ------------------------------ | ---------------------------------- |
<tr> | User controls where data is hosted | X | | | | | |
<th>Features</th> | Data can be viewed in a normal Web browser | X | | | X | | |
<th>Gaia</th> | Data is read/write | X | | | | X | X |
<th><a href="https://sia.tech/" target="\_blank">Sia</a></th> | Data can be deleted | X | | | | X | X |
<th><a href="https://storj.io/" target="\_blank">Storj</a></th> | Data can be listed | X | X | X | | X | X |
<th><a href="https://ipfs.io/" target="\_blank">IPFS</a></th> | Deleted data space is reclaimed | X | X | X | X | | |
<th><a href="https://datproject.org/" target="\_blank">DAT</a></th> | Data lookups have predictable performance | X | | X | | | |
<th><a href="https://www.scuttlebutt.nz/" target="\_blank">SSB</a></th> | Writes permission can be delegated | X | | | | | |
</tr> | Listing permission can be delegated | X | | | | | |
</thead> | Supports multiple backends natively | X | | X | | | |
<tr> | Data is globally addressable | X | X | X | X | X | |
<td>User controls where data is hosted</td> | Needs a cryptocurrency to work | | X | X | | | |
<td>X</td> | Data is content-addressed | | X | X | X | X | X |
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Data can be viewed in a normal Web browser</td>
<td>X</td>
<td></td>
<td></td>
<td>X</td>
<td></td>
<td></td>
</tr>
<tr>
<td>Data is read/write</td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td>Data can be deleted</td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td>Data can be listed</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td>Deleted data space is reclaimed</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<td></td>
</tr>
<tr>
<td>Data lookups have predictable performance</td>
<td>X</td>
<td></td>
<td>X</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Writes permission can be delegated</td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Listing permission can be delegated</td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Supports multiple backends natively</td>
<td>X</td>
<td></td>
<td>X</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Data is globally addressable</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
</tr>
<tr>
<td>Needs a cryptocurrency to work</td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Data is content-addressed</td>
<td></td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
</tr>
</table>

1006
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save