Skip to content

Commit a7e30ac

Browse files
committed
CI: create website
1 parent f91118b commit a7e30ac

File tree

11 files changed

+4311
-15
lines changed

11 files changed

+4311
-15
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: test
2+
on: [push, pull_request]
3+
env:
4+
CI: true
5+
jobs:
6+
test:
7+
name: "Test on Node.js ${{ matrix.node_version }}"
8+
runs-on: ubuntu-18.04
9+
strategy:
10+
matrix:
11+
node_version: [12.x, 14.x]
12+
steps:
13+
- name: checkout
14+
uses: actions/checkout@v2
15+
- name: setup Node.js ${{ matrix.node_version }}
16+
uses: actions/setup-node@v2
17+
with:
18+
node_version: ${{ matrix.node_version }}
19+
- name: Install
20+
run: yarn install
21+
- name: Test
22+
run: yarn test

.github/workflows/website.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: website
2+
on:
3+
push:
4+
branches:
5+
- master
6+
workflow_dispatch:
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-18.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v2
15+
with:
16+
node-version: 14
17+
- name: Set Env
18+
run: |
19+
echo "CURRENT_VERSION=$(node -p 'require("./package.json").version')" >> $GITHUB_ENV
20+
- name: Install
21+
run: yarn install
22+
- name: Build
23+
run: |
24+
yarn install
25+
npm run website -- --metadataversion="${CURRENT_VERSION}"
26+
env:
27+
CURRENT_VERSION: ${{ env.CURRENT_VERSION }}
28+
working-directory: example/
29+
- name: Deploy
30+
uses: peaceiris/actions-gh-pages@v3
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: ./example/dist

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

example/.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

