Skip to content

Commit e51988f

Browse files
Merge pull request #110 from vivliostyle/feat/new-create-theme
2 parents 6b51623 + 642d987 commit e51988f

19 files changed

+87
-293
lines changed

β€Žpackages/create-vivliostyle-theme/src/cli.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const templateRoot = resolve(__dirname, '../templates');
88

99
const caveat = ({ name }: AfterHookOptions) => `
1010
${chalk.gray('1.')} cd ${chalk.bold.green(name)}
11-
${chalk.gray('2.')} edit ${chalk.bold.green('scss/*.scss')}
11+
${chalk.gray('2.')} edit ${chalk.bold.green('theme.css')}
1212
${chalk.gray('3.')} publish to npm (${chalk.cyan('$ npm publish')})
1313
`;
1414

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
example/*.html
22
node_modules
3+
themes/
4+
.vivliostyle/
5+
book/
6+
book.pdf

β€Žpackages/create-vivliostyle-theme/templates/default/README.mdβ€Ž

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66

77
{{description}}
88

9-
## Install
10-
11-
```bash
12-
npm install --save {{kebab name}}
13-
# or
14-
yarn add {{kebab name}}
15-
```
16-
179
## Use
1810

1911
In `vivliostyle.config.js`:
@@ -36,16 +28,7 @@ module.exports = {
3628
β”‚Β Β  β”œβ”€β”€ default.html // auto generated
3729
β”‚Β Β  └── default.md // πŸ–‹
3830
β”œβ”€β”€ package.json
39-
β”œβ”€β”€ scss // πŸ–‹
40-
β”‚Β Β  β”œβ”€β”€ theme_common.scss
41-
β”‚Β Β  β”œβ”€β”€ theme_print.scss
42-
β”‚Β Β  └── theme_screen.scss
43-
β”œβ”€β”€ theme_common.css // auto generated
44-
β”œβ”€β”€ theme_common.css.map // auto generated
45-
β”œβ”€β”€ theme_print.css // auto generated
46-
β”œβ”€β”€ theme_print.css.map // auto generated
47-
β”œβ”€β”€ theme_screen.css // auto generated
48-
β”œβ”€β”€ theme_screen.css.map // auto generated
31+
β”œβ”€β”€ theme.css // πŸ–‹
4932
└── vivliostyle.config.js
5033
```
5134

@@ -71,8 +54,7 @@ You can specify your CSS file and manuscript file for preview in vivliostyle.con
7154
```js
7255
module.exports = {
7356
language: 'en',
74-
theme: 'theme_print.css',
75-
// theme: 'theme_screen.css',
57+
theme: ['node_modules/@vivliostyle/theme-base', '.'],
7658
entry: [
7759
'example/default.md',
7860
// and more...

β€Žpackages/create-vivliostyle-theme/templates/default/package.jsonβ€Ž

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,27 @@
44
"version": "0.1.0",
55
"author": "{{contact}}",
66
"scripts": {
7-
"build": "run-p build:scss build:vivliostyle",
8-
"build:scss": "sass scss:.",
9-
"build:vivliostyle": "vivliostyle build",
10-
"dev": "run-p preview watch:scss",
7+
"build": "vivliostyle build",
118
"preview": "vivliostyle preview",
12-
"validate": "vivliostyle-theme-scripts validate",
13-
"watch:scss": "sass --watch scss:."
9+
"validate": "vivliostyle-theme-scripts validate"
10+
},
11+
"dependencies": {
12+
"@vivliostyle/theme-base": "beta"
1413
},
1514
"devDependencies": {
16-
"@vivliostyle/cli": "latest",
17-
"sass": "^1.32.8",
18-
"npm-run-all": "^4.1.5",
19-
"vivliostyle-theme-scripts": "^0.3.1"
15+
"@vivliostyle/cli": "^7.2.3",
16+
"vivliostyle-theme-scripts": "^0.3.5"
17+
},
18+
"peerDependencies": {
19+
"@vivliostyle/cli": ">=7"
20+
},
21+
"peerDependenciesMeta": {
22+
"@vivliostyle/cli": {
23+
"optional": true
24+
}
2025
},
2126
"files": [
2227
"*.css",
23-
"*.css.map",
24-
"scss",
2528
"example",
2629
"vivliostyle.config.js"
2730
],
@@ -34,7 +37,7 @@
3437
"theme": {
3538
"name": "{{capital name space=true}}",
3639
"author": "{{contact}}",
37-
"style": "./theme_print.css",
40+
"style": "./theme.css",
3841
"category": "{{category}}",
3942
"topics": []
4043
}

β€Žpackages/create-vivliostyle-theme/templates/default/scss/_variables.scssβ€Ž

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

β€Žpackages/create-vivliostyle-theme/templates/default/scss/_vfm_code.scssβ€Ž

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

β€Žpackages/create-vivliostyle-theme/templates/default/scss/_vfm_footnotes.scssβ€Ž

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

β€Žpackages/create-vivliostyle-theme/templates/default/scss/_vfm_frontmatter.scssβ€Ž

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

β€Žpackages/create-vivliostyle-theme/templates/default/scss/_vfm_hard_new_line.scssβ€Ž

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

β€Žpackages/create-vivliostyle-theme/templates/default/scss/_vfm_image.scssβ€Ž

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

0 commit comments

Comments
Β (0)