From 4cff0159307864fca926be3f763f414a92d9d57b Mon Sep 17 00:00:00 2001 From: Thomas Osmonson Date: Tue, 8 Sep 2020 12:07:51 -0500 Subject: [PATCH] fix: change page name --- next.config.js | 9 +++++++-- src/common/navigation.yaml | 2 +- src/components/mdx/components/code.tsx | 2 +- src/pages/ecosystem/contributing.md | 2 +- .../{clarity-language.md => language-clarity.md} | 0 src/pages/smart-contracts/counter-tutorial.md | 8 ++++---- src/pages/smart-contracts/hello-world-tutorial.md | 6 +++--- src/pages/smart-contracts/overview.md | 2 +- src/pages/smart-contracts/signing-transactions.md | 2 +- yarn.lock | 4 ++-- 10 files changed, 21 insertions(+), 16 deletions(-) rename src/pages/references/{clarity-language.md => language-clarity.md} (100%) diff --git a/next.config.js b/next.config.js index c890727f..d27bb1fe 100755 --- a/next.config.js +++ b/next.config.js @@ -270,12 +270,17 @@ async function redirects() { { source: '/core/cmdLineRef.html', destination: '/references/blockstack-cli', permanent: true }, { source: '/core/smart/clarityref', - destination: '/references/clarity-language', + destination: '/references/language-clarity', permanent: true, }, { source: '/core/smart/clarityRef.html', - destination: '/references/clarity-language', + destination: '/references/language-clarity', + permanent: true, + }, + { + source: '/references/clarity-language', + destination: '/references/language-clarity', permanent: true, }, { diff --git a/src/common/navigation.yaml b/src/common/navigation.yaml index b3fedf37..b4012e10 100644 --- a/src/common/navigation.yaml +++ b/src/common/navigation.yaml @@ -96,7 +96,7 @@ sections: usePageTitles: true pages: - path: /blockstack-cli - - path: /clarity-language + - path: /language-clarity - path: /stacks-blockchain - path: /stacks-rpc-api - external: diff --git a/src/components/mdx/components/code.tsx b/src/components/mdx/components/code.tsx index 85db8cb7..d6c5a839 100644 --- a/src/components/mdx/components/code.tsx +++ b/src/components/mdx/components/code.tsx @@ -141,7 +141,7 @@ export const Code: React.FC< } : {}, }, - })(theme) + })(theme) as any } {...bind} > diff --git a/src/pages/ecosystem/contributing.md b/src/pages/ecosystem/contributing.md index 83efce57..ee11fbf0 100644 --- a/src/pages/ecosystem/contributing.md +++ b/src/pages/ecosystem/contributing.md @@ -153,7 +153,7 @@ The script will process that file and pull out the title from the frontmatter of ### Non-standard pages There are a few pages within these docs that are non-standard markdown pages. This means they are using some kind of external data as their source, -such as the [Clarity Reference page](/references/clarity-language), or the [Blockstack CLI page](/references/blockstack-cli). These pages are using a function of Next.js called +such as the [Clarity Reference page](/references/language-clarity), or the [Blockstack CLI page](/references/blockstack-cli). These pages are using a function of Next.js called [`getStaticProps`](https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation) which allows us to fetch external data at runtime and use it in some way within our pages. diff --git a/src/pages/references/clarity-language.md b/src/pages/references/language-clarity.md similarity index 100% rename from src/pages/references/clarity-language.md rename to src/pages/references/language-clarity.md diff --git a/src/pages/smart-contracts/counter-tutorial.md b/src/pages/smart-contracts/counter-tutorial.md index bc8c938e..8eb63625 100644 --- a/src/pages/smart-contracts/counter-tutorial.md +++ b/src/pages/smart-contracts/counter-tutorial.md @@ -132,14 +132,14 @@ Let's get familiar with the tests to understand what the new smart contract shou (ok (var-get counter))) ``` - The [`define-data-var`](/references/clarity-language#define-data-var) statement initializes a + The [`define-data-var`](/references/language-clarity#define-data-var) statement initializes a new integer variable named `counter` and sets the value to `0`. It is important to note that all definition statements in Clarity need to be at the top of the file. The `counter` variable is stored in the data space associated with the smart contract. The variable is persisted and acts as the global shared state. - To provide access to the `counter` variable from outside of the current smart contract, we need to declare a public function to get it. The last lines of the code add a public `get-counter` function. The [`var-get`](/references/clarity-language#var-get) statement looks for a variable in the contract's data space and returns it. + To provide access to the `counter` variable from outside of the current smart contract, we need to declare a public function to get it. The last lines of the code add a public `get-counter` function. The [`var-get`](/references/language-clarity#var-get) statement looks for a variable in the contract's data space and returns it. With that, you are ready to rerun the tests! @@ -163,9 +163,9 @@ Let's get familiar with the tests to understand what the new smart contract shou (ok (var-get counter)))) ``` - First, the [`begin`](/references/clarity-language#begin) statement evaluates multiple expressions and returns the value of the last one. In this case, it is used to set a new value and return the new value. + First, the [`begin`](/references/language-clarity#begin) statement evaluates multiple expressions and returns the value of the last one. In this case, it is used to set a new value and return the new value. - Next, a [`var-set`](/references/clarity-language#var-set) is used to set a new value for the `counter` variable. The new value is constructed using the [`+`](/references/clarity-language#-add) (add) statement. This statement takes a number of integers and returns the result. Along with add, Clarity provides statements to subtract, multiply, and divide integers. Find more details in the [Clarity language reference](/references/clarity-language). + Next, a [`var-set`](/references/language-clarity#var-set) is used to set a new value for the `counter` variable. The new value is constructed using the [`+`](/references/language-clarity#-add) (add) statement. This statement takes a number of integers and returns the result. Along with add, Clarity provides statements to subtract, multiply, and divide integers. Find more details in the [Clarity language reference](/references/language-clarity). 5. Next, implement a new public function `decrement` to subtract `1` from the `counter` variable. You should have all knowledge needed to succeed at this! diff --git a/src/pages/smart-contracts/hello-world-tutorial.md b/src/pages/smart-contracts/hello-world-tutorial.md index b2df7c1f..662434a8 100644 --- a/src/pages/smart-contracts/hello-world-tutorial.md +++ b/src/pages/smart-contracts/hello-world-tutorial.md @@ -83,9 +83,9 @@ On the first line, a new public function `say-hi` is declared. Public functions -> To create private functions, you would use the `define-private` keyword. Private functions can only be executed by the current smart contract. Only public functions can be called from other contracts. -The function doesn't take any parameters and simply returns "hello world" using the [`ok`](/references/clarity-language#ok) response constructor. +The function doesn't take any parameters and simply returns "hello world" using the [`ok`](/references/language-clarity#ok) response constructor. -The second function, `echo-number`, is a [read-only function](/references/clarity-language#define-read-only). Read-only functions are also public, but as the name implies, they can not change and variables or datamaps. `echo-number` takes an input parameter of the type `int`. Along with integer, Clarity supports the following [types](/references/clarity-language#clarity-type-system): +The second function, `echo-number`, is a [read-only function](/references/language-clarity#define-read-only). Read-only functions are also public, but as the name implies, they can not change and variables or datamaps. `echo-number` takes an input parameter of the type `int`. Along with integer, Clarity supports the following [types](/references/language-clarity#clarity-type-system): - `uint`: 16-byte unsigned integer - `principal`: spending entity, roughly equivalent to a Stacks address @@ -93,7 +93,7 @@ The second function, `echo-number`, is a [read-only function](/references/clarit - `buffer`: fixed-length byte buffers - `tuple`: named fields in keys and values -`echo-number` uses an [`ok`](/references/clarity-language#ok) response to return the value passed to the function. +`echo-number` uses an [`ok`](/references/language-clarity#ok) response to return the value passed to the function. ## Step 3: Access the Explorer Sandbox diff --git a/src/pages/smart-contracts/overview.md b/src/pages/smart-contracts/overview.md index 02a71cfb..4bf866d0 100644 --- a/src/pages/smart-contracts/overview.md +++ b/src/pages/smart-contracts/overview.md @@ -66,4 +66,4 @@ then learn how to construct [a counter](/smart-contracts/counter-tutorial), and [test your smart contracts](/smart-contracts/testing-contracts) using Mocha. Once you've got the hang of the general workflow, environment, and language syntax, you should be ready to start writing -contracts, referring to the [Clarity language reference](/references/clarity-language) as you go. +contracts, referring to the [Clarity language reference](/references/language-clarity) as you go. diff --git a/src/pages/smart-contracts/signing-transactions.md b/src/pages/smart-contracts/signing-transactions.md index f530b77f..b2ae6daa 100644 --- a/src/pages/smart-contracts/signing-transactions.md +++ b/src/pages/smart-contracts/signing-transactions.md @@ -98,7 +98,7 @@ interface ContractCallOptions { | --------------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | contractAddress | string | false | The Stacks address that published this contract | | contractName | string | false | The name that was used when publishing this contract | -| functionName | string | false | The name of the function you're calling. This needs to be a [public function](/references/clarity-language#define-public). | +| functionName | string | false | The name of the function you're calling. This needs to be a [public function](/references/language-clarity#define-public). | | functionArgs | array | false | The arguments you're calling the function with. You'll need to provide the Clarity type with each argument. See the below section for details. Defaults to `[]`. | | appDetails | object | false | A dictionary that includes `name` and `icon` | | finished | function | false | A callback that is fired when the transaction is signed and broadcasted. Your callback will receive an object back with a `txId` and a `txRaw`, both of which are strings. | diff --git a/yarn.lock b/yarn.lock index 5d125837..7ab9cd0c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9223,9 +9223,9 @@ vm-browserify@1.1.2, vm-browserify@^1.0.1: resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== -"vscode-textmate@git+https://github.com/octref/vscode-textmate.git": +"vscode-textmate@https://github.com/octref/vscode-textmate": version "4.0.1" - resolved "git+https://github.com/octref/vscode-textmate.git#e65aabe2227febda7beaad31dd0fca1228c5ddf3" + resolved "https://github.com/octref/vscode-textmate#e65aabe2227febda7beaad31dd0fca1228c5ddf3" w3c-hr-time@^1.0.2: version "1.0.2"