forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR cosmos#4787: Updated docs build process
- Loading branch information
1 parent
d3aa9fe
commit 450c8ce
Showing
92 changed files
with
17,880 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ tools/bin/* | |
examples/build/* | ||
docs/_build | ||
docs/tutorial | ||
docs/node_modules | ||
dist | ||
tools-stamp | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<div> | ||
{{url}} | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
computed: { | ||
url() { | ||
const c = this.$themeConfig | ||
if (c && c.repo && c.docsDir && c.docsBranch) { | ||
return `https://github.com/${c.repo}/tree/${c.docsBranch}/${c.docsDir}/${this.$page.relativePath}` | ||
} | ||
}, | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,95 @@ | ||
const glob = require("glob"); | ||
const markdownIt = require("markdown-it"); | ||
const meta = require("markdown-it-meta"); | ||
const fs = require("fs"); | ||
const _ = require("lodash"); | ||
|
||
const sidebar = (directory, array) => { | ||
return array.map(i => { | ||
const children = _.sortBy( | ||
glob | ||
.sync(`./${directory}/${i[1]}/*.md`) | ||
.map(path => { | ||
const md = new markdownIt(); | ||
const file = fs.readFileSync(path, "utf8"); | ||
md.use(meta); | ||
md.render(file); | ||
const order = md.meta.order; | ||
return { path, order }; | ||
}) | ||
.filter(f => f.order !== false), | ||
["order", "path"] | ||
) | ||
.map(f => f.path) | ||
.filter(f => !f.match("readme")); | ||
return { | ||
title: i[0], | ||
children | ||
}; | ||
}); | ||
}; | ||
|
||
module.exports = { | ||
title: "Cosmos SDK Documentation", | ||
description: "Documentation for the Cosmos SDK and Gaia.", | ||
ga: "UA-51029217-2", | ||
dest: "./dist/docs", | ||
base: "/docs/", | ||
markdown: { | ||
lineNumbers: true | ||
title: "Cosmos SDK", | ||
base: process.env.VUEPRESS_BASE || "/", | ||
locales: { | ||
"/": { | ||
lang: "en-US" | ||
}, | ||
"/ru/": { | ||
lang: "ru" | ||
}, | ||
}, | ||
themeConfig: { | ||
repo: "cosmos/cosmos-sdk", | ||
editLinks: true, | ||
docsDir: "docs", | ||
editLinks: true, | ||
docsBranch: "master", | ||
editLinkText: "Edit this page on Github", | ||
lastUpdated: true, | ||
algolia: { | ||
apiKey: "a6e2f64347bb826b732e118c1366819a", | ||
indexName: "cosmos_network", | ||
debug: false | ||
}, | ||
nav: [ | ||
{ text: "Back to Cosmos", link: "https://cosmos.network" }, | ||
{ text: "RPC", link: "https://cosmos.network/rpc/" } | ||
], | ||
sidebar: [ | ||
{ | ||
title: "Overview", | ||
collapsable: true, | ||
children: [ | ||
"/intro/", | ||
"/intro/why-app-specific", | ||
"/intro/sdk-app-architecture", | ||
"/intro/sdk-design" | ||
] | ||
locales: { | ||
"/": { | ||
label: "English", | ||
sidebar: sidebar("", [ | ||
["Intro", "intro"], | ||
["Basics", "basics"], | ||
["SDK Core", "core"], | ||
["About Modules", "modules"], | ||
["Using the SDK", "sdk"], | ||
["Interfaces", "interfaces"] | ||
]) | ||
}, | ||
"/ru/": { | ||
label: "Русский", | ||
sidebar: sidebar("ru", [ | ||
["Введение", "intro"], | ||
["Основы", "basics"], | ||
["SDK Core", "core"], | ||
["Модули", "modules"], | ||
["Используем SDK", "sdk"], | ||
["Интерфейсы", "interfaces"] | ||
]) | ||
}, | ||
'/kr/': { | ||
label: '한국어', | ||
sidebar: sidebar('kr', [ | ||
['소개', 'intro'], | ||
['기초', 'basics'], | ||
['SDK Core', 'core'], | ||
['모듈들', 'modules'], | ||
['프로그램 사용', 'sdk'], | ||
['인터페이스', 'interfaces'], | ||
]), | ||
}, | ||
{ | ||
title: "Tutorial", | ||
collapsable: true, | ||
children: [ | ||
"/tutorial/", | ||
"/tutorial/app-design", | ||
"/tutorial/app-init", | ||
"/tutorial/types", | ||
"/tutorial/key", | ||
"/tutorial/keeper", | ||
"/tutorial/msgs-handlers", | ||
"/tutorial/set-name", | ||
"/tutorial/buy-name", | ||
"/tutorial/queriers", | ||
"/tutorial/alias", | ||
"/tutorial/codec", | ||
"/tutorial/cli", | ||
"/tutorial/rest", | ||
"/tutorial/module", | ||
"/tutorial/genesis", | ||
"/tutorial/app-complete", | ||
"/tutorial/entrypoint", | ||
"/tutorial/gomod", | ||
"/tutorial/build-run", | ||
"/tutorial/run-rest" | ||
] | ||
'/cn/': { | ||
label: '中文', | ||
sidebar: sidebar('cn', [ | ||
['介绍', 'intro'], | ||
['基本', 'basics'], | ||
['SDK Core', 'core'], | ||
['模块', 'modules'], | ||
['使用该程序', 'sdk'], | ||
['接口', 'interfaces'], | ||
]), | ||
}, | ||
{ | ||
title: "Interfaces", | ||
collapsable: true, | ||
children: [ | ||
"/interfaces/", | ||
"/interfaces/cli", | ||
"/interfaces/service-providers", | ||
"/interfaces/lite/", // this renders the readme | ||
"/interfaces/lite/getting_started", | ||
"/interfaces/lite/specification" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
export default ({ router }) => { | ||
router.addRoutes([{ path: "/testnet/", redirect: "/" }]) | ||
} | ||
import axios from 'axios' | ||
import Vue from 'vue' | ||
|
||
Vue.use({ | ||
install (Vue) { | ||
Vue.prototype.$axios = axios.create() | ||
} | ||
}) |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,4 @@ | |
|
||
## References | ||
|
||
- {reference link} | ||
- {reference link} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Module Manager and `AppModule` Interface | ||
|
||
## Pre-requisite Reading | ||
|
||
- [Introduction to SDK Modules](./intro.md) | ||
|
||
## Synopsis | ||
|
||
Cosmos SDK modules need to implement the [`AppModule` interfaces](#application-module-interfaces), in order to be managed by the application's [module manager](#module-manager). The module manager plays an important role in [`message` and `query` routing](../core/baseapp.md#routing), and allows the application developer to set the order of execution of a variety of functions like [`BeginBlocker` and `EndBlocker`](../basics/app-anatomy.md#begingblocker-and-endblocker). | ||
|
||
## Application Module Interfaces | ||
|
||
[Application module interfaces](https://github.com/cosmos/cosmos-sdk/blob/master/types/module/module.go) exist to facilitate the composition of modules together to form a functional SDK application. There are 3 main application module interfaces: | ||
|
||
- [`AppModuleBasic`](#appmodulebasic) for independent module functionalities. | ||
- [`AppModule`](#appmodule) for inter-dependent module functionalities (except genesis-related functionalities). | ||
- [`AppModuleGenesis`](#appmodulegenesis) for inter-dependent genesis-related module functionalities. | ||
|
||
The `AppModuleBasic` interface exists to define independent methods of the module, i.e. those that do not depend on other modules in the application. This allows for the construction of the basic application structure early in the application definition, generally in the `init()` function of the [main application file](../basics/app-antomy.md#core-application-file). | ||
|
||
The `AppModule` interface exists to define inter-dependent module methods. Many modules need to interact with other modules, typically through [`keeper`s](./keeper.md), which means there is a need for an interface where modules list their `keeper`s and other methods that require a reference to another module's object. `AppModule` interface also enables the module manager to set the order of execution between module's methods like `BeginBlock` and `EndBlock`, which is important in cases where the order of execution between modules matters in the context of the application. | ||
|
||
Lastly the interface for genesis functionality `AppModuleGenesis` is separated out from full module functionality `AppModule` so that modules which | ||
are only used for genesis can take advantage of the `Module` patterns without having to define many placeholder functions. | ||
|
||
### `AppModuleBasic` | ||
|
||
### `AppModule` | ||
|
||
### `AppModuleGenesis` | ||
|
||
### Implementing the Application Module Interfaces | ||
|
||
## Module Manager |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.