Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
liubq7 committed Jan 17, 2022
2 parents aef1db2 + 600b329 commit 039a588
Show file tree
Hide file tree
Showing 45 changed files with 8,209 additions and 95 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docusaurus/*
10 changes: 1 addition & 9 deletions devtools/azure/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
steps:
- script: |
yarn workspace @ckb-lumos/config-manager build
yarn workspace @ckb-lumos/helpers build
yarn workspace @ckb-lumos/rpc build
yarn workspace @ckb-lumos/testkit build
yarn workspace @ckb-lumos/common-scripts build
yarn workspace @ckb-lumos/hd build
yarn workspace @ckb-lumos/hd-cache build
yarn workspace @ckb-lumos/ckb-indexer build
yarn workspace @ckb-lumos/lumos build
yarn run build
yarn c8 --reporter=cobertura --reporter=html yarn run test --ignore "**/*/*sql-indexer*"
yarn workspaces run fmt
yarn workspaces run lint
Expand Down
13 changes: 13 additions & 0 deletions docusaurus/docs/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
sidebar_position: 1
---

# Tutorial

Lumos is a full-featured JavaScript(TypeScript) library for building Nervos CKB dApp.

## Quick Start

```
yarn add @ckb-lumos/lumos
```
20 changes: 20 additions & 0 deletions docusaurus/website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions docusaurus/website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions docusaurus/website/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
Empty file.
35 changes: 35 additions & 0 deletions docusaurus/website/docs/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
sidebar_position: 1
---

# Tutorial Intro

Let's discover **Docusaurus in less than 5 minutes**.

## Getting Started

Get started by **creating a new site**.

Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.

## Generate a new site

Generate a new Docusaurus site using the **classic template**:

```shell
npm init docusaurus@latest my-website classic
```

## Start your site

Run the development server:

```shell
cd my-website

npx docusaurus start
```

Your site starts at `http://localhost:3000`.

Open `docs/intro.md` and edit some lines: the site **reloads automatically** and displays your changes.
106 changes: 106 additions & 0 deletions docusaurus/website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");

/** @type {import('@docusaurus/types').Config} */
const config = {
title: "Lumos Docs",
tagline: "Full featured JavaScript(TypeScript) based dApp library for Nervos CKB",
url: "https://nervosnetwork.github.io",
baseUrl: "/lumos/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon.ico",
organizationName: "nervosnetwork", // Usually your GitHub org/user name.
projectName: "lumos", // Usually your repo name.

presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
path: "../docs",
sidebarPath: require.resolve("./sidebars.js"),
editUrl:
"https://github.com/nervosnetwork/lumos/tree/develop/docusaurus/website/",
},
blog: {
showReadingTime: true,
editUrl:
"https://github.com/nervosnetwork/lumos/tree/develop/docusaurus/website/",
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: "Lumos Docs",
// TODO need a logo
// logo: {
// alt: "Lumos Docs",
// src: "img/logo.svg",
// },
items: [
{
type: "doc",
docId: "intro",
position: "left",
label: "Docs",
},
// { to: "/blog", label: "Blog", position: "left" },
{
href: "https://github.com/nervosnetwork/lumos",
label: "GitHub",
position: "right",
},
],
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Tutorial",
to: "/docs/intro",
},
{
label: "RFCs",
href: "https://github.com/nervosnetwork/rfcs",
},
],
},
{
title: "More",
items: [
{
label: "CKB",
href: "https://github.com/nervosnetwork/ckb",
},
{
label: "GitHub",
href: "https://github.com/nervosnetwork/lumos",
},
],
},
],
// copyright: `Copyright © ${new Date().getFullYear()} Lumos, Inc. Built with Docusaurus.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};

module.exports = config;
43 changes: 43 additions & 0 deletions docusaurus/website/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "docusaurus",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.14",
"@docusaurus/preset-classic": "2.0.0-beta.14",
"@mdx-js/react": "^1.6.21",
"clsx": "^1.1.1",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.14",
"@tsconfig/docusaurus": "^1.0.4",
"typescript": "^4.5.2"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
31 changes: 31 additions & 0 deletions docusaurus/website/sidebars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/

// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually
/*
tutorialSidebar: [
{
type: 'category',
label: 'Tutorial',
items: ['hello'],
},
],
*/
};

module.exports = sidebars;
11 changes: 11 additions & 0 deletions docusaurus/website/src/components/HomepageFeatures.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.features {
display: flex;
align-items: center;
padding: 2rem 0;
width: 100%;
}

.featureSvg {
height: 200px;
width: 200px;
}
Loading

0 comments on commit 039a588

Please sign in to comment.