Skip to content

Commit

Permalink
chore: implemented relative path parsing for TS docs (#505)
Browse files Browse the repository at this point in the history
* chore: implemented relative path parsing for TS docs

* chore: fixing issue for TS docs

* chore: fix spell check

* chore: updated fuels-ts commit to new docs

* Revert "chore: updated fuels-ts commit to new docs"

This reverts commit c9207a2.

* Update src/lib/plugins/mdbook-example-import.ts

Co-authored-by: Anderson Arboleya <[email protected]>

---------

Co-authored-by: Anderson Arboleya <[email protected]>
  • Loading branch information
petertonysmith94 and arboleya authored Nov 25, 2024
1 parent b16a3c1 commit 7c0f2f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/guides/docs/fuel-connectors/non-technical-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This is expected, and it's because Fuel Connectors use a technical tool called a

This predicate is kind of like a post office box that automatically forwards to your home address and visa versa. Anything you send from your wallet is relayed through the predicate, and anything you receive from elsewhere you receive through predicate.

The predicate is audited for secur. And your wallet address is still your wallet address. You will just see the predicate address on Fuel.
The predicate is audited for secure. And your wallet address is still your wallet address. You will just see the predicate address on Fuel.

## 2. Funds Display in Wallets

Expand Down
6 changes: 5 additions & 1 deletion spell-check-custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,8 @@ Devnet
devnet
pre
NextJs
toml
toml
EVM
SVM
Solana
dApps
12 changes: 4 additions & 8 deletions src/lib/plugins/mdbook-example-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,9 @@ export function handleExampleImports(
if (paths.length > 1) exampleName = filePath.split(':').pop();
} else if (node.type === 'text') {
// handle ts-sdk docs example format
filePath = filePath.replace('<<< @/', '').replace('<<< @', '');
const relativePath = dirname.replace('docs/fuels-ts/', '')
filePath = filePath.replace('<<< @./', `${relativePath}/`).replace(/<<< @\/?/, '');

if (
filePath.startsWith('docs-snippets') ||
filePath.startsWith('demo-fuels')
) {
filePath = `apps/${filePath}`;
}
const pathData = filePath.split('{');
filePath = pathData[0];

Expand Down Expand Up @@ -134,7 +129,8 @@ export function handleExampleImports(
.replace(
'fuels-ts/create-fuels-counter-guide',
'fuels-ts/apps/create-fuels-counter-guide'
);
)
.replace('fuels-ts/docs', 'fuels-ts/apps/docs');
}
const fileContent = fs.readFileSync(fileAbsPath, 'utf8');
const cachedFile = getFilesOnCache(fileAbsPath);
Expand Down

0 comments on commit 7c0f2f9

Please sign in to comment.