Skip to content

Commit 72a3587

Browse files
authored
Merge pull request #33 from movabletype/fix/generate-index
Generate index page DOC-1047
2 parents 3b16531 + ad68fc1 commit 72a3587

12 files changed

Lines changed: 1287 additions & 245 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ install:
22
docker-compose build
33

44
build:
5-
docker-compose run docs
5+
docker-compose run --rm docs
66

77
start-dev-server:
88
docker-compose run docs yarn dev-server

build-index.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/sh
2+
3+
cat << EOS > docs/index.html
4+
<!doctype html>
5+
<html>
6+
<head>
7+
<meta charset="utf-8">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
<title>Movable Type Data API</title>
10+
<script src="assets/main.js"></script>
11+
</head>
12+
<body>
13+
<header>
14+
<a href="https://movabletype.jp/">
15+
<img src="https://movabletype.jp/assets/images/mtlogo.svg" alt="Movable Type">
16+
</a>
17+
</header>
18+
<div class="container">
19+
<div class="row">
20+
<div class="col-md-9">
21+
<main>
22+
$(npx marked -i src/markdown/index_main.md)
23+
</main>
24+
</div>
25+
<div class="col-md-3">
26+
<aside>
27+
<nav>
28+
$(npx marked -i src/markdown/index_sidebar.md)
29+
</nav>
30+
</aside>
31+
</div>
32+
</div>
33+
</div>
34+
</main>
35+
<footer class="footer">
36+
<span>© Six Apart Ltd.</span>
37+
</footer>
38+
</body>
39+
</html>
40+
EOS

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3'
22
services:
33
docs:
44
build: .
5-
command: yarn redoc
5+
command: sh -c "yarn index && yarn redoc"
66
volumes:
77
- .:/root/docs
88
- /root/docs/node_modules

docs/assets/main.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Movable Type Data API</title>
7+
<script src="assets/main.js"></script>
8+
</head>
9+
<body>
10+
<header>
11+
<a href="https://movabletype.jp/">
12+
<img src="https://movabletype.jp/assets/images/mtlogo.svg" alt="Movable Type">
13+
</a>
14+
</header>
15+
<div class="container">
16+
<div class="row">
17+
<div class="col-md-9">
18+
<main>
19+
<h1 id="data-api-ドキュメント">Data API ドキュメント</h1>
20+
<h2 id="はじめに">はじめに</h2>
21+
<ul>
22+
<li><a href="https://www.movabletype.jp/developers/data-api/getting-started/">はじめに</a></li>
23+
<li><a href="https://www.movabletype.jp/developers/data-api/quick-start/">クイック スタート ガイド</a></li>
24+
</ul>
25+
<h2 id="api-リファレンス">API リファレンス</h2>
26+
<ul>
27+
<li><a href="v1.html">API リファレンス (v1)</a></li>
28+
<li><a href="v2.html">API リファレンス (v2)</a></li>
29+
<li><a href="v3.html">API リファレンス (v3)</a></li>
30+
<li><a href="v4.html">API リファレンス (v4)</a></li>
31+
<li><a href="v5.html">API リファレンス (v5)</a></li>
32+
</ul>
33+
<h2 id="sdk">SDK</h2>
34+
<ul>
35+
<li><a href="https://github.com/movabletype/mt-data-api-sdk-js/wiki/DataAPI-SDK-japanese-MT.DataAPI">JavaScript SDK</a></li>
36+
<li><a href="https://github.com/movabletype/mt-data-api-sdk-swift">Swift SDK</a></li>
37+
</ul>
38+
</main>
39+
</div>
40+
<div class="col-md-3">
41+
<aside>
42+
<nav>
43+
<h3 id="カテゴリ">カテゴリ</h3>
44+
<ul>
45+
<li><a href="https://www.movabletype.jp/developers/data-api/">Movable Type Data API</a></li>
46+
<li><a href="https://github.com/movabletype/mt-data-api-sdk-js/wiki/DataAPI-SDK-japanese-MT.DataAPI">Movable Type Data API SDK ガイド</a></li>
47+
<li><a href="https://github.com/movabletype/Documentation/wiki/Japanese-developer-guide">プラグイン開発</a></a></li></li>
48+
<li><a href="https://www.movabletype.jp/documentation/mt6/developer/theme/">テーマ開発</a></li>
49+
<li><a href="https://github.com/movabletype/Documentation/wiki/Movable-Type-Chart-API">Movable Type Chart API</a></li>
50+
</ul>
51+
<h3 id="リファレンス">リファレンス</h3>
52+
<ul>
53+
<li><a href="https://movabletype.jp/documentation/appendices/tags/">テンプレートタグ</a></li>
54+
<li><a href="https://movabletype.jp/documentation/appendices/modifiers/">グローバルモディファイア</a></li>
55+
<li><a href="https://movabletype.jp/documentation/appendices/config-directives/">環境変数</a></li>
56+
</ul>
57+
<h3 id="関連リンク">関連リンク</h3>
58+
<ul>
59+
<li><a href="https://www.sixapart.jp/movabletype/news/">Movable Type News</a></li>
60+
<li><a href="https://movabletype.jp/blog/">ブログ</a></li>
61+
<li><a href="https://movabletype.jp/release-notes/">リリースノート</a></li>
62+
<li><a href="https://plugins.movabletype.jp/">プラグイン・テーマディレクトリ</a></li>
63+
<li><a href="https://www.sixapart.jp/jobs/">人材募集</a></li>
64+
</ul>
65+
</nav>
66+
</aside>
67+
</div>
68+
</div>
69+
</div>
70+
</main>
71+
<footer class="footer">
72+
<span>© Six Apart Ltd.</span>
73+
</footer>
74+
</body>
75+
</html>

