Skip to content

Commit

Permalink
Merge pull request #110 from vivliostyle/feat/new-create-theme
Browse files Browse the repository at this point in the history
  • Loading branch information
spring-raining authored Apr 20, 2023
2 parents 6b51623 + 642d987 commit e51988f
Show file tree
Hide file tree
Showing 19 changed files with 87 additions and 293 deletions.
2 changes: 1 addition & 1 deletion packages/create-vivliostyle-theme/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const templateRoot = resolve(__dirname, '../templates');

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
example/*.html
node_modules
themes/
.vivliostyle/
book/
book.pdf
22 changes: 2 additions & 20 deletions packages/create-vivliostyle-theme/templates/default/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@

{{description}}

## Install

```bash
npm install --save {{kebab name}}
# or
yarn add {{kebab name}}
```

## Use

In `vivliostyle.config.js`:
Expand All @@ -36,16 +28,7 @@ module.exports = {
│   ├── default.html // auto generated
│   └── default.md // 🖋
├── package.json
├── scss // 🖋
│   ├── theme_common.scss
│   ├── theme_print.scss
│   └── theme_screen.scss
├── theme_common.css // auto generated
├── theme_common.css.map // auto generated
├── theme_print.css // auto generated
├── theme_print.css.map // auto generated
├── theme_screen.css // auto generated
├── theme_screen.css.map // auto generated
├── theme.css // 🖋
└── vivliostyle.config.js
```

Expand All @@ -71,8 +54,7 @@ You can specify your CSS file and manuscript file for preview in vivliostyle.con
```js
module.exports = {
language: 'en',
theme: 'theme_print.css',
// theme: 'theme_screen.css',
theme: ['node_modules/@vivliostyle/theme-base', '.'],
entry: [
'example/default.md',
// and more...
Expand Down
29 changes: 16 additions & 13 deletions packages/create-vivliostyle-theme/templates/default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,27 @@
"version": "0.1.0",
"author": "{{contact}}",
"scripts": {
"build": "run-p build:scss build:vivliostyle",
"build:scss": "sass scss:.",
"build:vivliostyle": "vivliostyle build",
"dev": "run-p preview watch:scss",
"build": "vivliostyle build",
"preview": "vivliostyle preview",
"validate": "vivliostyle-theme-scripts validate",
"watch:scss": "sass --watch scss:."
"validate": "vivliostyle-theme-scripts validate"
},
"dependencies": {
"@vivliostyle/theme-base": "beta"
},
"devDependencies": {
"@vivliostyle/cli": "latest",
"sass": "^1.32.8",
"npm-run-all": "^4.1.5",
"vivliostyle-theme-scripts": "^0.3.1"
"@vivliostyle/cli": "^7.2.3",
"vivliostyle-theme-scripts": "^0.3.5"
},
"peerDependencies": {
"@vivliostyle/cli": ">=7"
},
"peerDependenciesMeta": {
"@vivliostyle/cli": {
"optional": true
}
},
"files": [
"*.css",
"*.css.map",
"scss",
"example",
"vivliostyle.config.js"
],
Expand All @@ -34,7 +37,7 @@
"theme": {
"name": "{{capital name space=true}}",
"author": "{{contact}}",
"style": "./theme_print.css",
"style": "./theme.css",
"category": "{{category}}",
"topics": []
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit e51988f

Please sign in to comment.