From e39fd7919396bd532dc72280fb99b94dfbb91c24 Mon Sep 17 00:00:00 2001 From: gagdiez Date: Tue, 29 Aug 2023 18:05:17 +0200 Subject: [PATCH] Multiple Updates to Docs Reorganized docs, updated the dark theme and how code is displayed. --- docs/2.develop/contracts/introduction.md | 14 +- docs/2.develop/integrate/welcome.md | 39 +- docs/2.develop/quickstart.md | 5 +- docs/bos/index.md | 1 + docs/index.md | 27 +- website/docusaurus.config.js | 2 +- website/sidebars.json | 8 +- website/src/css/customTheme.css | 117 +- .../docs/assets/welcome-pages/drawing.svg | 1268 ++++++++++++++++- 9 files changed, 1368 insertions(+), 113 deletions(-) diff --git a/docs/2.develop/contracts/introduction.md b/docs/2.develop/contracts/introduction.md index cb83497d7b8..5a2f7cff526 100644 --- a/docs/2.develop/contracts/introduction.md +++ b/docs/2.develop/contracts/introduction.md @@ -3,22 +3,18 @@ id: introduction title: Prerequisites --- -To develop a smart contract you will need to install Node.js. If you further want to use Rust as your main language, then you need to install `rustup` as well. - -
- -## Node.js -Download and install [Node.js](https://nodejs.org/en/download/). +To develop a smart contract you will need to install [Node.js](https://nodejs.org/en/download/). :::tip We further recommend to install [yarn](https://yarnpkg.com) using `npm install -g yarn`. ::: -
+--- -## Rust and Wasm +### Rust +If you prefer to use Rust as your main language, then you need to install `rustup` as well. -Follow [these instructions](https://doc.rust-lang.org/book/ch01-01-installation.html) for setting up Rust. Then, add the `wasm32-unknown-unknown` toolchain which enables compiling Rust to [Web Assembly (wasm)](https://webassembly.org/), the low-level language used by the NEAR platform. +Follow the instructions bellow to [setup Rust](https://doc.rust-lang.org/book/ch01-01-installation.html), also adding the toolchain to compiling Rust to [Web Assembly (wasm)](https://webassembly.org/), the low-level language used by the NEAR platform. ```bash # Installing Rust in Linux and MacOS diff --git a/docs/2.develop/integrate/welcome.md b/docs/2.develop/integrate/welcome.md index 92407aad00b..7ea47c6df37 100644 --- a/docs/2.develop/integrate/welcome.md +++ b/docs/2.develop/integrate/welcome.md @@ -51,7 +51,7 @@ Welcome! Here you will find documentation on how to build Web3 applications usin -
+
@@ -69,29 +69,24 @@ Welcome! Here you will find documentation on how to build Web3 applications usin - - - - - - - + + + + + + - - - - - - - + + + + + - - - - - - - + + + + + diff --git a/docs/2.develop/quickstart.md b/docs/2.develop/quickstart.md index 34a34343064..2a3b04b46d1 100644 --- a/docs/2.develop/quickstart.md +++ b/docs/2.develop/quickstart.md @@ -123,8 +123,9 @@ You will find the integration tests for `hello-near` in `integration-tests/`. ## Moving Forward -That's it for our first quickstart tutorial. You have now seen a fully functional contract with -a minimal user interface and testing. Go ahead and check our [examples](/tutorials/welcome) or proceed straight to the [Develop section](./contracts/anatomy.md) to know how to write your own contract. +That's it for our first quickstart tutorial. You have now seen a fully functional contract with a minimal user interface and testing. + +Go ahead and check other [examples](/tutorials/examples/guest-book) or proceed straight to the [Develop section](./contracts/anatomy.md) to know how to write your own contract. If you have any questions, do not hesitate in joining us on [Discord](https://near.chat). We regularly host Office Hours, in which you can join our voice channel and ask questions. diff --git a/docs/bos/index.md b/docs/bos/index.md index 790e2e822da..c90141bb228 100644 --- a/docs/bos/index.md +++ b/docs/bos/index.md @@ -13,6 +13,7 @@ Build fully decentralized applications for all chains. Publish and get discovere + diff --git a/docs/index.md b/docs/index.md index 5d25320df02..2ea09a5f766 100644 --- a/docs/index.md +++ b/docs/index.md @@ -50,45 +50,44 @@ Welcome, this is the starting point for all NEAR documentation. Learn to build a
-
@@ -106,7 +105,7 @@ Welcome, this is the starting point for all NEAR documentation. Learn to build a - + diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index b659f599b4a..17a9097e50f 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -117,7 +117,7 @@ module.exports = { items: [ { label: "Smart Contracts", href: "/develop/contracts/welcome" }, { label: "Web3 Applications", href: "/develop/integrate/welcome" }, - { label: "Monitor the Network (Indexers)", href: "/tools/realtime" }, + { label: "Monitor the Chain", href: "/tools/realtime" }, { type: 'html', value: '
', diff --git a/website/sidebars.json b/website/sidebars.json index cbd13e7a55b..463cb2eaed8 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -631,18 +631,14 @@ { "type": "link", "label": "Wallet Selector ↗", - "href": "/tools/wallet-selector" + "href": "tools/wallet-selector" }, { "type": "link", "label": "BOS CLI", "href": "https://github.com/FroVolod/bos-cli-rs" }, - { - "type": "link", - "label": "VSCODE Extension", - "href": "https://github.com/near/near-vscode" - } + "bos/dev/vscode" ], "indexers": [ "tools/realtime", diff --git a/website/src/css/customTheme.css b/website/src/css/customTheme.css index 54c010da232..a2e063fc7a7 100644 --- a/website/src/css/customTheme.css +++ b/website/src/css/customTheme.css @@ -27,6 +27,11 @@ --near-font-color: #3c3c3c; } +[data-theme="dark"] { + --ifm-color-primary: #82aaff; + --near-color-royal: #82aaff; +} + .text-center { text-align: center !important; } @@ -91,7 +96,6 @@ ol li::marker { } .prism-code { - border-radius: 0 !important; text-align: left; } @@ -149,6 +153,24 @@ a:hover { color: var(--ifm-font-color-base); } +/* code */ +.codeBlockTitle_node_modules-\@docusaurus-theme-classic-lib-theme-CodeBlock-Content-styles-module { + padding: 0.5rem var(--ifm-pre-padding) !important; +} + +.codeBlockLines_node_modules-\@docusaurus-theme-classic-lib-theme-CodeBlock-Content-styles-module { + border-bottom-left-radius: 30px !important; +} + +.tabItem_node_modules-\@docusaurus-theme-classic-lib-theme-TabItem-styles-module { + padding: .7rem 0 0 0; +} + +.tabItem_node_modules-\@docusaurus-theme-classic-lib-theme-TabItem-styles-module>.tabItem_node_modules-\@docusaurus-theme-classic-lib-theme-TabItem-styles-module { + padding: 0rem; + border: none; +} + /* for image caption */ img+em, .tabs-container+p em { @@ -168,41 +190,24 @@ img+em, margin-bottom: -1rem; } -.language-tabs .tabs__item--active { - border: 0; -} - .language-tabs li { padding: 0.5em 1em; } -[data-theme='light'] .tabs-container>.language-tabs { - background-color: #ececec; -} - .language-tabs li:hover { background-color: transparent; } /* Language selection Tabs*/ .file-tabs { - margin-bottom: -1rem; - font-size: 12px; -} - -.file-tabs .tabs__item--active { - border: 0; + margin: -0.5rem 0 -2rem 0; + font-size: small; } .file-tabs li { - padding: 0.5em 1em; -} - -[data-theme='light'] .tabs-container>.file-tabs { - background-color: #292d3e; - border-bottom: 1px solid; - padding-top: 1px; - color: #e3e3e3; + padding: 0.5em 0em 0 0em; + margin-bottom: 0.5em; + margin-right: 1rem; } .file-tabs li:hover { @@ -214,8 +219,20 @@ img+em, } /* columns */ +.docItemCol_node_modules-\@docusaurus-theme-classic-lib-theme-DocItem-Layout-styles-module { + padding: 0 0 0 var(--ifm-spacing-horizontal) !important; +} + .col { - padding: 0 0 0 var(--ifm-spacing-horizontal); + padding: 0 calc(var(--ifm-spacing-horizontal)/2); +} + +.col:first-child { + padding: 0 calc(var(--ifm-spacing-horizontal)/2) 0 0; +} + +.col:last-child { + padding: 0 0 0 calc(var(--ifm-spacing-horizontal)/2); } /* Others */ @@ -1074,45 +1091,45 @@ figcaption a, border-radius: 0%; } - -img+em, iframe+em { - font-style: normal; - display: inherit; - text-align: center; - font-size: 90%; - margin: 0.5em 0 2rem 0; +img+em, +iframe+em { + font-style: normal; + display: inherit; + text-align: center; + font-size: 90%; + margin: 0.5em 0 2rem 0; } .monaco+em { - font-style: normal; - display: inherit; - text-align: right; - font-size: 90%; - margin: 0.5em 0 0 0; + font-style: normal; + display: inherit; + text-align: right; + font-size: 90%; + margin: 0.5em 0 0 0; } /* Widget Editor */ .monaco { - border-radius: 10px; - background-color: #f6f8fa; - padding: 1rem; + border-radius: 10px; + background-color: #f6f8fa; + padding: 1rem; } .code_iframe { - border-radius: 10px; - border: 1px solid #e6e6e6; - padding: 1rem; - margin-bottom: 3rem; - overflow: hidden; + border-radius: 10px; + border: 1px solid #e6e6e6; + padding: 1rem; + margin-bottom: 3rem; + overflow: hidden; } -.code_iframe iframe{ - min-width: 100%; - overflow: hidden; - min-height: 160px; +.code_iframe iframe { + min-width: 100%; + overflow: hidden; + min-height: 160px; } .monaco-editor-background { - background-color: #f6f8fa !important; -} + background-color: #f6f8fa !important; +} \ No newline at end of file diff --git a/website/static/docs/assets/welcome-pages/drawing.svg b/website/static/docs/assets/welcome-pages/drawing.svg index 72e6ca2c97b..9873bfdbc14 100644 --- a/website/static/docs/assets/welcome-pages/drawing.svg +++ b/website/static/docs/assets/welcome-pages/drawing.svg @@ -26,17 +26,25 @@ inkscape:deskcolor="#d1d1d1" inkscape:document-units="mm" showgrid="false" - inkscape:zoom="0.75142308" - inkscape:cx="-353.99498" - inkscape:cy="-841.07079" - inkscape:window-width="1920" - inkscape:window-height="1056" + inkscape:zoom="1.0283509" + inkscape:cx="1099.8191" + inkscape:cy="101.13279" + inkscape:window-width="1352" + inkscape:window-height="844" inkscape:window-x="0" - inkscape:window-y="24" + inkscape:window-y="34" inkscape:window-maximized="0" inkscape:current-layer="layer1" /> + ry="8.023344" />SOON