example/dist/index.html

Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>textlint-rule-preset-japanese</title>
6+
<style>
7+
* {
8+
box-sizing: border-box
9+
}
10+
11+
:root {
12+
--sans: 1em/1.6 system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Droid Sans, Helvetica Neue, Fira Sans, sans-serif;
13+
--mono: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, 'Courier New', monospace;
14+
--c1: #0074d9;
15+
--c2: #eee;
16+
--c3: #fff;
17+
--c4: #000;
18+
--c5: #fff;
19+
--m1: 8px;
20+
--rc: 8px;
21+
}
22+
23+
@media (prefers-color-scheme: dark) {
24+
:root {
25+
--c2: #333;
26+
--c3: #1e1f20;
27+
--c4: #fff;
28+
}
29+
}
30+
31+
html {
32+
-ms-text-size-adjust: 100%;
33+
-webkit-text-size-adjust: 100%;
34+
35+
}
36+
37+
/* General settings */
38+
39+
body {
40+
margin: 0;
41+
font: var(--sans);
42+
font-weight: 400;
43+
font-style: normal;
44+
text-rendering: optimizeLegibility;
45+
-webkit-font-smoothing: antialiased;
46+
background-color: var(--c3);
47+
color: var(--c4);
48+
}
49+
50+
img, iframe {
51+
border: none;
52+
max-width: 100%
53+
}
54+
55+
a {
56+
color: var(--c1);
57+
text-decoration: none
58+
}
59+
60+
a:hover {
61+
color: var(--c1);
62+
text-decoration: underline
63+
}
64+
65+
pre {
66+
font: 1em/1.6 var(--mono);
67+
background: var(--c2);
68+
padding: 1em;
69+
overflow: auto
70+
}
71+
72+
code {
73+
font: 1em/1.6 var(--mono);
74+
}
75+
76+
blockquote {
77+
border-left: 5px solid var(--c2);
78+
padding: 1em 1.5em;
79+
margin: 0
80+
}
81+
82+
hr {
83+
border: 0;
84+
border-bottom: 1px solid var(--c4)
85+
}
86+
87+
/* Headlines */
88+
89+
h1, h2, h3, h4, h5, h6 {
90+
margin: 0.6em 0;
91+
font-weight: normal
92+
}
93+
94+
h1 {
95+
font-size: 2.625em;
96+
line-height: 1.2
97+
}
98+
99+
h2 {
100+
font-size: 1.625em;
101+
line-height: 1.2
102+
}
103+
104+
h3 {
105+
font-size: 1.3125em;
106+
line-height: 1.24
107+
}
108+
109+
h4 {
110+
font-size: 1.1875em;
111+
line-height: 1.23
112+
}
113+
114+
h5, h6 {
115+
font-size: 1em;
116+
font-weight: bold
117+
}
118+
119+
/* Table */
120+
121+
table {
122+
border-collapse: collapse;
123+
border-spacing: 0;
124+
margin: 1em 0
125+
}
126+
127+
th, td {
128+
text-align: left;
129+
vertical-align: top;
130+
border: 1px solid;
131+
padding: 0.4em
132+
}
133+
134+
thead, tfoot {
135+
background: var(--c2)
136+
}
137+
138+
/* Rounded Corners*/
139+
140+
pre, code, input, select, textarea, button, img {
141+
border-radius: var(--rc)
142+
}
143+
144+
145+
/* Forms */
146+
147+
input, select, textarea {
148+
font-size: 1em;
149+
color: var(--c4);
150+
background: var(--c2);
151+
border: 0;
152+
padding: 0.6em
153+
}
154+
155+
button, input[type=submit], input[type=reset], input[type="button"] {
156+
-webkit-appearance: none;
157+
font-size: 1em;
158+
display: inline-block;
159+
color: var(--c5);
160+
background: var(--c1);
161+
border: 0;
162+
margin: 4px;
163+
padding: 0.6em;
164+
cursor: pointer;
165+
text-align: center
166+
}
167+
168+
button:hover, button:focus, input:hover, textarea:hover, select:hover {
169+
opacity: 0.8
170+
}
171+
172+
/* Infinite Grid */
173+
174+
section {
175+
display: flex;
176+
flex-flow: row wrap
177+
}
178+
179+
[style*="--c:"], section > section, aside, article {
180+
flex: var(--c, 1);
181+
margin: var(--m1)
182+
}
183+
184+
/* Cards */
185+
186+
article {
187+
background: var(--c2);
188+
border-radius: var(--rc);
189+
padding: 1em;
190+
box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.3)
191+
}
192+
193+
[style*="--c:"]:first-child, section > section:first-child, article:first-child {
194+
margin-left: 0
195+
}
196+
197+
[style*="--c:"]:last-child, section > section:last-child, article:last-child {
198+
margin-right: 0
199+
}
200+
</style>
201+
<style>
202+
.main {
203+
padding: 1em 0;
204+
}
205+
206+
.content {
207+
width: 800px;
208+
margin: auto;
209+
position: relative;
210+
}
211+
212+
.textarea {
213+
width: 100%;
214+
height: 10em;
215+
font-size: 24px;
216+
}
217+
218+
.side {
219+
position: fixed;
220+
font-size: 18px;
221+
padding: 0.5em;
222+
bottom: 0;
223+
display: flex;
224+
align-items: center;
225+
}
226+
227+
.status {
228+
color: var(--c3);
229+
background: var(--c1);
230+
padding: 0.5em 1em;
231+
}
232+
</style>
233+
</head>
234+
<body data-textlint-editor-embedded>
235+
<div class="content">
236+
<main class="main">
237+
<label for="input">Input text for linting:</label>
238+
<textarea id="input" class="textarea" spellcheck="false"></textarea>
239+
</main>
240+
<button id="install">Install</button>
241+
<label for="install">* require <a href="https://github.com/textlint/editor/tree/master/packages/webextension">textlint-editor
242+
browser extension</a></label>
243+
<div id="metadata" class="metadata"></div>
244+
</div>
245+
<aside class="side">
246+
<div id="js-status" class="status">Loading...</div>
247+
</aside>
248+
<script type="module">
249+
import { run } from "https://cdn.skypack.dev/textchecker-element/public-dist/textchecker-element.es.js";
250+
251+
run("./textlint-worker.js");
252+
</script>
253+
</body>
254+
</html>

example/dist/textlint-worker.js

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

example/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
2-
"name": "example",
32
"private": true,
3+
"name": "textlint-rule-preset-japanese",
4+
"homepage": "https://github.com/textlint-ja/textlint-rule-preset-japanese",
5+
"version": "1.0.0-local",
46
"scripts": {
5-
"test": "textlint README.md"
7+
"test": "textlint README.md",
8+
"website": "textlint-website-generator --output-dir ./dist"
69
},
710
"author": "azu",
811
"license": "MIT",
912
"dependencies": {
13+
"@textlint/website-generator": "^0.10.3",
1014
"textlint": "^11.0.0",
1115
"textlint-rule-preset-japanese": "file:.."
1216
}

0 commit comments

Comments
 (0)