Skip to content

Commit

Permalink
docs: Add Sway By Example (#327)
Browse files Browse the repository at this point in the history
* done

* updating slugs

* fix main merge

* summary ignore
  • Loading branch information
calldelegation authored Jun 25, 2024
1 parent 41e25fe commit 4bebcd2
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@
[submodule "docs/chain-configuration"]
path = docs/chain-configuration
url = https://github.com/FuelLabs/chain-configuration
[submodule "docs/sway-by-example-lib"]
path = docs/sway-by-example-lib
url = https://github.com/FuelLabs/sway-by-example-lib.git
[submodule "docs/nightly/sway-by-example-lib"]
path = docs/nightly/sway-by-example-lib
url = https://github.com/FuelLabs/sway-by-example-lib.git
[submodule "docs/breaking-change-log"]
path = docs/breaking-change-log
url = https://github.com/FuelLabs/breaking-change-log.git
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"**/fuels-wallet": true,
"**/fuelup": true,
"**/guides/examples": true,
"**/sway-by-example-lib": true,
"**/breaking-change-log": true
},
"git.ignoreLimitWarning": true,
Expand Down
4 changes: 4 additions & 0 deletions contentlayer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const includeDirs = [
'docs/contributing',
'docs/sway-libs/docs/book/src',
'docs/sway-standards/docs/src',
'docs/sway-by-example-lib/docs/src',
'docs/breaking-change-log/docs/src',
// NIGHTLY DOCS
'docs/nightly/sway/docs/book/src',
Expand All @@ -73,6 +74,7 @@ const includeDirs = [
'docs/nightly/fuels-wallet/packages/docs/docs',
'docs/nightly/sway-libs/docs/book/src',
'docs/nightly/sway-standards/docs/src',
'docs/nightly/sway-by-example-lib/docs/src',
'docs/nightly/breaking-change-log/docs/src',
];

Expand All @@ -91,6 +93,7 @@ const excludeDirs = [
'docs/fuel-specs/src/SUMMARY.md',
'docs/sway-libs/docs/book/src/SUMMARY.md',
'docs/sway-standards/docs/src/SUMMARY.md',
'docs/sway-by-example-lib/docs/src/SUMMARY.md',
'docs/guides/docs/migration-guide/breaking-change-log/node_modules',
'docs/breaking-change-log/docs/src/SUMMARY.md',
// NIGHTLY DOCS
Expand All @@ -99,6 +102,7 @@ const excludeDirs = [
'docs/nightly/fuel-specs/src/SUMMARY.md',
'docs/nightly/sway-libs/docs/book/src/SUMMARY.md',
'docs/nightly/sway-standards/docs/src/SUMMARY.md',
'docs/nightly/sway-by-example-lib/docs/src/SUMMARY.md',
'docs/nightly/breaking-change-log/docs/src/SUMMARY.md',
];

Expand Down
1 change: 1 addition & 0 deletions docs/nightly/sway-by-example-lib
Submodule sway-by-example-lib added at 89c4e3
1 change: 1 addition & 0 deletions docs/sway-by-example-lib
Submodule sway-by-example-lib added at 89c4e3
6 changes: 6 additions & 0 deletions scripts/clean-build-files.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const targetDirs = [
'./docs/nightly/sway-libs',
'./docs/sway-standards',
'./docs/nightly/sway-standards',
'./docs/sway-by-example-lib',
'./docs/nightly/sway-by-example-lib',
'./docs/breaking-change-log',
'./docs/nightly/breaking-change-log',
];
Expand All @@ -42,6 +44,10 @@ const exclusions = {
'sway-standards/examples',
'sway-standards/Cargo.toml',
],
sway_by_example_lib: [
'sway-by-example-lib/docs',
'sway-by-example-lib/examples',
],
fuels_rs: [
'fuels-rs/Cargo.toml',
'fuels-rs/docs',
Expand Down
18 changes: 18 additions & 0 deletions scripts/generate-links/getDocs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,24 @@ export async function getDocs(key, order) {
'!**/SUMMARY.md',
];
break;
case 'sway-by-example-lib':
paths = [
// SWAY BY EXAMPLE DOCS
'./sway-by-example-lib/docs/src/*.md',
'./sway-by-example-lib/docs/src/**/*.md',
// IGNORE ALL SUMMARY PAGES
'!**/SUMMARY.md',
];
break;
case 'nightly-sway-by-example-lib':
paths = [
// SWAY BY EXAMPLE DOCS
'./nightly/sway-by-example-lib/docs/src/*.md',
'./nightly/sway-by-example-lib/docs/src/**/*.md',
// IGNORE ALL SUMMARY PAGES
'!**/SUMMARY.md',
];
break;
case 'breaking-change-log':
paths = [
// BREAKING CHANGE LOG DOCS
Expand Down
4 changes: 4 additions & 0 deletions scripts/generate-links/getOrders.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ const CONFIG = {
type: 'mdbook',
path: './sway-standards/docs/src/SUMMARY.md',
},
'sway-by-example-lib': {
type: 'mdbook',
path: './sway-by-example-lib/docs/src/SUMMARY.md',
},
'fuels-rs': {
type: 'mdbook',
path: './fuels-rs/docs/src/SUMMARY.md',
Expand Down
4 changes: 4 additions & 0 deletions scripts/generate-links/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ function getSidebarName(key) {
case 'sway-standards':
newKey = 'Sway Standards';
break;
case 'sway-by-example-lib':
newKey = 'Sway By Example';
break;
case 'breaking-change-log':
newKey = 'Breaking Change Notices';
break;
Expand All @@ -116,6 +119,7 @@ function handleAllOrders(allOrders, folderPath, filename) {
'sway',
'sway-libs',
'sway-standards',
'sway-by-example-lib',
'fuels-ts',
'fuels-rs',
'wallet',
Expand Down
7 changes: 5 additions & 2 deletions src/components/SidebarSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ export function SidebarSection({
case 'Sway-standards':
githubLink = 'https://github.com/FuelLabs/sway-standards';
break;
case 'Sway-by-example-lib':
githubLink = 'https://github.com/FuelLabs/sway-by-example-lib';
break;
case 'Breaking-change-log':
githubLink = 'https://github.com/FuelLabs/breaking-change-log';
break;
githubLink = 'https://github.com/FuelLabs/breaking-change-log';
break;
default:
break;
}
Expand Down
9 changes: 9 additions & 0 deletions src/config/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@
"image": ""
}
},
"sway-by-example-lib": {
"title": "Sway By Example Lib",
"slug": "sway-by-example-lib",
"repository": "https://github.com/FuelLabs/sway-by-example-lib",
"ogTags": {
"description": "An introduction to Sway with simple examples",
"image": ""
}
},
"fuels-rs": {
"title": "Fuel Rust SDK",
"slug": "fuels-rs",
Expand Down
1 change: 1 addition & 0 deletions src/lib/md-doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class Doc {
.replace('docs/fuel-graphql-docs/', '')
.replace('docs/sway/', '')
.replace('docs/sway-standards/', '')
.replace('docs/sway-by-example-lib/', '')
.replace('docs/breaking-change-log/', '')
.replace('docs/fuel-specs/', '')}`;

Expand Down

0 comments on commit 4bebcd2

Please sign in to comment.