diff --git a/docs/README.md b/docs/README.md index 08592e86..ff77dbd1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -28,6 +28,7 @@ $ docs/build.sh ``` ### CI Build Flow + 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. diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index c49c5237..e5653a83 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -2,7 +2,7 @@ module.exports = { title: "Solana Program Library Docs", tagline: "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: "/", favicon: "img/favicon.ico", organizationName: "solana-labs", // Usually your GitHub org/user name. @@ -14,6 +14,24 @@ module.exports = { src: "img/logo-horizontal.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: { style: "dark", @@ -55,7 +73,7 @@ module.exports = { docs: { path: "src", routeBasePath: "/", - homePageId: 'introduction', + homePageId: "introduction", sidebarPath: require.resolve("./sidebars.js"), }, theme: { diff --git a/docs/sidebars.js b/docs/sidebars.js index 6acf83a3..4f20880e 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -1,7 +1,8 @@ module.exports = { docs: { - "Introduction": ["introduction"], - "Programs": [ + "Other Thing": [], + "Solana Program Library (SPL)": [ + "introduction", "token", "token-swap", "memo", diff --git a/docs/siteConfig.js b/docs/siteConfig.js index 275fe8c1..a53035b7 100644 --- a/docs/siteConfig.js +++ b/docs/siteConfig.js @@ -3,4 +3,4 @@ scripts: [ 'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js', '/js/code-block-buttons.js', ], - stylesheets: ['/css/code-block-buttons.css'] \ No newline at end of file +stylesheets: ['/css/code-block-buttons.css'] \ No newline at end of file diff --git a/docs/src/introduction.md b/docs/src/introduction.md index 7c3fd022..240f20a1 100644 --- a/docs/src/introduction.md +++ b/docs/src/introduction.md @@ -1,10 +1,10 @@ --- -title: Solana Program Library +title: Introduction --- The Solana Program Library (SPL) is a collection of on-chain programs targeting the [Sealevel parallel runtime](https://medium.com/solana-labs/sealevel-parallel-processing-thousands-of-smart-contracts-d814b378192). These programs are tested against Solana's implementation -of Sealevel, solana-runtime, and deployed to its mainnet. As others implement +of Sealevel, solana-runtime, and deployed to its mainnet. As others implement Sealevel, we will graciously accept patches to ensure the programs here are -portable across all implementations. \ No newline at end of file +portable across all implementations. diff --git a/docs/src/memo.md b/docs/src/memo.md index 6edbd7e4..292831a6 100644 --- a/docs/src/memo.md +++ b/docs/src/memo.md @@ -2,7 +2,7 @@ title: Memo Program --- -A simple program that validates a string of UTF-8 encoded characters. It can be +A simple program that validates a string of UTF-8 encoded characters. It can be used to record a string on-chain, stored in the instruction data of a successful transaction. @@ -10,6 +10,7 @@ transaction. Solana's programming model and the definitions of the Solana terms used in this document are available at: + - https://docs.solana.com/apps - https://docs.solana.com/terminology @@ -26,4 +27,4 @@ The on-chain Memo Program is written in Rust and available on crates.io as ## Operational overview The Memo program attempts to UTF-8 decode the instruction data; if successfully -decoded, the instruction is successful. \ No newline at end of file +decoded, the instruction is successful. diff --git a/docs/src/token.md b/docs/src/token.md index 18fdd8f8..05b0fcf8 100644 --- a/docs/src/token.md +++ b/docs/src/token.md @@ -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 document are available at: + - https://docs.solana.com/apps - https://docs.solana.com/terminology @@ -40,20 +41,20 @@ instructions. ### Creating a new token type A new token type can be created by initializing a new Mint with the -`InitializeMint` instruction. The Mint is used to create or "Mint" new tokens, -and these tokens are stored in Accounts. A Mint is associated with each +`InitializeMint` instruction. The Mint is used to create or "Mint" new tokens, +and these tokens are stored in Accounts. A Mint is associated with each Account, which means that the total supply of a particular token type is equal to the balances of all the associated Accounts. -A Mint can either be configured with a fixed-supply or non-fixed supply. The +A Mint can either be configured with a fixed-supply or non-fixed supply. The total supply of a fixed-supply Mint is determined during initialization and -deposited into a provided destination account. A non-fixed-supply Mint also has +deposited into a provided destination account. A non-fixed-supply Mint also has an owner associated with it who has the authority to create new tokens in the -future with the `MintTo` instruction. Both types of Mints can `Burn` tokens to +future with the `MintTo` instruction. Both types of Mints can `Burn` tokens to decrease supply.ß It's important to note that the `InitializeMint` instruction does not require -the Solana account being initialized also be a signer. The `InitializeMint` +the Solana account being initialized also be a signer. The `InitializeMint` instruction should be atomically processed with the system instruction that creates the Solana account by including both instructions in the same transaction. @@ -61,7 +62,7 @@ transaction. ### Creating accounts Accounts hold token balances and are created using the `InitializeAccount` -instruction. Each Account has an owner who must be present as a signer in some +instruction. Each Account has an owner who must be present as a signer in some instructions. Balances can be transferred between Accounts using the `Transfer` instruction. @@ -72,7 +73,7 @@ An Account's owner may transfer ownership of an account to another using the `SetOwner` instruction. It's important to note that the `InitializeAccount` instruction does not require -the Solana account being initialized also be a signer. The `InitializeAccount` +the Solana account being initialized also be a signer. The `InitializeAccount` instruction should be atomically processed with the system instruction that creates the Solana account by including both instructions in the same transaction. @@ -85,35 +86,36 @@ to another Account, effectively removing the token from circulation permanently. ### Authority delegation Account owners may delegate authority over some or all of their token balance -using the `Approve` instruction. Delegated authorities may transfer or burn up -to the amount they've been delegated. Authority delegation may be revoked by +using the `Approve` instruction. Delegated authorities may transfer or burn up +to the amount they've been delegated. Authority delegation may be revoked by the Account's owner via the `Revoke` instruction. ### Multisignatures M of N multisignatures are supported and can be used in place of Mint owners, or -Account owners or delegates. Multisignature owners or delegates must be +Account owners or delegates. Multisignature owners or delegates must be initialized with the `InitializeMultisig` instruction. Initialization specifies the set of N public keys that are valid and the number M of those N that must be present as instruction signers for the authority to be legitimate. It's important to note that the `InitializeMultisig` instruction does not -require the Solana account being initialized also be a signer. The +require the Solana account being initialized also be a signer. The `InitializeMultisig` instruction should be atomically processed with the system instruction that creates the Solana account by including both instructions in the same transaction. ### Wrapping SOL -The Token Program can be used to wrap native SOL. Doing so allows native SOL to +The Token Program can be used to wrap native SOL. Doing so allows native SOL to be treated like any other Token program token type and can be useful when being called from other programs that interact with the Token Program's interface. Accounts containing wrapped SOL are associated with a specific Mint called the -"Native Mint" using the public key -`So11111111111111111111111111111111111111111`. +"Native Mint" using the public key +`So11111111111111111111111111111111111111111`. These accounts have a few unique behaviors + - `InitializeAccount` sets the balance of the initialized Account to the SOL balance of the Solana account being initialized, resulting in a token balance equal to the SOL balance. @@ -124,7 +126,7 @@ These accounts have a few unique behaviors ### Closing accounts -An account may be closed using the `CloseAccount` instruction. When closing an +An account may be closed using the `CloseAccount` instruction. When closing an Account, all remaining SOL will be transferred to another Solana account -(doesn't have to be associated with the Token Program). Non-native accounts -must have a balance of zero to be closed. \ No newline at end of file +(doesn't have to be associated with the Token Program). Non-native accounts +must have a balance of zero to be closed. diff --git a/docs/static/img/logo-horizontal-dark.svg b/docs/static/img/logo-horizontal-dark.svg index b17305fa..f3b3ba9c 100644 --- a/docs/static/img/logo-horizontal-dark.svg +++ b/docs/static/img/logo-horizontal-dark.svg @@ -1,12 +1,26 @@ diff --git a/docs/static/img/logo-horizontal.svg b/docs/static/img/logo-horizontal.svg index 2cab6185..5cccf7e3 100644 --- a/docs/static/img/logo-horizontal.svg +++ b/docs/static/img/logo-horizontal.svg @@ -1,12 +1,26 @@ diff --git a/docs/static/js/code-block-buttons.js b/docs/static/js/code-block-buttons.js index a42c3262..0279288c 100644 --- a/docs/static/js/code-block-buttons.js +++ b/docs/static/js/code-block-buttons.js @@ -1,48 +1,47 @@ // Turn off ESLint for this file because it's sent down to users as-is. /* eslint-disable */ -window.addEventListener('load', function() { - function button(label, ariaLabel, icon, className) { - const btn = document.createElement('button'); - btn.classList.add('btnIcon', className); - btn.setAttribute('type', 'button'); - btn.setAttribute('aria-label', ariaLabel); - btn.innerHTML = - '