adds program library logo and link back to docs (#191)

* adds program library logo and link back to docs

* adds logo and link to docs

* formatting fixes

Co-authored-by: Raj Gokal <rajgokal@macbook-pro.lan>
This commit is contained in:
Raj Gokal 2020-08-03 07:31:23 -07:00 committed by GitHub
parent b006741718
commit ef94e22067
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 142 additions and 92 deletions

View File

@ -28,6 +28,7 @@ $ docs/build.sh
``` ```
### CI Build Flow ### CI Build Flow
The docs are built and published in Travis CI with the `docs/build.sh` script. The docs are built and published in Travis CI with the `docs/build.sh` script.
On each PR, the docs are built, but not published. On each PR, the docs are built, but not published.

View File

@ -2,7 +2,7 @@ module.exports = {
title: "Solana Program Library Docs", title: "Solana Program Library Docs",
tagline: tagline:
"Solana is an open source project implementing a new, high-performance, permissionless blockchain.", "Solana is an open source project implementing a new, high-performance, permissionless blockchain.",
url: "https://spl.docs.solana.com", url: "https://spl.solana.com",
baseUrl: "/", baseUrl: "/",
favicon: "img/favicon.ico", favicon: "img/favicon.ico",
organizationName: "solana-labs", // Usually your GitHub org/user name. organizationName: "solana-labs", // Usually your GitHub org/user name.
@ -14,6 +14,24 @@ module.exports = {
src: "img/logo-horizontal.svg", src: "img/logo-horizontal.svg",
srcDark: "img/logo-horizontal-dark.svg", srcDark: "img/logo-horizontal-dark.svg",
}, },
links: [
{
href: "https://docs.solana.com/",
label: "Docs »",
position: "left",
},
{
href: "https://discordapp.com/invite/pquxPsq",
label: "Chat",
position: "right",
},
{
href: "https://github.com/solana-labs/solana",
label: "GitHub",
position: "right",
},
],
}, },
footer: { footer: {
style: "dark", style: "dark",
@ -55,7 +73,7 @@ module.exports = {
docs: { docs: {
path: "src", path: "src",
routeBasePath: "/", routeBasePath: "/",
homePageId: 'introduction', homePageId: "introduction",
sidebarPath: require.resolve("./sidebars.js"), sidebarPath: require.resolve("./sidebars.js"),
}, },
theme: { theme: {

View File

@ -1,7 +1,8 @@
module.exports = { module.exports = {
docs: { docs: {
"Introduction": ["introduction"], "Other Thing": [],
"Programs": [ "Solana Program Library (SPL)": [
"introduction",
"token", "token",
"token-swap", "token-swap",
"memo", "memo",

View File

@ -1,5 +1,5 @@
--- ---
title: Solana Program Library title: Introduction
--- ---
The Solana Program Library (SPL) is a collection of on-chain programs targeting The Solana Program Library (SPL) is a collection of on-chain programs targeting

View File

@ -10,6 +10,7 @@ transaction.
Solana's programming model and the definitions of the Solana terms used in this Solana's programming model and the definitions of the Solana terms used in this
document are available at: document are available at:
- https://docs.solana.com/apps - https://docs.solana.com/apps
- https://docs.solana.com/terminology - https://docs.solana.com/terminology

View File

@ -11,6 +11,7 @@ utilize to create and use their tokens.
Solana's programming model and the definitions of the Solana terms used in this Solana's programming model and the definitions of the Solana terms used in this
document are available at: document are available at:
- https://docs.solana.com/apps - https://docs.solana.com/apps
- https://docs.solana.com/terminology - https://docs.solana.com/terminology
@ -114,6 +115,7 @@ Accounts containing wrapped SOL are associated with a specific Mint called the
`So11111111111111111111111111111111111111111`. `So11111111111111111111111111111111111111111`.
These accounts have a few unique behaviors These accounts have a few unique behaviors
- `InitializeAccount` sets the balance of the initialized Account to the SOL - `InitializeAccount` sets the balance of the initialized Account to the SOL
balance of the Solana account being initialized, resulting in a token balance balance of the Solana account being initialized, resulting in a token balance
equal to the SOL balance. equal to the SOL balance.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,18 +1,18 @@
// Turn off ESLint for this file because it's sent down to users as-is. // Turn off ESLint for this file because it's sent down to users as-is.
/* eslint-disable */ /* eslint-disable */
window.addEventListener('load', function() { window.addEventListener("load", function () {
function button(label, ariaLabel, icon, className) { function button(label, ariaLabel, icon, className) {
const btn = document.createElement('button'); const btn = document.createElement("button");
btn.classList.add('btnIcon', className); btn.classList.add("btnIcon", className);
btn.setAttribute('type', 'button'); btn.setAttribute("type", "button");
btn.setAttribute('aria-label', ariaLabel); btn.setAttribute("aria-label", ariaLabel);
btn.innerHTML = btn.innerHTML =
'<div class="btnIcon__body">' + '<div class="btnIcon__body">' +
icon + icon +
'<strong class="btnIcon__label">' + '<strong class="btnIcon__label">' +
label + label +
'</strong>' + "</strong>" +
'</div>'; "</div>";
return btn; return btn;
} }
@ -26,23 +26,22 @@ window.addEventListener('load', function() {
'<svg width="12" height="12" viewBox="340 364 14 15" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M342 375.974h4v.998h-4v-.998zm5-5.987h-5v.998h5v-.998zm2 2.994v-1.995l-3 2.993 3 2.994v-1.996h5v-1.995h-5zm-4.5-.997H342v.998h2.5v-.997zm-2.5 2.993h2.5v-.998H342v.998zm9 .998h1v1.996c-.016.28-.11.514-.297.702-.187.187-.422.28-.703.296h-10c-.547 0-1-.452-1-.998v-10.976c0-.546.453-.998 1-.998h3c0-1.107.89-1.996 2-1.996 1.11 0 2 .89 2 1.996h3c.547 0 1 .452 1 .998v4.99h-1v-2.995h-10v8.98h10v-1.996zm-9-7.983h8c0-.544-.453-.996-1-.996h-1c-.547 0-1-.453-1-.998 0-.546-.453-.998-1-.998-.547 0-1 .452-1 .998 0 .545-.453.998-1 .998h-1c-.547 0-1 .452-1 .997z" fill-rule="evenodd"/></svg>'; '<svg width="12" height="12" viewBox="340 364 14 15" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M342 375.974h4v.998h-4v-.998zm5-5.987h-5v.998h5v-.998zm2 2.994v-1.995l-3 2.993 3 2.994v-1.996h5v-1.995h-5zm-4.5-.997H342v.998h2.5v-.997zm-2.5 2.993h2.5v-.998H342v.998zm9 .998h1v1.996c-.016.28-.11.514-.297.702-.187.187-.422.28-.703.296h-10c-.547 0-1-.452-1-.998v-10.976c0-.546.453-.998 1-.998h3c0-1.107.89-1.996 2-1.996 1.11 0 2 .89 2 1.996h3c.547 0 1 .452 1 .998v4.99h-1v-2.995h-10v8.98h10v-1.996zm-9-7.983h8c0-.544-.453-.996-1-.996h-1c-.547 0-1-.453-1-.998 0-.546-.453-.998-1-.998-.547 0-1 .452-1 .998 0 .545-.453.998-1 .998h-1c-.547 0-1 .452-1 .997z" fill-rule="evenodd"/></svg>';
addButtons( addButtons(
'.hljs', ".hljs",
button('Copy', 'Copy code to clipboard', copyIcon, 'btnClipboard'), button("Copy", "Copy code to clipboard", copyIcon, "btnClipboard")
); );
const clipboard = new ClipboardJS('.btnClipboard', { const clipboard = new ClipboardJS(".btnClipboard", {
target: function (trigger) { target: function (trigger) {
return trigger.parentNode.querySelector('code'); return trigger.parentNode.querySelector("code");
}, },
}); });
clipboard.on('success', function(event) { clipboard.on("success", function (event) {
event.clearSelection(); event.clearSelection();
const textEl = event.trigger.querySelector('.btnIcon__label'); const textEl = event.trigger.querySelector(".btnIcon__label");
textEl.textContent = 'Copied'; textEl.textContent = "Copied";
setTimeout(function () { setTimeout(function () {
textEl.textContent = 'Copy'; textEl.textContent = "Copy";
}, 2000); }, 2000);
}); });
}); });