Skip to content

Commit

Permalink
Setup Documentation with Nextra (LedgerHQ#4071)
Browse files Browse the repository at this point in the history
* setup docs folder

* add metadata

* docsRepositoryBase

---------

Co-authored-by: lvndry <[email protected]>
  • Loading branch information
lvndry and lvndry authored Jul 24, 2023
1 parent 0ac4ab5 commit 3fca804
Show file tree
Hide file tree
Showing 19 changed files with 2,709 additions and 163 deletions.
4 changes: 3 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ libs/ledgerjs/packages/types-cryptoassets @ledgerhq/l
libs/ledgerjs/packages/hw-app-* @ledgerhq/live-blockchain-support
libs/coin-* @ledgerhq/live-blockchain-support
libs/domain-service @ledgerhq/live-blockchain-support
ledgerjs/packages/evm-tools @ledgerhq/live-blockchain-support
ledgerjs/packages/evm-tools @ledgerhq/live-blockchain-support
docs @ledgerhq/live-blockchain-support


# PTX
ledger-live-desktop/src/renderer/screens/exchange/ @ledgerhq/ptx
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']}
module.exports = { extends: ["@commitlint/config-conventional"] };
3 changes: 3 additions & 0 deletions docs/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
"extends": "next/core-web-vitals"
}
4 changes: 4 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.next/
build/
node_modules/
.DS_Store
Binary file added docs/assets/img/favicon.ico
Binary file not shown.
Binary file added docs/assets/img/ledger-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
9 changes: 9 additions & 0 deletions docs/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const withNextra = require("nextra")({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
});

module.exports = withNextra();

// If you have other Next.js configurations, you can pass them as the parameter:
// module.exports = withNextra({ /* other next.js config */ })
37 changes: 37 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "@ledgerhq/docs-libs",
"version": "0.1.0",
"description": "Documentation for the core libs used in Ledger Live",
"repository": {
"type": "git",
"url": "https://github.com/LedgerHQ/ledger-live.git"
},
"bugs": {
"url": "https://github.com/LedgerHQ/ledger-live/issues"
},
"homepage": "https://github.com/LedgerHQ/ledger-live/tree/develop/docs",
"scripts": {
"build": "next build",
"dev": "next dev",
"start": "next start",
"lint": "next lint"
},
"keywords": [
"documentation",
"Ledger",
"LedgerWallet"
],
"license": "ISC",
"dependencies": {
"next": "^13.4.10",
"nextra": "^2.10.0",
"nextra-theme-docs": "^2.10.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^20.4.2",
"eslint-config-next": "13.4.10",
"typescript": "^5.1.3"
}
}
16 changes: 16 additions & 0 deletions docs/pages/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"index": {
"title": "Home",
"display": "hidden",
"theme": {
"breadcrumb": true,
"footer": true,
"toc": true,
"pagination": false,
"layout": "full"
}
},
"getting-started": {
"title": "Getting Started"
}
}
8 changes: 8 additions & 0 deletions docs/pages/getting-started/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"index": {
"title": "Introduction"
},
"install": {
"title": "Install"
}
}
5 changes: 5 additions & 0 deletions docs/pages/getting-started/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Guide
---

Here we explain the purpose of the libs, the clients, how to navigate the documentation.
13 changes: 13 additions & 0 deletions docs/pages/getting-started/install.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Getting started
---

# Prerequisites

