From df2636b0cb4fe1ebdc37ded808a40b0bb4b9f6f1 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Mon, 24 Sep 2018 17:58:31 -0400 Subject: [PATCH 01/15] one step forward, two steps back --- app/components/resources-link-grid.js | 22 ++++++++++++++++++++++ app/views/redirect.js | 8 +++----- documents/resources.md | 6 +----- 3 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 app/components/resources-link-grid.js diff --git a/app/components/resources-link-grid.js b/app/components/resources-link-grid.js new file mode 100644 index 0000000..a09c742 --- /dev/null +++ b/app/components/resources-link-grid.js @@ -0,0 +1,22 @@ +"use strict"; + +import linkGrid from "./link-grid" + +export default () => { + return linkGrid([{ + title: "Whitepaper", + description: "It's a white paper", + destination: "/whitepaper", + label: "Read" + }, { + title: "Blockchain Docs", + description: "Learn how to talk to blockchain real good", + destination: "/api/blockchain", + label: "Blockchain API" + }, { + title: "LBRYnet docs", + description: "Learn wtf this is", + destination: "/api/protocol", + label: "SDK API LOL" + }]); +} diff --git a/app/views/redirect.js b/app/views/redirect.js index 1593f45..e4b936d 100644 --- a/app/views/redirect.js +++ b/app/views/redirect.js @@ -113,20 +113,18 @@ module.exports = exports = (state, emit) => { // eslint-disable-line // H E L P E R S function partialFinder(markdownBody) { - const regexToFindPartials = /<\w+\/>/g; + const regexToFindPartials = /<\w+ ?\/>/g; const partials = markdownBody.match(regexToFindPartials); if (!partials) return markdownBody; for (const partial of partials) { - const filename = decamelize(partial, "-").replace("<", "").replace("/>", ""); + const filename = decamelize(partial, "-").replace("<", "").replace("/>", "").trim(); const fileExistsTest = exists(`./app/components/${filename}.js`); // `local` results in error if used here and file !exist if (!fileExistsTest) { markdownBody = markdownBody.replace(partial, ""); - } - - else { + } else { const partialFunction = require(path.join(__dirname, "..", `./components/${filename}.js`)); if (filename === "glossary-toc") markdownBody = markdownBody.replace(partial, partialFunction); diff --git a/documents/resources.md b/documents/resources.md index ef08db8..8afbc25 100644 --- a/documents/resources.md +++ b/documents/resources.md @@ -2,11 +2,7 @@ title: Resources --- -## Showcase - -- [Whitepaper](https://lbry-whitepaper.herokuapp.com) -- [Blockchain API](/api/blockchain) -- [Protocol API](/api/protocol) + ## Additional Resources -- 2.45.2 From ae28c13a7010de3b2ac8d948cbb19a354c26576b Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Tue, 25 Sep 2018 12:51:21 -0400 Subject: [PATCH 02/15] move border to home --- app/sass/pages/_home.scss | 1 + app/sass/partials/_link-grid.scss | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/sass/pages/_home.scss b/app/sass/pages/_home.scss index 8b79cfd..f1ec197 100644 --- a/app/sass/pages/_home.scss +++ b/app/sass/pages/_home.scss @@ -63,6 +63,7 @@ .features { grid-area: features; + border-bottom: 1px solid rgba($black, 0.05); } .intro, diff --git a/app/sass/partials/_link-grid.scss b/app/sass/partials/_link-grid.scss index 8f4d04f..1436201 100644 --- a/app/sass/partials/_link-grid.scss +++ b/app/sass/partials/_link-grid.scss @@ -1,6 +1,5 @@ .link-grid { align-content: center; - border-bottom: 1px solid rgba($black, 0.05); display: flex; flex-flow: row wrap; list-style-type: none; -- 2.45.2 From 031d2e347e4d29889e0d3bde9a32e8fda9c5feea Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 30 Sep 2018 13:05:15 -0400 Subject: [PATCH 03/15] update community --- app/components/feature-links.js | 42 ++++++++++++--------------- app/sass/partials/_feature-links.scss | 33 +++++++++++---------- documents/community.md | 6 ++-- 3 files changed, 40 insertions(+), 41 deletions(-) diff --git a/app/components/feature-links.js b/app/components/feature-links.js index a85a384..00c193b 100644 --- a/app/components/feature-links.js +++ b/app/components/feature-links.js @@ -7,36 +7,32 @@ const links = [ // TODO: Update images { href: "https://chat.lbry.io", - image: "http://static.simpledesktops.com/static/images/sd-bg.png", - title: "Join us in chat" - }, - { - href: "https://lbry.io/developer", - image: "http://static.simpledesktops.com/uploads/desktops/2017/02/28/GeoShapes_2880x1800.png", - title: "Join the developer email list" - }, - { - href: "https://lbry.io/meet", image: "http://static.simpledesktops.com/uploads/desktops/2016/12/05/Untitled-1-03-01.png", - title: "Host a meet-up" + title: "Chat (Discord)" + }, + { + href: "https://discourse.lbry.io", + image: "http://static.simpledesktops.com/uploads/desktops/2017/02/28/GeoShapes_2880x1800.png", + title: "Developer Forum" + }, + { + href: "https://lbry.fund", + image: "http://static.simpledesktops.com/uploads/desktops/2015/08/20/Sunset_by_Banned.png", + title: "lbry.fund (Project Funding)" }, { href: "https://www.reddit.com/r/lbry", image: "http://static.simpledesktops.com/uploads/desktops/2016/08/28/Wind-Vector-resize.png", title: "Reddit" }, - { - href: "https://lbry.fund", - image: "http://static.simpledesktops.com/uploads/desktops/2015/08/20/Sunset_by_Banned.png", - title: "Get funding for a project" - }, { href: "https://lbry.io/join-us", image: "http://static.simpledesktops.com/uploads/desktops/2015/09/25/Siri.png", - title: "Get a job" + title: "Join Our Team" }, { href: "https://twitter.com/lbryio", + image: "http://static.simpledesktops.com/static/images/sd-bg.png", title: "Twitter" } ]; @@ -55,7 +51,7 @@ export default function () { } return ` - + `; } @@ -65,14 +61,14 @@ export default function () { function returnLinkTemplate(url, title, image) { return ` - + `; } diff --git a/app/sass/partials/_feature-links.scss b/app/sass/partials/_feature-links.scss index 53f4364..89880cc 100644 --- a/app/sass/partials/_feature-links.scss +++ b/app/sass/partials/_feature-links.scss @@ -1,13 +1,17 @@ +$width-feature-link: 320px; + .feature-links { display: grid; grid-gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(320px,1fr)); list-style-type: none; padding-top: 0.5rem; + margin-bottom: 2rem; } .feature-link { - width: 320px; min-height: 135px; + width: $width-feature-link; + min-height: 135px; background-color: $white; border: 1px solid rgba($black, 0.1); @@ -18,15 +22,6 @@ transition: box-shadow 0.2s; vertical-align: top; - > div:first-of-type { - top: 85px; left: 5%; - - position: relative; - text-align: center; - width: 90%; - z-index: 1; - } - &:not(:hover) { .feature-link__background { filter: brightness(0.5); @@ -43,17 +38,23 @@ } .feature-link__title { + top: 85px; + position: relative; + font-weight: normal; + text-align: center; + z-index: 1; + font-size: 1rem; + transition: color 0.2s; +} + +.feature-link__title-inner { + display: inline-block; + padding: .25rem .5rem; background-color: $white; border: 1px solid rgba(gray, 0.1); box-shadow: 0 2px 5px rgba($black, 0.025); border-radius: 3px; box-decoration-break: clone; - display: inline; - font-size: 1rem; - line-height: 1.7; - padding: 0.25rem 0.5rem; - transition: color 0.2s; - position: relative; } .feature-link__background { diff --git a/documents/community.md b/documents/community.md index b387987..bae37c3 100644 --- a/documents/community.md +++ b/documents/community.md @@ -2,10 +2,12 @@ title: Community --- -Sometimes we say that the LBRY [[blockchain]] is the foundation of the LBRY protocol, but that's a lie. +Sometimes we say that the LBRY [[blockchain]] is the foundation of the LBRY protocol, but that's not really true. The foundation of LBRY is the community of people that make it possible. -The foundation of LBRY is the community of people that make it possible. LBRY uses computers to move bits around, but it's people that tell them how. +Get [upstream of consensus](https://spee.ch/d/consensus.png) by participating in the LBRY community. ## Commune Yourself + +

And don't forget to sign up for developer-only mailing list, below.

-- 2.45.2 From 26487ff4bd6ac632f93415f0a40d91b097c6a987 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 30 Sep 2018 13:34:29 -0400 Subject: [PATCH 04/15] midway thru many things --- app/components/ecosystem/module-lbry.js | 2 +- app/components/ecosystem/module-lbrycrd.js | 2 +- app/components/resources-link-grid.js | 10 ++--- .../api-scripts.js => dist/scripts/api.js} | 0 app/sass/_layout.scss | 23 ----------- app/sass/pages/_api.scss | 9 +++- app/sass/pages/_home.scss | 17 ++++++++ app/sass/pages/_page.scss | 2 - app/sass/partials/_link-grid.scss | 5 ++- app/views/404.js | 0 app/views/api.js | 34 +++++++++++---- app/views/home.js | 41 +++++++------------ documents/resources.md | 14 +++---- .../{signing-claim.md => claim-signing.md} | 0 documents/resources/{pow.md => consensus.md} | 19 +++++---- documents/resources/schema.md | 14 +++---- 16 files changed, 98 insertions(+), 94 deletions(-) rename app/{components/client/api-scripts.js => dist/scripts/api.js} (100%) create mode 100644 app/views/404.js rename documents/resources/{signing-claim.md => claim-signing.md} (100%) rename documents/resources/{pow.md => consensus.md} (51%) diff --git a/app/components/ecosystem/module-lbry.js b/app/components/ecosystem/module-lbry.js index 7af3b27..561bf8f 100644 --- a/app/components/ecosystem/module-lbry.js +++ b/app/components/ecosystem/module-lbry.js @@ -35,7 +35,7 @@ module.exports = exports = () => `

Additional Resources

    -
  • See the Whitepaper for a more comprehensive introduction to the LBRY data network.
  • +
  • See the Whitepaper for a more comprehensive introduction to the LBRY data network.
  • See Resources for documentation of the LBRY APIs.
  • See [[Whatever]] for learning more about LBRY distributes data.
  • See Build for learning how to use the daemon to solve your own problem or build your own app!
  • diff --git a/app/components/ecosystem/module-lbrycrd.js b/app/components/ecosystem/module-lbrycrd.js index 390b3af..8798179 100644 --- a/app/components/ecosystem/module-lbrycrd.js +++ b/app/components/ecosystem/module-lbrycrd.js @@ -32,7 +32,7 @@ module.exports = exports = () => `

    Additional Resources

      -
    • See the Whitepaper for a more comprehensive introduction to the LBRY blockchain.
    • +
    • See the Whitepaper for a more comprehensive introduction to the LBRY blockchain.
    • See the Resources for documentation about the LBRY blockchain, including its API.
    • See [[Naming]] for learning more about LBRY URLs and how they work.
    • See [[Identities]] for learning how the LBRY blockchain handles publisher identities.
    • diff --git a/app/components/resources-link-grid.js b/app/components/resources-link-grid.js index a09c742..be9c99b 100644 --- a/app/components/resources-link-grid.js +++ b/app/components/resources-link-grid.js @@ -8,15 +8,15 @@ export default () => { description: "It's a white paper", destination: "/whitepaper", label: "Read" + }]) + linkGrid([ { + title: "LBRY SDK APIs", + description: "The LBRY SDK is the simplest way to start building with LBRY.", + destination: "/api/protocol", + label: "LBRY SDK API" }, { title: "Blockchain Docs", description: "Learn how to talk to blockchain real good", destination: "/api/blockchain", label: "Blockchain API" - }, { - title: "LBRYnet docs", - description: "Learn wtf this is", - destination: "/api/protocol", - label: "SDK API LOL" }]); } diff --git a/app/components/client/api-scripts.js b/app/dist/scripts/api.js similarity index 100% rename from app/components/client/api-scripts.js rename to app/dist/scripts/api.js diff --git a/app/sass/_layout.scss b/app/sass/_layout.scss index 366d646..ea43588 100644 --- a/app/sass/_layout.scss +++ b/app/sass/_layout.scss @@ -15,29 +15,6 @@ body { overflow-x: hidden; position: relative; z-index: 0; - - &:not(.home) { - main > div:first-of-type { - flex: 1; - } - } - - &.home { - @media (min-width: 1001px) { - main > div:first-of-type { - display: grid; - grid-gap: 0; - grid-template-areas: - "header header header" - "features features features" - "intro intro github" - "docs docs github" - "contribute contribute contribute" - "develop develop develop" - "community community community"; - } - } - } } main { diff --git a/app/sass/pages/_api.scss b/app/sass/pages/_api.scss index e57ca6e..51fd43b 100644 --- a/app/sass/pages/_api.scss +++ b/app/sass/pages/_api.scss @@ -6,7 +6,8 @@ */ .__slate { - width: 100%; height: 100%; + width: 100%; + height: 100%; position: relative; &::after { @@ -14,6 +15,10 @@ } } +.api__header +{ + color: red; +} /** @@ -34,7 +39,7 @@ .api__toc { width: 200px; height: calc(100vh - 4rem); // navigation is 4rem tall - top: 4rem; left: 0; bottom: 0; + left: 0; bottom: 0; background-color: $white; border-right: 1px solid rgba($gray, 0.3); diff --git a/app/sass/pages/_home.scss b/app/sass/pages/_home.scss index f1ec197..36d5eda 100644 --- a/app/sass/pages/_home.scss +++ b/app/sass/pages/_home.scss @@ -1,3 +1,20 @@ +body.home { + @media (min-width: 1001px) { + main > div:first-of-type { + display: grid; + grid-gap: 0; + grid-template-areas: + "header header header" + "features features features" + "intro intro github" + "docs docs github" + "contribute contribute contribute" + "develop develop develop" + "community community community"; + } + } +} + .home { padding-right: env(safe-area-inset-right); padding-left: env(safe-area-inset-left); diff --git a/app/sass/pages/_page.scss b/app/sass/pages/_page.scss index 4d01db3..a1b86c8 100644 --- a/app/sass/pages/_page.scss +++ b/app/sass/pages/_page.scss @@ -5,8 +5,6 @@ height: 100%; } - - .page__header-wrap { width: 100%; } diff --git a/app/sass/partials/_link-grid.scss b/app/sass/partials/_link-grid.scss index 1436201..caf0a78 100644 --- a/app/sass/partials/_link-grid.scss +++ b/app/sass/partials/_link-grid.scss @@ -3,14 +3,15 @@ display: flex; flex-flow: row wrap; list-style-type: none; - padding-top: 2rem; - padding-bottom: 2rem; + margin-top: 2rem; + margin-bottom: 2rem; } .link-grid__link { position: relative; text-align: center; vertical-align: top; + flex-grow: 1; @media (min-width: 651px) { width: 50%; diff --git a/app/views/404.js b/app/views/404.js new file mode 100644 index 0000000..e69de29 diff --git a/app/views/api.js b/app/views/api.js index b717103..75338ff 100644 --- a/app/views/api.js +++ b/app/views/api.js @@ -7,17 +7,31 @@ import asyncHtml from "choo-async/html"; import dedent from "dedent"; import fs from "graceful-fs"; -import raw from "choo/html/raw"; const fetch = require("make-fetch-happen").defaults({ cacheManager: "./cache" }); -// V A R I A B L E +/* +module.exports = exports = state => parseApiFile(state.params.wildcard).then(response => asyncHtml` +
      + I am a walrus. +
      +
      + - - -// E X P O R T +
      ${createApiContent(response)}
      +
      + + +`); + */ module.exports = exports = state => parseApiFile(state.params.wildcard).then(response => { /* @@ -51,6 +65,7 @@ module.exports = exports = state => parseApiFile(state.params.wildcard).then(res + // H E L P E R S function createApiContent(apiDetails) { @@ -99,9 +114,10 @@ function createApiSidebar(apiDetails) { function parseApiFile(urlSlug) { let apiFileLink; - if (!urlSlug || urlSlug === "api" || urlSlug === "protocol") apiFileLink = process.env.NODE_ENV === "development" ? + //checks below are related to rate limits, both URLs should return the same content + if (urlSlug === "sdk") apiFileLink = process.env.NODE_ENV === "development" ? "https://rawgit.com/lbryio/lbry/master/docs/api.json" : - "https://cdn.rawgit.com/lbryio/lbry/5b3103e4/docs/api.json" + "https://cdn.rawgit.com/lbryio/lbry/master/docs/api.json" ; if (urlSlug === "blockchain") apiFileLink = process.env.NODE_ENV === "development" ? @@ -109,7 +125,7 @@ function parseApiFile(urlSlug) { "https://cdn.rawgit.com/lbryio/lbrycrd/add_api_docs_scripts/contrib/devtools/generated/api_v1.json" ; - if (!apiFileLink) return; // TODO: Error handling + if (!apiFileLink) return Promise.reject(new Error("Failed to fetch API docs")); // TODO: Error handling return fetch(apiFileLink).then(() => fetch(apiFileLink, { cache: "no-cache" // forces a conditional request diff --git a/app/views/home.js b/app/views/home.js index cd60c28..b64e3ed 100644 --- a/app/views/home.js +++ b/app/views/home.js @@ -1,34 +1,8 @@ "use strict"; - - -// P A C K A G E - import html from "choo/html"; - -// V A R I A B L E - import linkGrid from "../components/link-grid"; - - -// E X P O R T - -const featureLinks = linkGrid([ - { - description: "Learn how LBRY works with 3 easy examples", - destination: "/playground", - label: "Jump into Playground", - title: "New to LBRY?" - }, - { - description: "Help make LBRY better!", - destination: "/contribute", - label: "Explore our repos", - title: "Want to contribute?" - } -]); - module.exports = exports = () => html`
      @@ -41,7 +15,20 @@ module.exports = exports = () => html`
      - ${featureLinks} + ${linkGrid([ + { + description: "Learn how LBRY works with 3 easy examples", + destination: "/tour", + label: "Take the Tour", + title: "New to LBRY?" + }, + { + description: "Help make LBRY better!", + destination: "/contribute", + label: "Explore our repos", + title: "Want to contribute?" + } + ])}
      diff --git a/documents/resources.md b/documents/resources.md index 8afbc25..8b46dca 100644 --- a/documents/resources.md +++ b/documents/resources.md @@ -6,14 +6,14 @@ title: Resources ## Additional Resources +- [LBRY URIs](/resources/uri) +- [LBRY Claim Metadata Schema](/resources/schema) +- [LBRY Merkle Claim Trie](/resources/claimtrie) +- [LBRY Consensus Algorithm](/resources/consensus) - [Download Overview](/resources/download-overview) -- [Lighthouse API](https://lbryio.github.io/lighthouse) -- [Merkle Claim Trie](/resources/claimtrie) -- [LBRY Claimtrie](/resources/lbry-claimtrie) -- [The LBRY Proof of Work (POW) Algorithm](/resources/pow) -- [Regtest Setup](/resources/regtest-setup) -- [Schema](/resources/schema) - [Signing a claim](/resources/signing-claim) -- [URI](/resources/uri) - [API Wrappers](/resources/api-wrappers) - [LBRY Daemon Settings](/resources/daemon-settings) +- [Claim Signing](/resources/signing-claim) +- [Regtest Setup](/resources/regtest-setup) +- [Lighthouse (search) API](https://lbryio.github.io/lighthouse) diff --git a/documents/resources/signing-claim.md b/documents/resources/claim-signing.md similarity index 100% rename from documents/resources/signing-claim.md rename to documents/resources/claim-signing.md diff --git a/documents/resources/pow.md b/documents/resources/consensus.md similarity index 51% rename from documents/resources/pow.md rename to documents/resources/consensus.md index cee5d8e..9e357d2 100644 --- a/documents/resources/pow.md +++ b/documents/resources/consensus.md @@ -1,9 +1,10 @@ -# The LBRY Proof of Work (POW) Algorithm +# LBRY Consensus Algorithm -LBRY uses [proof of work](https://en.bitcoin.it/wiki/Proof_of_work) the same way that Bitcoin does. The -only difference is the hash function. LBRY uses a slightly different algorithm that achieves the same ends but slightly delayed the development of a GPU miner and gave early adopters a chance to mine without specialized hardware. +LBRY uses [proof of work](https://en.bitcoin.it/wiki/Proof_of_work) as a consensus mechanism, the same way that Bitcoin does. -LBRY's algorithm is +LBRY has differences in hash function, block targeting, and difficult adjustment. + +### Hash Mechanism ```python intermediate = sha512(sha256(sha256(data))) # compute the sha512() of the double-sha256() of the data @@ -12,8 +13,10 @@ right = ripemd(intermediate[len(intermediate)/2:]) # and the right half proof = sha256(sha256(left + right)) # concatenate the two halves, and double-sha256() it again ``` -For comparison, Bitcoin's algorithm is... +### Block Targeting -```python -proof = sha256(sha256(data)) -``` +_PR this_. + +### Difficulty Adjustment + +_PR this_. diff --git a/documents/resources/schema.md b/documents/resources/schema.md index d7c946d..f755268 100644 --- a/documents/resources/schema.md +++ b/documents/resources/schema.md @@ -1,4 +1,4 @@ -# Schema +# LBRY Claim Metadata Schema The schema defines the structure of the data that is stored in claims in the LBRY blockchain. It has several goals: @@ -25,7 +25,7 @@ message Claim { certificateType = 2; } required ClaimType claimType = 2; - + optional Stream stream = 3; optional Certificate certificate = 4; optional Signature publisherSignature = 5; @@ -46,7 +46,7 @@ message Stream { _0_0_1 = 1; } required Version version = 1; - + required Metadata metadata = 2; required Source source = 3; } @@ -72,7 +72,7 @@ message Metadata { en = 1; } required Language language = 2; - + required string title = 3; required string description = 4; required string author = 5; @@ -80,7 +80,7 @@ message Metadata { required bool nsfw = 7; optional Fee fee = 8; - + optional string thumbnail = 9; optional string preview = 10; optional string licenseUrl = 11; @@ -159,7 +159,7 @@ message Certificate { _0_0_1 = 1; } required Version version = 1; - + required KeyType keyType = 2; required bytes publicKey = 4; } @@ -177,7 +177,7 @@ message Signature { _0_0_1 = 1; } required Version version = 1; - + required KeyType signatureType = 2; required bytes signature = 3; required bytes certificateId = 4; -- 2.45.2 From aa912035a78741259d534f23a0ff6c3e99803d08 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 30 Sep 2018 15:56:48 -0400 Subject: [PATCH 05/15] crappy redirects, 404 tweak, markdown img --- app/data/redirects.json | 5 +++++ app/modules/redirect.js | 4 ++++ app/sass/init/_markdown.scss | 7 +++++++ app/views/404.js | 26 ++++++++++++++++++++++++++ app/views/redirect.js | 26 +++++++++----------------- 5 files changed, 51 insertions(+), 17 deletions(-) create mode 100644 app/data/redirects.json create mode 100644 app/modules/redirect.js diff --git a/app/data/redirects.json b/app/data/redirects.json new file mode 100644 index 0000000..d524784 --- /dev/null +++ b/app/data/redirects.json @@ -0,0 +1,5 @@ +{ + "/tour" : "/playground", + "/play" : "/playground", + "/whitepaper": "https://whitepaper.lbry.tech" +} diff --git a/app/modules/redirect.js b/app/modules/redirect.js new file mode 100644 index 0000000..cc02f28 --- /dev/null +++ b/app/modules/redirect.js @@ -0,0 +1,4 @@ +export default (url, code = 301) => { + console.log(code + ": " + url); + throw "fix this please, needs to redirect to:" + url; +} diff --git a/app/sass/init/_markdown.scss b/app/sass/init/_markdown.scss index 9b12971..6db7178 100644 --- a/app/sass/init/_markdown.scss +++ b/app/sass/init/_markdown.scss @@ -162,6 +162,13 @@ padding-left: 1.25rem; } + img { + display: block; + margin-left: auto; + margin-right: auto; + margin-bottom: 1rem; + } + p { img { float: right; diff --git a/app/views/404.js b/app/views/404.js index e69de29..448e415 100644 --- a/app/views/404.js +++ b/app/views/404.js @@ -0,0 +1,26 @@ +"use strict"; + +import html from "choo/html"; + +export default () => { + return html` +
      + + +
      +
      +

      The requested page could not be found. Here is the image located at lbry://404 to console you.

      + +

      Think something should be here? Let us know by raising an issue.

      +
      +
      +
      + `; +}; + diff --git a/app/views/redirect.js b/app/views/redirect.js index e4b936d..a8ce8d4 100644 --- a/app/views/redirect.js +++ b/app/views/redirect.js @@ -11,6 +11,9 @@ import fs from "graceful-fs"; import html from "choo/html"; import path from "path"; import { require as local } from "app-root-path"; +import redirects from '../data/redirects.json'; +import redirect from "../modules/redirect"; +import Page404 from "./404.js"; import raw from "choo/html/raw"; // V A R I A B L E S @@ -46,23 +49,12 @@ module.exports = exports = (state, emit) => { // eslint-disable-line else path = state.params.wildcard; if (!fs.existsSync(`./documents/${path}.md`)) { - return html` -
      - - -
      -
      -

      The page you are looking for does not exist.

      -
      -
      -
      - `; + const redirectUrl = redirects[path] || redirects["/" + path] + if (redirectUrl) { + redirect(redirectUrl) + } else { + return Page404(); + } } const markdownFile = fs.readFileSync(`./documents/${path}.md`, "utf-8"); -- 2.45.2 From 517e2ac3a25197496aded37b1e5cdb04bdb30067 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 30 Sep 2018 17:22:09 -0400 Subject: [PATCH 06/15] redirects and contribute/glossary cleanup --- app/data/redirects.json | 3 +++ app/views/redirect.js | 4 ++-- documents/contribute.md | 20 ++++++++++---------- documents/glossary.md | 26 ++++++++++++++++++++++---- 4 files changed, 37 insertions(+), 16 deletions(-) diff --git a/app/data/redirects.json b/app/data/redirects.json index d524784..f17a7a8 100644 --- a/app/data/redirects.json +++ b/app/data/redirects.json @@ -1,5 +1,8 @@ { "/tour" : "/playground", "/play" : "/playground", + "/api/protocol" : "/api/sdk", + "/api/lbry" : "/api/sdk", + "/api/lbrycrd" : "/api/blockchain", "/whitepaper": "https://whitepaper.lbry.tech" } diff --git a/app/views/redirect.js b/app/views/redirect.js index a8ce8d4..1a67431 100644 --- a/app/views/redirect.js +++ b/app/views/redirect.js @@ -49,9 +49,9 @@ module.exports = exports = (state, emit) => { // eslint-disable-line else path = state.params.wildcard; if (!fs.existsSync(`./documents/${path}.md`)) { - const redirectUrl = redirects[path] || redirects["/" + path] + const redirectUrl = redirects[path] || redirects["/" + path]; if (redirectUrl) { - redirect(redirectUrl) + redirect(redirectUrl); } else { return Page404(); } diff --git a/documents/contribute.md b/documents/contribute.md index 79a9490..8681fba 100644 --- a/documents/contribute.md +++ b/documents/contribute.md @@ -14,22 +14,22 @@ Contributors that provide accepted pull requests, well-specified issues, or assi Typical usage of LBRY does not involve a single piece of software, but several interacting components. -If you want to contribute to LBRY, the first step is to understand where. +If you want to contribute to LBRY, there's definitely something for you! The first step is to figure out what project to work on. ### Core Protocol Components | Component | Language (Toolset) | What Is It --- | --- | --- -| [lbrycrd](https://github.com/lbryio/lbrycrd) | C++ | A full node for the LBRY blockchain, including a standalone wallet. Used by miners and some applications. Most consumer applications do not bundle `lbrycrd` directly. -| [lbry](https://github.com/lbryio/lbry) | Python (Twisted) | A daemon that implements the LBRY protocol. Bundled with and/or used by most LBRY applications. -| [torba](https://github.com/lbryio/torba) | Python | The Simple Payment Verification (SPV) wallet bundled with `lbry`. -| [lbryumx](https://github.com/lbryio/lbryumx) | Protobuf, Python | The wallet server for the `lbryum` SPV wallet. -| [lbry-schema](https://github.com/lbryio/lbryschema) | Protobuf, Python | The structure of the metadata stored in the LBRY blockchain. +| [lbrycrd](https://github.com/lbryio/lbrycrd) | C++ | A full node for the LBRY blockchain, including a standalone wallet. Used by miners and some applications. Most consumer applications do not bundle [[lbrycrd]] directly, and instead bundle [[lbry-sdk]]. +| [lbry-sdk](https://github.com/lbryio/lbry) | Python (Twisted) | A daemon that can be used directly or to develop other applications. Provides convenience [APIs](/api/sdk), bundles an SPV wallet ([[torba]]), and contains an implementation of the LBRY data network. | +| [torba](https://github.com/lbryio/torba) | Python | An [[SPV]] (Simple Payment Verification) wallet. Bundled with [[lbry-sdk]]. | +| [lbryumx](https://github.com/lbryio/lbryumx) | Protobuf, Python | The wallet server used by [[torba]]. +| [lbry-schema](https://github.com/lbryio/lbryschema) | Protobuf, Python | Defines the structure of the metadata stored in the LBRY blockchain. ### Official Applications | Application | Language (Toolset) | What Is It --- | --- | --- -| [lbry-desktop](https://github.com/lbryio/lbry-desktop) | JavaScript (ReactJS, Electron) | A graphical browser for the LBRY protocol for Windows, macOS, and Linux. `lbry-desktop` bundles `lbry` and is primarily frontend code. +| [lbry-desktop](https://github.com/lbryio/lbry-desktop) | JavaScript (ReactJS, Electron) | A graphical browser for the LBRY protocol for Windows, macOS, and Linux. [[lbry-desktop]] uses the [[lbry-sdk]] | [lbry-android](https://github.com/lbryio/lbry-desktop) | JavaScript (ReactNative), Python (kivy) | A graphical browser for the LBRY protocol for Android. `lbry-android` bundles `lbry` and is primarily frontend code. | [lbry-redux](https://github.com/lbryio/lbry-redux) | JavaScript (Redux) | A common codebase for shared Redux logic between `lbry-desktop` and `lbry-android`. | [spee.ch](https://github.com/lbryio/spee.ch) | JavaScript (Node, ReactJS, Express) | A web-based host for free LBRY content. Usable directly as a content link dump site or as a customized, standalone install. @@ -81,7 +81,7 @@ Most written content at LBRY is checked into source control. To improve content If you want to contribute without getting directly into the code, one of the best ways you can contribute is testing. -A number of our code bases (`lbrycrd`, `lbry`, all applications, more...) go through regular release cycles where new versions are shipped every several weeks. Testing pre-release versions is a great way to help us identify issues and ship bug-free code. +A number of our code bases ([[lbrycrd]], [[lbry-sdk]], all applications, more...) go through regular release cycles where new versions are shipped every several weeks. Testing pre-release versions is a great way to help us identify issues and ship bug-free code. For any projects that you want to be a tester on, "Watch" the repo on GitHub. You will receive an email with release notes whenever a release candidate is out. @@ -117,8 +117,8 @@ Feature requests are welcome. Before you submit one be sure to: 3. **Consider whether it's feasible** for us to tackle this feature in the next 6-12 months. The LBRY team is currently stretched thin just adding basic functionality. If this is a nice to have rather than a need, it is probably more clutter than helpful. 4. **Make a strong case** to convince the project's leaders of the merits of this feature. Please provide as much detail and context as possible. This means explaining the use case and why it is likely to be common. -## Tips +## Appreciation -We offer LBC as a thank you to anyone who contributes to LBRY. While we think we're fair-to-generous in our tips, tipping is more about recognizing and appreciating what you've given to the community than providing compensation. +We offer LBC as a gesture of our appreciation to anyone who contributes to LBRY. While we're generous in what we send, it is more about recognizing and appreciating what you've given to the community than providing compensation. The amount of LBC is not typically specified in advance of a contribution, though if you're particularly motivated by this aspect you are welcome to ask. diff --git a/documents/glossary.md b/documents/glossary.md index 6ca0dc9..6d0733a 100644 --- a/documents/glossary.md +++ b/documents/glossary.md @@ -136,9 +136,15 @@ The content price, set by the publisher, in order to download a claim. The key f The currency code for 1 LBRY Credit (defined as 100 000 000 *deweys*). -### LBRYCrd +### lbrycrd -LBRYcrd uses a blockchain similar to bitcoin's to implement an index and payment system for content on the LBRY network. It is a fork of Core. +lbrycrd is the authoritative implementation of the LBRY [[blockchain]] protocol. See [the source code](https://github.com/lbryio/lbrycrd), [the API](/api/blockchain), or [the whitepaper](/whitepaper). + +### lbry-sdk + +An [[SDK]] for the LBRY protocol that can also be used independently. Distributed as a daemon or bundled directly, it contains a set of convenience methods for developing applications, and bundles an [[SPV]] wallet as well as implementation of the data network. + +See [the source code](https://github/lbryio/lbry) or [the API documentation](/api/sdk). ### LBRY Credits @@ -272,6 +278,10 @@ Amount of newly generated LBRY credits that a *miner* may claim in a new block. A compact turing-incomplete programming language used in transaction *inputs* and *outputs*. Scripts are interpreted by a Forth-like stack machine: each operation manipulates data on the stack. Most scripts follow the standard pattern and verify the digital *signature* provided in the transaction *input* against a *public key* provided in the previous transaction's *output*. Both signatures and public keys are provided using scripts. Scripts may contain complex conditions, but can never change amounts being transferred. Amount is stored in a separate field in a *transaction output*. +### SDK + +An abbreviation for Software Development Kit. [[lbry-sdk]] is an SDK for developing applications that use the LBRY protocol. + ### Secret key Either the *Private Key* or an encryption key used in encrypted *wallets*. LBRY protocol does not use encryption anywhere, so *secret key* typically means a *private key* used for signing transactions. @@ -280,9 +290,9 @@ Either the *Private Key* or an encryption key used in encrypted *wallets*. LBRY A sequence of bytes that proves that a piece of data is acknowledged by a person holding a certain *public key*. LBRY, like Bitcoin, uses *ECDSA* for signing transactions. Amounts of credits are sent through a chain of transactions: from one to another. Every transaction must provide a signature matching a public key defined in the previous transaction. This way only a proper owner of a secret *private key* associated with a given public key can spend credits further. -### Simplified Payment Verification (SPV) +### Simplified Payment Verification -A scheme to validate transactions without storing the whole blockchain (only block headers) and without trusting any external service. Every transaction must be present with all its parent and sibling hashes in a *merkle tree* up to the root. SPV client trusts the most *difficult* chain of block headers and can validate if the transaction indeed belongs to a certain block header. Since SPV does not validate all transactions, a *51% attack* may not only cause a *double spend* (like with *full nodes*), but also make a completely invalid payment with credits created from nowhere. However, this kind of attack is very costly and probably more expensive than a product in question. +A scheme to validate transactions without storing the whole blockchain (only block headers) and without trusting any external service. Every transaction must be present with all its parent and sibling hashes in a *merkle tree* up to the root. SPV client trusts the most *difficult* chain of block headers and can validate if the transaction indeed belongs to a certain block header. Since SPV does not validate all transactions, a *51% attack* may not only cause a *double spend* (like with *full nodes*), but also make a completely invalid payment with credits created from nowhere. However, this kind of attack is very costly and probably more expensive than a product in question. Frequently abbreviated as SPV. ### Soft Fork @@ -296,6 +306,10 @@ Incorrect peer-to-peer messages (like sending invalid transactions) may be consi A transaction *output* can be spent only once: when another valid transaction makes a reference to this output from its own input. When another transaction attempts to spend the same output, it will be rejected by the nodes already seeing the first transaction. Blockchain as a *proof-of-work* scheme allows every node to agree on which transaction was indeed the first one. The whole transaction is considered spent when all its outputs are spent. +### SPV + +SPV is an abbreviation for [[Simplified Payment Verification]]. + ### Stream Streaming media is multimedia that is constantly received by and presented to an end-user while being delivered by a provider. In LBRY, streams as associated with claim data in order to provide the capability to download files over a Peer to Peer network. @@ -320,6 +334,10 @@ A 256-bit number that puts an upper limit for a block header hash to be valid. T A set of parameters used for testing a LBRY network. Testnet is like *mainnet*, but has a different genesis block (it was reset several times, the latest testnet is *testnet3*). Testnet uses slightly different *address* format to avoid confusion with main LBRY addresses and all nodes are relaying and mining non-standard transactions. +### Torba + +An [[SPV]] wallet for the LBRY [[blockchain]]. See the [source code](https://github.com/lbryio/torba). + ### Transaction A chunk of binary data that describes how credits are moved from one owner to another. Transactions are stored in the *[blockchain](#blockchain)*. Every transaction (except for *coinbase* transactions) has a reference to one or more previous transactions (*inputs*) and one or more rules on how to spend these credits further (*outputs*). See *Transaction Input* and *Transaction Output* for more info. -- 2.45.2 From a3c6276f82aa092310bbbe45ec0805ad0763940a Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 30 Sep 2018 19:43:35 -0400 Subject: [PATCH 07/15] contribute polish and lint fixes --- app/components/resources-link-grid.js | 4 +-- app/modules/redirect.js | 3 +- app/sass/init/_markdown.scss | 12 ++++--- app/views/api.js | 9 +++-- app/views/home.js | 26 +++++++------- app/views/redirect.js | 14 ++++---- documents/contribute.md | 50 ++++++++++++++++----------- documents/glossary.md | 4 +++ 8 files changed, 68 insertions(+), 54 deletions(-) diff --git a/app/components/resources-link-grid.js b/app/components/resources-link-grid.js index be9c99b..219e41c 100644 --- a/app/components/resources-link-grid.js +++ b/app/components/resources-link-grid.js @@ -1,6 +1,6 @@ "use strict"; -import linkGrid from "./link-grid" +import linkGrid from "./link-grid"; export default () => { return linkGrid([{ @@ -19,4 +19,4 @@ export default () => { destination: "/api/blockchain", label: "Blockchain API" }]); -} +}; diff --git a/app/modules/redirect.js b/app/modules/redirect.js index cc02f28..d6e4fa9 100644 --- a/app/modules/redirect.js +++ b/app/modules/redirect.js @@ -1,4 +1,3 @@ export default (url, code = 301) => { - console.log(code + ": " + url); throw "fix this please, needs to redirect to:" + url; -} +}; diff --git a/app/sass/init/_markdown.scss b/app/sass/init/_markdown.scss index 6db7178..8504e82 100644 --- a/app/sass/init/_markdown.scss +++ b/app/sass/init/_markdown.scss @@ -119,6 +119,12 @@ top: -1px; } } + + h2 { + margin-top: 2rem; + } + + h3, + h4, + h5 { + margin-top: 1.5rem; + } } p, @@ -147,10 +153,6 @@ margin-bottom: 0.25rem; } } - - + h2, + h3, + h4, + h5 { - padding-top: 2rem; - } } ol { @@ -170,6 +172,8 @@ } p { + margin-left: 2px; + margin-right: 2px; img { float: right; } diff --git a/app/views/api.js b/app/views/api.js index 75338ff..a202814 100644 --- a/app/views/api.js +++ b/app/views/api.js @@ -28,8 +28,7 @@ module.exports = exports = state => parseApiFile(state.params.wildcard).then(res
      ${createApiContent(response)}
      - - + `); */ @@ -52,14 +51,14 @@ module.exports = exports = state => parseApiFile(state.params.wildcard).then(res
        - + -
        ${raw(createApiContent(response).join(""))}
        +
        ${createApiContent(response)}
        - ${raw(apiScripts)} + `; }); diff --git a/app/views/home.js b/app/views/home.js index b64e3ed..94a0062 100644 --- a/app/views/home.js +++ b/app/views/home.js @@ -16,19 +16,19 @@ module.exports = exports = () => html`
        ${linkGrid([ - { - description: "Learn how LBRY works with 3 easy examples", - destination: "/tour", - label: "Take the Tour", - title: "New to LBRY?" - }, - { - description: "Help make LBRY better!", - destination: "/contribute", - label: "Explore our repos", - title: "Want to contribute?" - } - ])} + { + description: "Learn how LBRY works with 3 easy examples", + destination: "/tour", + label: "Take the Tour", + title: "New to LBRY?" + }, + { + description: "Help make LBRY better!", + destination: "/contribute", + label: "Explore our repos", + title: "Want to contribute?" + } + ])}
        diff --git a/app/views/redirect.js b/app/views/redirect.js index 1a67431..4e921f3 100644 --- a/app/views/redirect.js +++ b/app/views/redirect.js @@ -11,7 +11,7 @@ import fs from "graceful-fs"; import html from "choo/html"; import path from "path"; import { require as local } from "app-root-path"; -import redirects from '../data/redirects.json'; +import redirects from "../data/redirects.json"; import redirect from "../modules/redirect"; import Page404 from "./404.js"; import raw from "choo/html/raw"; @@ -130,12 +130,12 @@ function partialFinder(markdownBody) { function wikiFinder(markdownBody) { return markdownBody.replace(/\[\[([\w\s/-]+)\]\]/g, (match, p1) => { - const label = p1.trim(), - href = encodeURI("/glossary#" + label.replace(/\s+/g, '-')); + const label = p1.trim(), + href = encodeURI("/glossary#" + label.replace(/\s+/g, "-")); - return label ? - `${label}` : - match.input; - } + return label ? + `${label}` : + match.input; + } ); } diff --git a/documents/contribute.md b/documents/contribute.md index 8681fba..426e751 100644 --- a/documents/contribute.md +++ b/documents/contribute.md @@ -29,15 +29,15 @@ If you want to contribute to LBRY, there's definitely something for you! The fir ### Official Applications | Application | Language (Toolset) | What Is It --- | --- | --- -| [lbry-desktop](https://github.com/lbryio/lbry-desktop) | JavaScript (ReactJS, Electron) | A graphical browser for the LBRY protocol for Windows, macOS, and Linux. [[lbry-desktop]] uses the [[lbry-sdk]] -| [lbry-android](https://github.com/lbryio/lbry-desktop) | JavaScript (ReactNative), Python (kivy) | A graphical browser for the LBRY protocol for Android. `lbry-android` bundles `lbry` and is primarily frontend code. -| [lbry-redux](https://github.com/lbryio/lbry-redux) | JavaScript (Redux) | A common codebase for shared Redux logic between `lbry-desktop` and `lbry-android`. +| [lbry-desktop](https://github.com/lbryio/lbry-desktop) | JavaScript (ReactJS, Electron) | A graphical browser for the LBRY network for Windows, macOS, and Linux. [[lbry-desktop]] is built with [[lbry-sdk]]. | +| [lbry-android](https://github.com/lbryio/lbry-desktop) | JavaScript (ReactNative), Python (kivy) | A graphical browser for the LBRY network for Android. [[lbry-android]] is built with [[lbry-sdk]]. +| [lbry-redux](https://github.com/lbryio/lbry-redux) | JavaScript (Redux) | A common codebase for shared Redux logic between [[lbry-desktop]] and [[lbry-android]]. | [spee.ch](https://github.com/lbryio/spee.ch) | JavaScript (Node, ReactJS, Express) | A web-based host for free LBRY content. Usable directly as a content link dump site or as a customized, standalone install. ### Websites | Domain | Language (Toolset) | What Is It --- | --- | --- -| [lbry.tech](https://github.com/lbryio/lbry.tech) | JavaScript (Vue, Vuepress) | You're on it. +| [lbry.tech](https://github.com/lbryio/lbry.tech) | JavaScript (Node, Choo) | You're on it. | [lbry.io](https://github.com/lbryio/lbry.io) | PHP (vanilla) | A website for LBRY end-users and creators. | [lbry.fund](https://github.com/lbryio/lbry.fund) | HTML | A website for receiving funding from LBRY, Inc. @@ -48,20 +48,18 @@ If you want to contribute to LBRY, there's definitely something for you! The fir | [lighthouse](https://github.com/lbryio/lighthouse) | JavaScript, ElasticSearch | A search service for the LBRY blockchain. | [wunderbot](https://github.com/lbryio/lbry-wunderbot) | JavaScript (Node) | A chatbot used by the LBRY discord. | [block-explorer](https://github.com/lbryio/block-explorer) | PHP (vanilla) | A blockchain explorer for the LBRY blockchain. -| Add more? other tipbots... | ## Coding Several hundred extremely good-looking, intelligent and popular people, as well as our CTO, have contributed to LBRY. Join us! -Additionally, every technical employee of LBRY outside of the founding team started as a public contributor. - ### How To Contribute Code -1. **Identify the component you want to work on**. LBRY has code bases in Python, JavaScript, PHP, and C++. See [Ecosystem Overview](#ecosystem-overview). -1. **Get set up.** Each repo has a `README.md` with clear instructions on how to get the repo up and running properly. Thanks, [Repository Standards](/repository-standards)! -1. **Find something to work on**. All actively developed repositories should have issues tagged "Good First Issues" specifically for new contributors. Some projects use a "level: n" tagging system, where lower numbers are simpler and higher numbers are more complex. Of course, you are also welcome to work on something not currently filed if you have your own idea! Additionally, all repositories have contact information for the maintainer if you have trouble finding an issue to work on. -1. **Abide coding and commit standards**. Any specific information necessary to know in this regard should be in the `README`. +1. **Join the Community**. By joining our [chat](https://chat.lbry.io) or our [forum](https://discourse.lbry.io), you can interact with other developers when you have questions, ideas, or problems. +1. **Identify the component you want to work on**. LBRY has code bases that deal with everything from cryptography and distributed systems to end-user graphic user-interfaces. We use Python, JavaScript, C++, Go, and more. See [Ecosystem Overview](#ecosystem-overview) to find the right project. +1. **Get set up.** Each repo has a [[README]] with clear instructions on how to get the repo up and running properly. Thanks, [Repository Standards](/repository-standards)! +1. **Find something to work on**. All actively developed repositories should have issues tagged "Good First Issues" specifically for new contributors. You are also welcome to work on something not currently filed if you have your own idea. Additionally, all repositories have contact information for the maintainer if you have trouble finding an issue to work on. +1. **Abide coding and commit standards**. Any specific information necessary to know in this regard should be in the project [[README]]. 1. **Commit early and ask questions**. Is an issue confusing? Please comment and say so! Not sure if you've got the right approach? Commit your code and we'll give feedback. Certain you're doing everything right? Commit it anyway. Once you commit, open a pull request. We encourage work-in-progress commits to let us know you're working on something and to facilitate feedback. 1. **Accept feedback and finish**. Most pull requests are reviewed within two business days. Once the repository maintainer has approved your contribution, it will get merged and we'll try really hard to give you LBC even if you say no. @@ -69,12 +67,14 @@ Additionally, every technical employee of LBRY outside of the founding team star Web and application designers are requested to be able to work directly on CSS in the project they'd be contributing to. Please follow the [Coding](#coding) instructions for any website or application you want to improve. +We're happy to provide assistance if you're used to working in HTMl and CSS but are having trouble getting started. Check out [our chat](https://chat.lbry.io) or [our forum](https://discourse.lbry.io). + ## Writing -Most written content at LBRY is checked into source control. To improve content we've written: +Most written content, and especially all technical writing, is checked into source control. To improve content we've written or add new content: 1. Identify which website or application it is in (see the [overview])(#ecosystem-overview). -1. Search for a quoted phrase of the content you want to change. +1. Search for a quoted phrase of the content you want to change (or use the same technique to identify the folder to create a new document in). 1. Edit the content via the GitHub interface and submit it as a pull request. ## Testing @@ -83,19 +83,21 @@ If you want to contribute without getting directly into the code, one of the bes A number of our code bases ([[lbrycrd]], [[lbry-sdk]], all applications, more...) go through regular release cycles where new versions are shipped every several weeks. Testing pre-release versions is a great way to help us identify issues and ship bug-free code. -For any projects that you want to be a tester on, "Watch" the repo on GitHub. You will receive an email with release notes whenever a release candidate is out. +### Ways to Test -For even harder-core testing, you can follow the `README` instructions in a project and test against the `master` branch of a project at any time. Additionally, `master` builds for some projects are always available via [build.lbry.io](http://build.lbry.io). +- "Watch" the repo on GitHub. You will receive an email with release notes whenever a release candidate is out and you can [raise an issue](#raising-issues). +- Join the #early-testing channel in our [chat](https://chat.lbry.io). +- For the hardcore, run master from source and/or the latest builds from [build.lbry.io](http://build.lbry.io). Opening well-specified issues against release candidates or master builds is extremely useful in helping us create quality software. -**Note: that you perform testing at your own risk! If using release candidates and especially master builds, back up your wallet and be cautious.** +**Note: Please do not use wallets with substantial sums when testing. If using release candidates and especially master builds, back up your wallet and be cautious. While a substantial bug, like one that caused loss of funds, would merit significant [Appreciation](#appreciation), you perform testing at your own risk.** ## Raising Issues -If you're about to raise an issue because you've found a problem with LBRY, or you'd like to request a new feature, or for any other reason, please read this first. +All [bug reports](#reporting-a-bug) and [feature requests](#feature-requests) are managed through GitHub. -GitHub is the preferred channel for [bug reports](#reporting-a-bug) and [feature requests](#feature-requests). +If you're about to raise an issue because you've found a problem with LBRY, or you'd like to request a new feature, or for any other reason, please read this first. ### Reporting a Bug @@ -103,10 +105,10 @@ A bug is a _demonstrable problem_ that is caused by the code in the repository. Guidelines for bug reports: 1. **Identify the correct repo**. See [ecosystem overview](#ecosystem-overview). While it's okay if you get this wrong, it's a big help to us if you get it right. -2. **Use the GitHub issue search** — check if the issue has already been reported (or fixed). Be sure to include closed tickets in your search. -3. **Follow the instructions** — When you open an issue inside of GitHub, each repo contains a template for how to create a good bug report. Please follow it! +2. **Check if the issue exists**. Please do a quick search to see if the issue has been reported (or fixed), including closed tickets. +3. **Follow the instructions** - When you open an issue inside of GitHub, each repo contains a template for how to create a good bug report. Santa _loves_ people who follow it. -Well-specified bug reports save developers lots of time and are extremely appreciated, typically with an LBRY credit tip. +Well-specified bug reports save developers lots of time and are [appreciated](#appreciation). ### Feature Requests @@ -117,6 +119,12 @@ Feature requests are welcome. Before you submit one be sure to: 3. **Consider whether it's feasible** for us to tackle this feature in the next 6-12 months. The LBRY team is currently stretched thin just adding basic functionality. If this is a nice to have rather than a need, it is probably more clutter than helpful. 4. **Make a strong case** to convince the project's leaders of the merits of this feature. Please provide as much detail and context as possible. This means explaining the use case and why it is likely to be common. +### Discussion and Help + +Sometimes, you may have a problem but an issue isn't appropriate (or you're not sure if it's a real issue). + +Join our [chat](https://chat.lbry.io), our [forum](https://discourse.lbry.io), or another [community](https://lbry.tech/community) and talk to others about it. + ## Appreciation We offer LBC as a gesture of our appreciation to anyone who contributes to LBRY. While we're generous in what we send, it is more about recognizing and appreciating what you've given to the community than providing compensation. diff --git a/documents/glossary.md b/documents/glossary.md index 6d0733a..e90a0a8 100644 --- a/documents/glossary.md +++ b/documents/glossary.md @@ -258,6 +258,10 @@ Note that owning a very large amount of computational power does not override ot A 2D point on an elliptic curve [secp256k1](https://en.bitcoin.it/wiki/Secp256k1) that is produced by multiplying a predefined "generator" point by a *private key*. Usually it is represented by a pair of 256-bit numbers ("uncompressed public key"), but can also be compressed to just one 256-bit number (at the slight expense of CPU time to decode an uncompressed number). A special hash of a public key is called *address*. Typical LBRY transactions contain public keys or addresses in the output scripts and *signatures* in the input scripts. +### README + +A README is a file included in all code repositories that includes basic information about that project. More in (/resources/repository-standards). + ### Reflector A reflector cluster to accept LBRY content for hosting en masse, re-host the content, and make money on data fees (currently disabled). This code includes Go implementations of the LBRY peer protocol, reflector protocol, and DHT. -- 2.45.2 From 36fd142e4fb330e7cb0e60869b96f0aba62f4322 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 30 Sep 2018 19:43:56 -0400 Subject: [PATCH 08/15] missed unused import --- app/views/api.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/views/api.js b/app/views/api.js index a202814..02c4385 100644 --- a/app/views/api.js +++ b/app/views/api.js @@ -6,7 +6,6 @@ import asyncHtml from "choo-async/html"; import dedent from "dedent"; -import fs from "graceful-fs"; const fetch = require("make-fetch-happen").defaults({ cacheManager: "./cache" }); -- 2.45.2 From fbeab9990f78b436c608d87fdb8f6f5b6826e60b Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 30 Sep 2018 20:51:13 -0400 Subject: [PATCH 09/15] no sitemap til it's dynamic / maintained --- app/components/footer.js | 1 - documents/sitemap.md | 27 --------------------------- 2 files changed, 28 deletions(-) delete mode 100644 documents/sitemap.md diff --git a/app/components/footer.js b/app/components/footer.js index a608dd9..f97e5d7 100644 --- a/app/components/footer.js +++ b/app/components/footer.js @@ -48,7 +48,6 @@ export default function (state) {
      • Resources
      • Contribute
      • Community
      • -
      • Sitemap
      diff --git a/documents/sitemap.md b/documents/sitemap.md deleted file mode 100644 index ad969e4..0000000 --- a/documents/sitemap.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Sitemap ---- - -- [/](/) -- [/api](/api) - - [/blockchain](/api/blockchain) - - [/protocol](/api/protocol) -- [/build](/build) -- [/community](/community) -- [/contribute](/contribute) -- [/glossary](/glossary) -- [/guides](/guides) - - [/css](/guides/css) - - [/js](/guides/js) -- [/overview](/overview) -- [/resources](/resources) - - [/claimtrie](/resources/claimtrie) - - [/encrypt-lbrycrd](/resources/encrypt-lbrycrd) - - [/lbry-claimtrie](/resources/lbry-claimtrie) - - [/pow](/resources/pow) - - [/regtest-setup](/resources/regtest-setup) - - [/repository-standards](/resources/repository-standards) - - [/schema](/resources/schema) - - [/signing-claim](/resources/signing-claim) - - [/uri](/resources/uri) -- [/tour](/tour) -- 2.45.2 From 28b56b0d39831e6ed971d2d62e9505e25f5db95e Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 30 Sep 2018 22:06:35 -0400 Subject: [PATCH 10/15] "improve" 404/301 --- app/modules/{redirect.js => redirectOr404.js} | 0 app/views/api.js | 3 +++ app/views/redirect.js | 12 ++---------- 3 files changed, 5 insertions(+), 10 deletions(-) rename app/modules/{redirect.js => redirectOr404.js} (100%) diff --git a/app/modules/redirect.js b/app/modules/redirectOr404.js similarity index 100% rename from app/modules/redirect.js rename to app/modules/redirectOr404.js diff --git a/app/views/api.js b/app/views/api.js index 02c4385..eec4d23 100644 --- a/app/views/api.js +++ b/app/views/api.js @@ -6,6 +6,7 @@ import asyncHtml from "choo-async/html"; import dedent from "dedent"; +import redirectOr404 from "../modules/redirectOr404"; const fetch = require("make-fetch-happen").defaults({ cacheManager: "./cache" }); @@ -59,6 +60,8 @@ module.exports = exports = state => parseApiFile(state.params.wildcard).then(res `; +}).catch(() => { + redirectOr404(state.href); }); diff --git a/app/views/redirect.js b/app/views/redirect.js index 4e921f3..bbd22f2 100644 --- a/app/views/redirect.js +++ b/app/views/redirect.js @@ -11,9 +11,7 @@ import fs from "graceful-fs"; import html from "choo/html"; import path from "path"; import { require as local } from "app-root-path"; -import redirects from "../data/redirects.json"; -import redirect from "../modules/redirect"; -import Page404 from "./404.js"; +import redirectOr404 from "../modules/redirectOr404"; import raw from "choo/html/raw"; // V A R I A B L E S @@ -44,17 +42,11 @@ const md = require("markdown-it")({ module.exports = exports = (state, emit) => { // eslint-disable-line let path; - if (state.route === "resources/*") path = `resources/${state.params.wildcard}`; else path = state.params.wildcard; if (!fs.existsSync(`./documents/${path}.md`)) { - const redirectUrl = redirects[path] || redirects["/" + path]; - if (redirectUrl) { - redirect(redirectUrl); - } else { - return Page404(); - } + return redirectOr404(state.href); } const markdownFile = fs.readFileSync(`./documents/${path}.md`, "utf-8"); -- 2.45.2 From 211937e7dd0129d944be38db9a19bfec01911674 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 30 Sep 2018 22:32:48 -0400 Subject: [PATCH 11/15] resources and link grid --- app/components/navigation.js | 10 ---------- app/components/resources-link-grid.js | 25 +++++++++++++++---------- app/modules/redirectOr404.js | 16 ++++++++++++++-- app/sass/pages/_home.scss | 1 + app/sass/partials/_link-grid.scss | 3 +-- documents/contribute.md | 9 ++++----- 6 files changed, 35 insertions(+), 29 deletions(-) diff --git a/app/components/navigation.js b/app/components/navigation.js index 9de7ee9..5693f1d 100644 --- a/app/components/navigation.js +++ b/app/components/navigation.js @@ -39,16 +39,6 @@ export default class Navigation extends Nanocomponent { title: "View LBRY resources", url: "/resources" }, - { - name: "Contribute", - title: "Contribute to LBRY", - url: "/contribute" - }, - { - name: "Build", - title: "View LBRY resources", - url: "/build" - }, { name: "Community", title: "Interact with LBRY", diff --git a/app/components/resources-link-grid.js b/app/components/resources-link-grid.js index 219e41c..5e01c60 100644 --- a/app/components/resources-link-grid.js +++ b/app/components/resources-link-grid.js @@ -5,18 +5,23 @@ import linkGrid from "./link-grid"; export default () => { return linkGrid([{ title: "Whitepaper", - description: "It's a white paper", + description: "Read the formal specification for LBRY.", destination: "/whitepaper", - label: "Read" - }]) + linkGrid([ { - title: "LBRY SDK APIs", - description: "The LBRY SDK is the simplest way to start building with LBRY.", - destination: "/api/protocol", - label: "LBRY SDK API" + label: "Study the Paper" }, { - title: "Blockchain Docs", - description: "Learn how to talk to blockchain real good", + title: "Contributor's Guide", + description: "Can you code, design, write or test? Join us!", + destination: "/contribute", + label: "Read the Guide" + }, { + title: "SDK APIs", + description: "Method signatures and examples for lbry-sdk, the most common way to build on LBRY.", + destination: "/api/sdk", + label: "SDK APIs" + }, { + title: "Blockchain APIs", + description: "Method signatures and examples for lbrycrd, the LBRY blockchain.", destination: "/api/blockchain", - label: "Blockchain API" + label: "Blockchain APIs" }]); }; diff --git a/app/modules/redirectOr404.js b/app/modules/redirectOr404.js index d6e4fa9..15c6636 100644 --- a/app/modules/redirectOr404.js +++ b/app/modules/redirectOr404.js @@ -1,3 +1,15 @@ -export default (url, code = 301) => { - throw "fix this please, needs to redirect to:" + url; +/* +this is fucking awful + */ + +import Page404 from "../views/404.js"; +import redirects from "../data/redirects.json"; + +export default (path) => { + const redirectUrl = redirects[path]; + if (redirectUrl) { + throw "fix this please, needs to redirect to:" + redirectUrl; + } else { + return Page404(); + } }; diff --git a/app/sass/pages/_home.scss b/app/sass/pages/_home.scss index 36d5eda..786872f 100644 --- a/app/sass/pages/_home.scss +++ b/app/sass/pages/_home.scss @@ -52,6 +52,7 @@ body.home { grid-area: header; height: calc(50vh - 4rem); min-height: 300px; justify-content: center; + margin-bottom: 2rem; @media (max-width: 850px) { background-size: cover; diff --git a/app/sass/partials/_link-grid.scss b/app/sass/partials/_link-grid.scss index caf0a78..eb67f9c 100644 --- a/app/sass/partials/_link-grid.scss +++ b/app/sass/partials/_link-grid.scss @@ -3,14 +3,13 @@ display: flex; flex-flow: row wrap; list-style-type: none; - margin-top: 2rem; - margin-bottom: 2rem; } .link-grid__link { position: relative; text-align: center; vertical-align: top; + margin-bottom: 2rem; flex-grow: 1; @media (min-width: 651px) { diff --git a/documents/contribute.md b/documents/contribute.md index 426e751..6c1b0f5 100644 --- a/documents/contribute.md +++ b/documents/contribute.md @@ -1,14 +1,13 @@ --- -title: Contributing +title: Contributor's Guide --- - -## Contributing to LBRY +## Welcome to LBRY! Interested in working on the LBRY protocol, an official LBRY app, or other LBRY infrastructure? Awesome! This guide will get you started. -This guide is for contributing to the code bases maintained by the LBRY organization. For building on top of the LBRY protocol, see [Build](/build). +This guide is for contributing to the code bases maintained by the LBRY organization by [Coding](#coding), [Designing](#designing), [Writing](#writing), and [Testing](#testing). -Contributors that provide accepted pull requests, well-specified issues, or assist in testing and quality assurance typically receive LBC tokens as appreciation. +Contributors that provide accepted pull requests, well-specified issues, or assist in testing and quality assurance typically receive LBC tokens as [appreciation](#appreciation). ## Ecosystem Overview -- 2.45.2 From 14f704782c7167f259f761126ae0f39b5b336383 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Sun, 30 Sep 2018 23:58:33 -0400 Subject: [PATCH 12/15] home page, footer nav match, build disclaimer --- app/components/footer.js | 4 +-- app/sass/pages/_home.scss | 27 ++++++++++---------- app/views/home.js | 52 ++++++++++++++++----------------------- documents/build.md | 6 +++-- documents/contribute.md | 4 +-- 5 files changed, 42 insertions(+), 51 deletions(-) diff --git a/app/components/footer.js b/app/components/footer.js index f97e5d7..d221e62 100644 --- a/app/components/footer.js +++ b/app/components/footer.js @@ -45,9 +45,9 @@ export default function (state) {
    • Overview
    • +
    • Playground
    • Resources
    • -
    • Contribute
    • -
    • Community
    • +
    • Community
    diff --git a/app/sass/pages/_home.scss b/app/sass/pages/_home.scss index 786872f..2a3aea1 100644 --- a/app/sass/pages/_home.scss +++ b/app/sass/pages/_home.scss @@ -123,6 +123,10 @@ body.home { } } + ol, ul { + margin-bottom: 1.5rem; + } + p { margin-bottom: 1.5rem; max-width: 1000px; @@ -244,7 +248,7 @@ body.home { ul { li { @media (min-width: 701px) { - width: calc(100% / 5); + width: calc(100% / 4); } @media (max-width: 700px) { @@ -264,23 +268,19 @@ body.home { } &:nth-child(1) a::before { - background-image: url("/assets/media/svg/flag.svg"); - } - - &:nth-child(2) a::before { background-image: url("/assets/media/svg/keyboard.svg"); } - &:nth-child(3) a::before { + &:nth-child(2) a::before { background-image: url("/assets/media/svg/anchor.svg"); } - &:nth-child(4) a::before { - background-image: url("/assets/media/svg/chat.svg"); + &:nth-child(3) a::before { + background-image: url("/assets/media/svg/monitor.svg"); } - &:nth-child(5) a::before { - background-image: url("/assets/media/svg/monitor.svg"); + &:nth-child(4) a::before { + background-image: url("/assets/media/svg/flag.svg"); } } } @@ -296,8 +296,7 @@ body.home { ul { li { @media (min-width: 701px) { - // width: calc(100% / 3); // https://github.com/lbryio/lbry.tech/issues/104 - width: 50%; // + width: calc(100% / 3); } @media (max-width: 700px) { @@ -321,11 +320,11 @@ body.home { } &:nth-child(2) a::before { - background-image: url("/assets/media/svg/reddit.svg"); + background-image: url("/assets/media/svg/keyboard.svg"); } &:nth-child(3) a::before { - background-image: url("/assets/media/svg/slack.svg"); + background-image: url("/assets/media/svg/reddit.svg"); } } } diff --git a/app/views/home.js b/app/views/home.js index 94a0062..7f706bb 100644 --- a/app/views/home.js +++ b/app/views/home.js @@ -17,37 +17,33 @@ module.exports = exports = () => html`
    ${linkGrid([ { - description: "Learn how LBRY works with 3 easy examples", - destination: "/tour", - label: "Take the Tour", - title: "New to LBRY?" + description: "Get your head around LBRY with 3 interactive examples.", + destination: "/playground", + label: "Party in the Playground", + title: "Learn By Trying" }, { - description: "Help make LBRY better!", - destination: "/contribute", - label: "Explore our repos", - title: "Want to contribute?" + description: "Dig into the formal specification of the LBRY protocol.", + destination: "/whitepaper", + label: "Wisdom of the Whitepaper", + title: "Learn By Reading" } ])}
    -

    Intro/Overview

    +

    Overview

    What if anyone in the world could publish a piece of digital content, anyone else in the world could access it, for free or for payment, and that entire system worked end-to-end without any centralized authority or point of control?

    - -

    That's the idea behind LBRY. To create a market for accessing and publishing information that is global, decentralized, robust, optimal and complete.

    - - Learn more about our mission + Observe the Overview
    -

    Documentation

    -

    LBRY has enough moving parts to warrant comprehensive documentation. Whether you are interested in learning the technical details of our technology stack or you want to integrate LBRY into your life, you will find everything you need in our docs.

    - - Explore our documentation +

    Resources

    +

    Looking for API documentation, formal specifications, how-tos, resources, or the meaning of life? Find at least some of these things in the resources area.

    + Roam to Resources
    @@ -59,34 +55,28 @@ module.exports = exports = () => html`

    Contribute

    -

    Interested in progressing content freedom? Awesome! No matter your experience or skill level, you can make a difference.

    +

    No matter your experience or skill level, you can progress content freedom.

    -
    -
    - -
    -
    -

    Development

    -

    Like a bit of documentation but would prefer to jump in and make your mark on the blockchain? Perhaps add cats to it?

    - - Learn the LBRY API +

    + Collaborate with Contributors +

    Community

    -

    Hang out with us! We have a vibrant community of lbryians and would be delighted if you joined us.

    +

    There's literally 12n of us.

    diff --git a/documents/build.md b/documents/build.md index 589bdc0..f359b7f 100644 --- a/documents/build.md +++ b/documents/build.md @@ -4,6 +4,8 @@ title: Development Want to build something on top of LBRY? This is the place to get you started. +# THIS IS NOT DONE AT ALL AND IF YOU CONTINUE TO READ IT YOU MENTALLY ASSENT TO COMMITTING AT LEAST ONE CHANGE THAT MAKES IT BETTER + At least, it's the place to get started so long as you have some idea of what LBRY _is_. If you don't, you should read the [Overview](/overview) first. @@ -21,7 +23,7 @@ At least, it's the place to get started so long as you have some idea of what LB ### Web, Desktop, and Mobile Applications (Daemon-based Applications) -Almost all web, desktop, and mobile applications will use the [lbry daemon](https://github.com/lbryio/lbry) as a way of accessing and communicating with the LBRY network. +Almost all web, desktop, and mobile applications will use the [lbry-sdk](https://github.com/lbryio/lbry) as a way of accessing and communicating with the LBRY network. #### Web Applications @@ -31,7 +33,7 @@ Almost all web, desktop, and mobile applications will use the [lbry daemon](http #### Desktop Applications -1. Desktop applications will typically bundle the [lbry daemon](https://github.com/lbryio/lbry). +1. Desktop applications will typically use the [lbry-sdk](https://github.com/lbryio/lbry). 1. lbry-desktop as example #### Android Applications diff --git a/documents/contribute.md b/documents/contribute.md index 6c1b0f5..f70ddcf 100644 --- a/documents/contribute.md +++ b/documents/contribute.md @@ -5,7 +5,7 @@ title: Contributor's Guide Interested in working on the LBRY protocol, an official LBRY app, or other LBRY infrastructure? Awesome! This guide will get you started. -This guide is for contributing to the code bases maintained by the LBRY organization by [Coding](#coding), [Designing](#designing), [Writing](#writing), and [Testing](#testing). +This is a guide for contributing to the code bases maintained by the LBRY organization by [Coding](#coding), [Designing](#designing), [Writing](#writing), and [Testing](#testing). Contributors that provide accepted pull requests, well-specified issues, or assist in testing and quality assurance typically receive LBC tokens as [appreciation](#appreciation). @@ -50,7 +50,7 @@ If you want to contribute to LBRY, there's definitely something for you! The fir ## Coding -Several hundred extremely good-looking, intelligent and popular people, as well as our CTO, have contributed to LBRY. Join us! +Several hundred extremely good-looking, wise and moral people, as well as our CTO, have contributed to LBRY. Join us! ### How To Contribute Code -- 2.45.2 From a416be6e8e2c37c139aae1177e3275c4b2d6d7ba Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Mon, 1 Oct 2018 00:40:24 -0400 Subject: [PATCH 13/15] api headers --- app/components/api/header-blockchain.js | 15 +++++++++++++++ app/components/api/header-sdk.js | 15 +++++++++++++++ app/sass/pages/_api.scss | 25 ++++++------------------- app/views/api.js | 19 +++++++++++++++++-- 4 files changed, 53 insertions(+), 21 deletions(-) create mode 100644 app/components/api/header-blockchain.js create mode 100644 app/components/api/header-sdk.js diff --git a/app/components/api/header-blockchain.js b/app/components/api/header-blockchain.js new file mode 100644 index 0000000..301b016 --- /dev/null +++ b/app/components/api/header-blockchain.js @@ -0,0 +1,15 @@ +"use strict"; + +import html from "choo/html"; + +export default () => { + return html` +
    +

    lbrycrd APIs

    +

    + Methods and signatures provided by the lbrycrd blockchain daemon are documented below. + To build, download, or run lbrycrd, see the project README. +

    +
    + `; +}; diff --git a/app/components/api/header-sdk.js b/app/components/api/header-sdk.js new file mode 100644 index 0000000..694a66e --- /dev/null +++ b/app/components/api/header-sdk.js @@ -0,0 +1,15 @@ +"use strict"; + +import html from "choo/html"; + +export default () => { + return html` +
    +

    lbry-sdk APIs

    +

    + Methods and signatures provided by the lbry-sdk daemon are documented below. + To build, download, or run the daemon, see the project README. +

    +
    + `; +}; diff --git a/app/sass/pages/_api.scss b/app/sass/pages/_api.scss index 51fd43b..1533a8c 100644 --- a/app/sass/pages/_api.scss +++ b/app/sass/pages/_api.scss @@ -17,7 +17,7 @@ .api__header { - color: red; + padding: 2rem; } @@ -107,27 +107,14 @@ } - -/** - * API | Main Content - * - * @class .api__content - * @class .api__content__body - * @class .api__content__body__arguments - * - * @class .api__content__body__argument - * @selector {::after} - * @selector {:last-of-type} - * @selector {:nth-child} - * - * @class .api__content__example - */ - .api__content { - display: grid; float: right; - grid-template-columns: repeat(auto-fit, minmax(50%, 1fr)); width: calc(100% - 200px); +} + +.api__documentation { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(50%, 1fr)); h1 { font-size: 1.5rem; diff --git a/app/views/api.js b/app/views/api.js index eec4d23..b135a0e 100644 --- a/app/views/api.js +++ b/app/views/api.js @@ -7,6 +7,8 @@ import asyncHtml from "choo-async/html"; import dedent from "dedent"; import redirectOr404 from "../modules/redirectOr404"; +import headerBlockchain from "../components/api/header-blockchain"; +import headerSdk from "../components/api/header-sdk"; const fetch = require("make-fetch-happen").defaults({ cacheManager: "./cache" }); @@ -53,8 +55,12 @@ module.exports = exports = state => parseApiFile(state.params.wildcard).then(res - -
    ${createApiContent(response)}
    +
    + ${createApiHeader(state.params.wildcard)} +
    + ${createApiContent(response)} +
    +
    @@ -69,6 +75,15 @@ module.exports = exports = state => parseApiFile(state.params.wildcard).then(res // H E L P E R S +function createApiHeader(slug) { + switch (slug) { + case "sdk": + return headerSdk(); + case "blockchain": + return headerBlockchain(); + } +} + function createApiContent(apiDetails) { const apiContent = []; -- 2.45.2 From a5137cce1c0fd7106b150934ff9410dd9739664f Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Mon, 1 Oct 2018 10:44:33 -0400 Subject: [PATCH 14/15] fix problems --- app/client.js | 1 - app/data/redirects.json | 1 + app/sass/pages/_api.scss | 1 - app/sass/partials/_feature-links.scss | 2 +- app/views/api.js | 26 -------------------------- 5 files changed, 2 insertions(+), 29 deletions(-) diff --git a/app/client.js b/app/client.js index 566f813..1bd34f5 100755 --- a/app/client.js +++ b/app/client.js @@ -37,7 +37,6 @@ function main() { app.use(ssr()); app.route("/", page(require("./views/home"))); - app.route("/api", page(require("./views/api"))); app.route("/api/*", page(require("./views/api"))); app.route("/*", page(require("./views/redirect"))); diff --git a/app/data/redirects.json b/app/data/redirects.json index f17a7a8..eb101d2 100644 --- a/app/data/redirects.json +++ b/app/data/redirects.json @@ -1,6 +1,7 @@ { "/tour" : "/playground", "/play" : "/playground", + "/api" : "/resources", "/api/protocol" : "/api/sdk", "/api/lbry" : "/api/sdk", "/api/lbrycrd" : "/api/blockchain", diff --git a/app/sass/pages/_api.scss b/app/sass/pages/_api.scss index 1533a8c..4e596e2 100644 --- a/app/sass/pages/_api.scss +++ b/app/sass/pages/_api.scss @@ -106,7 +106,6 @@ } } - .api__content { float: right; width: calc(100% - 200px); diff --git a/app/sass/partials/_feature-links.scss b/app/sass/partials/_feature-links.scss index 89880cc..eb3b76f 100644 --- a/app/sass/partials/_feature-links.scss +++ b/app/sass/partials/_feature-links.scss @@ -38,8 +38,8 @@ $width-feature-link: 320px; } .feature-link__title { - top: 85px; position: relative; + top: 85px; font-weight: normal; text-align: center; z-index: 1; diff --git a/app/views/api.js b/app/views/api.js index b135a0e..4aa87e1 100644 --- a/app/views/api.js +++ b/app/views/api.js @@ -1,9 +1,5 @@ "use strict"; - - -// P A C K A G E S - import asyncHtml from "choo-async/html"; import dedent from "dedent"; import redirectOr404 from "../modules/redirectOr404"; @@ -12,28 +8,6 @@ import headerSdk from "../components/api/header-sdk"; const fetch = require("make-fetch-happen").defaults({ cacheManager: "./cache" }); -/* -module.exports = exports = state => parseApiFile(state.params.wildcard).then(response => asyncHtml` -
    - I am a walrus. -
    -
    - - -
    ${createApiContent(response)}
    -
    - -`); - */ - module.exports = exports = state => parseApiFile(state.params.wildcard).then(response => { /* state.lbry = { -- 2.45.2 From ade3c620f641b2e570cded86853721297ecd99a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9D=E3=83=BC=E3=83=AB=20=E3=82=A6=E3=82=A7=E3=83=83?= =?UTF-8?q?=E3=83=96?= Date: Mon, 1 Oct 2018 10:31:49 -0500 Subject: [PATCH 15/15] Fixes --- app/dist/scripts/app.js | 6 ++++ app/sass/partials/_glossary.scss | 61 +++++++++++++++++++++++++++++--- app/views/redirect.js | 12 +++---- 3 files changed, 68 insertions(+), 11 deletions(-) diff --git a/app/dist/scripts/app.js b/app/dist/scripts/app.js index 8873186..889d491 100755 --- a/app/dist/scripts/app.js +++ b/app/dist/scripts/app.js @@ -14,6 +14,12 @@ $(function () { +// Browsers not Firefox do not yet support `text-orientation` and/or `writing-mode` +if (!/Firefox[/\s](\d+\.\d+)/.test(navigator.userAgent)) + document.querySelector(".component--glossary-toc-toggle").classList.add("noncompliant-fix"); + + + if ( // Toggle beta message localStorage.getItem("hide lbry alert") && localStorage.getItem("hide lbry alert") === "true" // cannot set Booleans for some reason diff --git a/app/sass/partials/_glossary.scss b/app/sass/partials/_glossary.scss index 8ad81b5..13da93b 100644 --- a/app/sass/partials/_glossary.scss +++ b/app/sass/partials/_glossary.scss @@ -14,17 +14,47 @@ } .component--glossary-toc-toggle { - left: calc(250px - 25px); + &:not(.noncompliant-fix) { + left: calc(250px - 25px); + } + + &.noncompliant-fix { + @media (min-width: 901px) { + left: calc(250px - 65px); + } + + @media (max-width: 900px) { + left: calc(250px - 45px); + } + } } } &.sidebar-closed { + @media (max-width: 1230px) { + .page__header { + margin-left: 1rem; + } + } + .component--glossary-toc { left: -250px; } .component--glossary-toc-toggle { - left: 0; + &:not(.noncompliant-fix) { + left: 0; + } + + &.noncompliant-fix { + @media (min-width: 901px) { + left: -40px; + } + + @media (max-width: 900px) { + left: -20px; + } + } } } } @@ -50,13 +80,34 @@ } .component--glossary-toc-toggle { - width: 25px; height: 104px; - + background-color: mix($gray, $white, 30%); font-size: 0.7rem; position: absolute; text-orientation: upright; text-transform: uppercase; - top: 4rem; writing-mode: vertical-rl; z-index: 1; + + &:not(.noncompliant-fix) { + width: 25px; height: 104px; + top: 4rem; + } + + &.noncompliant-fix { + transform: rotate(90deg); + + @media (min-width: 901px) { + width: 105px; height: 25px; + + letter-spacing: 2px; + top: 103px; + } + + @media (max-width: 900px) { + width: 65px; height: 25px; + + letter-spacing: 1px; + top: 83px; + } + } } diff --git a/app/views/redirect.js b/app/views/redirect.js index 1593f45..3a5992e 100644 --- a/app/views/redirect.js +++ b/app/views/redirect.js @@ -140,12 +140,12 @@ function partialFinder(markdownBody) { function wikiFinder(markdownBody) { return markdownBody.replace(/\[\[([\w\s/-]+)\]\]/g, (match, p1) => { - const label = p1.trim(), - href = encodeURI("/glossary#" + label.replace(/\s+/g, '-')); + const label = p1.trim(), + href = encodeURI("/glossary#" + label.replace(/\s+/g, "-")); - return label ? - `${label}` : - match.input; - } + return label ? + `${label}` : + match.input; + } ); } -- 2.45.2