Skip to content

Commit

Permalink
chore: handle review & improve reference doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdethier committed Mar 29, 2024
1 parent c9da099 commit 70af40f
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 33 deletions.
2 changes: 1 addition & 1 deletion packages/multiversx/typedoc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "MultiversX",
"name": "multiversx",
"entryPoints": [
"./src/index.ts"
]
Expand Down
2 changes: 1 addition & 1 deletion website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.docusaurus
.cache-loader

/docs/api
/docs/reference

# Misc
.DS_Store
Expand Down
6 changes: 3 additions & 3 deletions website/docs/client/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In addition to the Logion nodes, a Logion network also includes
* RPC nodes for accessing the chain,
* a directory service exposing the identity data of the Logion Legal Officer.

Logion's client interacts with the Logion chain (throught RPC nodes), the REST API exposed by each node of the network and the directory.
Logion's client interacts with the Logion chain (through RPC nodes), the REST API exposed by each node of the network and the directory.
The other services are publicly accessible.

The client's purpose is to merge data coming from the chain and the nodes
Expand All @@ -29,10 +29,10 @@ The client is able to run in several environments:
- a Node.JS application,
- a React Native based mobile app.

In function of the envrironment, the client will be instantiated differently (see below).
In function of the environment, the client will be instantiated differently (see below).

Another key concept is data caching. The client needs to interact with many data sources over the network. In order to
optimize the use of bandwith, data are cached and retrieved only when needed. The client relies on "states" to handle
optimize the use of bandwidth, data are cached and retrieved only when needed. The client relies on "states" to handle
the different caches. A state is an immutable object, when the developer calls a mutating method on the state, a new
state instance is returned and the previous state is discarded.

Expand Down
9 changes: 5 additions & 4 deletions website/docs/client/loc.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const draftRequest = await locsState.requestIdentityLoc({

:::warning
The default legal fee for an identity
LOC is 160 LGNTs. Another value of `legalFee` should have been discussed with the LLO beforehands,
LOC is 160 LGNTs. Another value of `legalFee` should have been discussed with the LLO beforehand,
otherwise it may reject the LOC.
:::

Expand Down Expand Up @@ -129,8 +129,8 @@ const draftRequest = await locsState.requestTransactionLoc({

:::warning
The default legal fee for a transaction
LOC is 2000 LGNTs. Another value of `legalFee` should have been discussed with the LLO beforehands,
otherwise it may reject the LOC.
LOC is 2000 LGNTs. Another value of `legalFee` should have been discussed with the LLO beforehand,
otherwise the LLO may reject the LOC.
:::

## Collection LOC
Expand Down Expand Up @@ -452,7 +452,7 @@ closedLoc = await closedLoc.addTokensRecord({
description: recordDescription,
files: [ file ],
},
signer: state.signer,
signer,
});
```

Expand All @@ -475,6 +475,7 @@ closedLoc = await closedLoc.addTokensRecord({
}),
],
},
signer,
});
```

Expand Down
22 changes: 18 additions & 4 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const darkTheme = themes.dracula;

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'logion SDK',
title: 'Logion SDK',
tagline: 'The blockchain infrastructure of safe digital ownership',
url: 'https://logion-network.github.io/',
baseUrl: '/logion-api/',
Expand Down Expand Up @@ -32,6 +32,20 @@ const config = {
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarItemsGenerator: async function({defaultSidebarItemsGenerator, ...args}) {
const sidebarItems = await defaultSidebarItemsGenerator(args);
const reference = sidebarItems.find(item => item.label === "Reference");
if(reference) {
const packagesIndex = reference.items.findIndex(item => item.type === "doc" && item.id === "reference/modules");
if(packagesIndex !== -1) {
const packages = reference.items[packagesIndex];
packages.label = "Packages";
reference.items.splice(packagesIndex, 1);
reference.items = [ packages ].concat(reference.items);
}
}
return sidebarItems;
},
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/logion-network/logion-api/tree/main/website/',
Expand All @@ -52,7 +66,7 @@ const config = {
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: 'logion SDK',
title: 'Logion SDK',
logo: {
alt: 'logion Logo',
src: 'img/logion218-twitter.png',
Expand All @@ -75,9 +89,9 @@ const config = {
label: 'Client',
},
{
to: '/docs/api',
to: '/docs/reference/modules',
position: 'left',
label: 'API',
label: 'Reference',
},
{
href: 'https://github.com/logion-network/logion-api',
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc",
"api-doc": "typedoc",
"api-doc": "typedoc && cp reference_category_.json docs/reference/_category_.json",
"clean": "rm -rf build"
},
"dependencies": {
Expand Down
9 changes: 9 additions & 0 deletions website/reference_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"label": "Reference",
"position": 4,
"link": {
"type": "generated-index",
"description": "Reference documentation of Logion SDK's packages."
}
}

15 changes: 0 additions & 15 deletions website/src/API.md

This file was deleted.

16 changes: 16 additions & 0 deletions website/src/modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Reference

All modules listed below are available as packages in the `@logion` scope
(i.e. module `client` has package `@logion/client`).

## Modules

- [client](modules/client.md)
- [client-browser](modules/client_browser.md)
- [client-node](modules/client_node.md)
- [client-react-native-fs](modules/client_react_native_fs.md)
- [client-expo](modules/client_expo.md)
- [crossmint](modules/crossmint.md)
- [extension](modules/extension.md)
- [multiversx](modules/multiversx.md)
- [node-api](modules/node_api.md)
9 changes: 5 additions & 4 deletions website/typedoc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://typedoc.org/schema.json",
"out": "docs/api",
"out": "docs/reference",
"plugin": ["typedoc-plugin-markdown"],
"excludeExternals": false,
"entryPointStrategy": "packages",
Expand All @@ -15,13 +15,14 @@
"../packages/multiversx",
"../packages/node-api"
],
"readme": "src/API.md",
"readme": "src/modules.md",
"skipErrorChecking": true,
"entryDocument": "API.md",
"entryDocument": "modules.md",
"hideBreadcrumbs": false,
"hideInPageTOC": false,
"name": "API",
"name": "Reference",
"excludePrivate": true,
"excludeProtected": true,
"excludeInternal": true,
"gitRevision": "main"
}

0 comments on commit 70af40f

Please sign in to comment.