- [proto](https://moonrepo.dev/proto)

# Getting started

```bash
proto use
```
5 changes: 5 additions & 0 deletions docs/pages/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Ledger Libs Documentation
---

# Welcome to Ledger Libs Documentation
71 changes: 71 additions & 0 deletions docs/theme.config.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
const themeConfig = {
head: (
<>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:title" content="Ledger Libs Documentation" />
<meta property="og:description" content="Ledger Libs Official Documentation" />
<link rel="icon" href="/assets/img/favicon.ico" />
</>
),
logo: (
<div
style={{
display: "flex",
}}
>
<svg
style={{ fill: "currentColor" }}
viewBox="73 -10 1 150"
width="30"
height="27"
xmlns="http://www.w3.org/2000/svg"
>
<title>Ledger logo</title>
<path d="M0 91.6548V128H55.293V119.94H8.05631V91.6548H0ZM138.944 91.6548V119.94H91.707V127.998H147V91.6548H138.944ZM55.3733 36.3452V91.6529H91.707V84.3842H63.4296V36.3452H55.3733ZM0 0V36.3452H8.05631V8.05844H55.293V0H0ZM91.707 0V8.05844H138.944V36.3452H147V0H91.707Z" />
</svg>
<span style={{ marginLeft: "5px" }}>Ledger Libs</span>
</div>
),
project: {
link: "https://github.com/ledgerhq/ledger-live",
},
editLink: {
text: "Edit this page on GitHub →",
},
footer: {
text: (
<div style={{ width: "100%", display: "grid", placeItems: "center" }}>
<svg
style={{ fill: "currentColor", marginBottom: "20px" }}
version="1.1"
id="Layer_1"
xmlns="http://www.w3.org/2000/svg"
x="0px"
y="0px"
width="200px"
viewBox="0 0 2000.58 669.35"
>
<path
d="M1711.35,627.2v42.14h289.22V479.29h-42.14V627.2H1711.35z M1711.35,0v42.14h247.08v147.92h42.14V0H1711.35z M1562.2,326
v-97.92h66.11c32.23,0,43.8,10.74,43.8,40.08v17.35c0,30.16-11.16,40.49-43.8,40.49H1562.2z M1667.14,343.35
c30.16-7.85,51.23-35.95,51.23-69.41c0-21.07-8.26-40.08-23.96-55.37c-19.83-19.01-46.28-28.51-80.57-28.51h-92.96v289.22h41.32
V364.01h61.98c31.81,0,44.62,13.22,44.62,46.28v69h42.14V416.9c0-45.45-10.74-62.8-43.8-67.76V343.35z M1319.26,352.85h127.26
v-38.01h-127.26v-86.77h139.65v-38.01h-181.8v289.22h188v-38.01h-145.85V352.85z M1180.84,368.14v19.83
c0,41.73-15.29,55.37-53.71,55.37h-9.09c-38.43,0-57.02-12.4-57.02-69.83v-77.68c0-57.84,19.42-69.83,57.84-69.83h8.26
c37.6,0,49.58,14.05,49.99,52.89h45.45c-4.13-57.02-42.14-92.96-99.16-92.96c-27.68,0-50.82,8.68-68.17,25.2
c-26.03,24.38-40.49,65.7-40.49,123.54c0,55.78,12.4,97.1,38.01,122.71c17.35,16.94,41.32,26.03,64.87,26.03
c24.79,0,47.52-9.92,59.08-31.4h5.78v27.27h38.01V330.13h-111.97v38.01H1180.84z M816.43,228.07h45.04
c42.56,0,65.7,10.74,65.7,68.59v76.02c0,57.84-23.14,68.59-65.7,68.59h-45.04V228.07z M865.18,479.29
c78.92,0,108.25-59.91,108.25-144.61c0-85.94-31.4-144.61-109.08-144.61h-89.25v289.22H865.18z M575.55,352.85h127.26v-38.01H575.55
v-86.77H715.2v-38.01H533.4v289.22h188v-38.01H575.55V352.85z M331.78,190.06h-42.14v289.22H479.7v-38.01H331.78V190.06z M0,479.29
v190.06h289.22V627.2H42.14V479.29H0z M0,0v190.06h42.14V42.14h247.08V0H0z"
/>
</svg>
<p style={{ textAlign: "center" }}>Copyright © 2023 Ledger SAS. All rights reserved.</p>
</div>
),
docsRepositoryBase: "https://github.com/LedgerHQ/ledger-live/tree/main/docs",
},
};

export default themeConfig;
39 changes: 39 additions & 0 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"parserOptions": {
"project": "./tsconfig.json"
},
"compilerOptions": {
"baseUrl": ".",
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"isolatedModules": true,
"moduleResolution": "node",
"jsx": "preserve",
"module": "esnext",
"resolveJsonModule": true,
"paths": {
"@components/*": [
"components/*"
]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"coin:polkadot": "pnpm --filter coin-polkadot",
"coin:evm": "pnpm --filter coin-evm",
"domain": "pnpm --filter domain-service",
"doc": "pnpm --filter docs",
"mobile": "pnpm --filter live-mobile",
"common": "pnpm --filter live-common",
"common-tools": "pnpm --filter live-common-tools",
Expand Down Expand Up @@ -144,6 +145,13 @@
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]"
},
"packageExtensions": {
"eslint-config-next@*": {
"dependencies": {
"next": "*"
}
}
}
}
}
Loading

0 comments on commit 3fca804

Please sign in to comment.