package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
"main": "index.js",
66
"scripts": {
77
"build": "gulp build",
8+
"index": "sh build-index.sh",
89
"download": "sh download-openapi.sh",
910
"redoc": "sh redoc-build.sh",
10-
"start-dev-server": "gulp start-dev-server"
11+
"start-dev-server": "gulp start-dev-server",
12+
"webpack": "webpack"
1113
},
1214
"repository": {
1315
"type": "git",
@@ -22,8 +24,16 @@
2224
"homepage": "https://github.com/movabletype/mt-docs-data-api-reference#readme",
2325
"devDependencies": {
2426
"child_process": "^1.0.2",
27+
"css-loader": "^6.7.1",
2528
"gulp": "^4.0.2",
2629
"gulp-connect": "^5.7.0",
27-
"redoc-cli": "^0.13.20"
30+
"marked": "^4.1.1",
31+
"redoc-cli": "^0.13.20",
32+
"style-loader": "^3.3.1",
33+
"webpack": "^5.74.0",
34+
"webpack-cli": "^4.10.0"
35+
},
36+
"dependencies": {
37+
"bootstrap": "^5.2.2"
2838
}
2939
}

src/assets/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import "bootstrap/dist/css/bootstrap.min.css";
2+
import "./style.css";

src/assets/style.css

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
* {
2+
box-sizing: border-box !important;
3+
}
4+
5+
a {
6+
color: #0077c2;
7+
}
8+
9+
a:hover {
10+
text-decoration: none;
11+
}
12+
13+
body {
14+
display: flex;
15+
flex-direction: column;
16+
min-height: 100vh;
17+
}
18+
19+
header{
20+
padding: 0.75rem 1rem !important;
21+
border-bottom: solid 1px #c1c1c1;
22+
}
23+
24+
header img {
25+
width: 180px;
26+
height: auto;
27+
}
28+
29+
.container {
30+
max-width: 100%;
31+
min-height: calc( 100vh - 110px);
32+
padding: 0;
33+
}
34+
35+
.row {
36+
min-height: calc( 100vh - 110px);
37+
--bs-gutter-x: 0;
38+
}
39+
40+
.row > * {
41+
padding: 2rem;
42+
}
43+
44+
.row > *:first-of-type {
45+
border-right: solid 1px #c1c1c1;
46+
}
47+
48+
.col-md-3 {
49+
background: #f5f5f5;
50+
}
51+
52+
main h1 {
53+
padding-bottom: 1rem;
54+
margin-bottom: 1rem;
55+
font-size: 2rem;
56+
font-weight: bold;
57+
border-bottom: solid 1px #c1c1c1;
58+
}
59+
60+
main h2 {
61+
font-size: 1.5rem;
62+
font-weight: bold;
63+
}
64+
65+
main h3 {
66+
font-size: 1.25rem;
67+
font-weight: bold;
68+
}
69+
70+
main ul {
71+
margin-bottom: 2rem;
72+
list-style: none;
73+
}
74+
75+
main ul li {
76+
position: relative;
77+
}
78+
79+
main ul li:before {
80+
position: absolute;
81+
top: 0.6rem;
82+
left: -0.75rem;
83+
display: block;
84+
content: "";
85+
width: 5px;
86+
height: 5px;
87+
background: #0077c2;
88+
border-radius: 50%;
89+
}
90+
91+
aside h3 {
92+
font-size: 1.125rem;
93+
font-weight: bold;
94+
}
95+
96+
aside ul {
97+
margin-bottom: 2rem;
98+
list-style: none;
99+
}
100+
101+
aside ul li {
102+
position: relative;
103+
}
104+
105+
aside ul li:before {
106+
position: absolute;
107+
top: 0.6rem;
108+
left: -0.75rem;
109+
display: block;
110+
content: "";
111+
width: 5px;
112+
height: 5px;
113+
background: #0077c2;
114+
border-radius: 50%;
115+
}
116+
117+
footer {
118+
border-top: solid 1px #c1c1c1;
119+
margin-top: auto;
120+
padding: 0.75rem 1rem !important;
121+
text-align: center;
122+
}

src/markdown/index_main.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Data API ドキュメント
2+
3+
## はじめに
4+
5+
- [はじめに](https://www.movabletype.jp/developers/data-api/getting-started/)
6+
- [クイック スタート ガイド](https://www.movabletype.jp/developers/data-api/quick-start/)
7+
8+
## API リファレンス
9+
10+
- [API リファレンス (v1)](v1.html)
11+
- [API リファレンス (v2)](v2.html)
12+
- [API リファレンス (v3)](v3.html)
13+
- [API リファレンス (v4)](v4.html)
14+
- [API リファレンス (v5)](v5.html)
15+
16+
17+
## SDK
18+
19+
- [JavaScript SDK](https://github.com/movabletype/mt-data-api-sdk-js/wiki/DataAPI-SDK-japanese-MT.DataAPI)
20+
- [Swift SDK](https://github.com/movabletype/mt-data-api-sdk-swift)

src/markdown/index_sidebar.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
### カテゴリ
2+
- [Movable Type Data API](https://www.movabletype.jp/developers/data-api/)
3+
- [Movable Type Data API SDK ガイド](https://github.com/movabletype/mt-data-api-sdk-js/wiki/DataAPI-SDK-japanese-MT.DataAPI)
4+
- [プラグイン開発](https://github.com/movabletype/Documentation/wiki/Japanese-developer-guide)</a></li>
5+
- [テーマ開発](https://www.movabletype.jp/documentation/mt6/developer/theme/)
6+
- [Movable Type Chart API](https://github.com/movabletype/Documentation/wiki/Movable-Type-Chart-API)
7+
8+
### リファレンス
9+
10+
- [テンプレートタグ](https://movabletype.jp/documentation/appendices/tags/)
11+
- [グローバルモディファイア](https://movabletype.jp/documentation/appendices/modifiers/)
12+
- [環境変数](https://movabletype.jp/documentation/appendices/config-directives/)
13+
14+
### 関連リンク
15+
- [Movable Type News](https://www.sixapart.jp/movabletype/news/)
16+
- [ブログ](https://movabletype.jp/blog/)
17+
- [リリースノート](https://movabletype.jp/release-notes/)
18+
- [プラグイン・テーマディレクトリ](https://plugins.movabletype.jp/)
19+
- [人材募集](https://www.sixapart.jp/jobs/)

0 commit comments

Comments
 (0)