You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+26-13Lines changed: 26 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,14 @@
1
+
# onepunch
2
+
1
3
**onepunch** is a command-line interface to create PDF presentations using web technology.
2
4
3
-
**onepunch** is designed for designers, it does not provide any default style. Designers can write CSS files and link them in the `index.html`.
5
+
**onepunch** is designed for designers, it does not provide any default style.
6
+
Designers can write CSS files and link them in the `index.html`.
4
7
5
8
### Prerequisites
6
9
7
-
To use **onepunch**, you should have installed **node** and **npm** in your system. Please follow the [official instructions](https://www.npmjs.com/get-npm).
10
+
To use **onepunch**, you should have installed **node** and **npm** in your system.
11
+
Please follow the [official instructions](https://www.npmjs.com/get-npm).
8
12
9
13
### Install
10
14
@@ -14,7 +18,8 @@ Install **onepunch** globally with the following command:
14
18
$ npm install -g @nextbitlabs/onepunch
15
19
```
16
20
17
-
Please note that onepunch makes use of [puppeteer](https://github.com/puppeteer/puppeteer/), which will download chromium. This is necessary to print the PDF file.
21
+
Please note that onepunch makes use of [puppeteer](https://github.com/puppeteer/puppeteer/), which will download chromium.
The command above creates the directory `directory-name` with all the files needed to bootstrap the presentation. The configuration file `onepunch.json` contains configuration parameters, for the moment only the presentation *width* and *height* (in pixels) are available.
36
+
The command above creates the directory `directory-name` with all the files needed to bootstrap the presentation.
37
+
38
+
The configuration file `onepunch.json` contains configuration parameters, with the following available:
39
+
-`width` and `height`, numeric: slide width and height in pixels;
40
+
-`progress`, string: available `line`, to show a progress line at the bottom of the page, or `none`, to suppress it;
41
+
-`date`, string: presentation date, used by tags `<span data-onepunch="date"></span>` along the presentation;
42
+
-`slideNumber`, bool: whether to visualize the slide number in tags `<span data-onepunch="slide-number"></span>`.
32
43
33
44
### View the presentation
34
45
@@ -53,19 +64,20 @@ Flag `-i` (or `--input`) specifies the HTML file to print, it defaults to "index
53
64
Flag `-o` (or `--output`) specifies the name of the PDF file in output, it defaults to "index.pdf".
54
65
55
66
### Update
56
-
57
-
Update files in the `src` directory according to the latest release of **onepunch**, please note that any custom change inside directory `src` will be overwritten:
67
+
Update **onepunch** to the latest release with:
58
68
59
69
```sh
60
-
$ onepunch update
70
+
$ npm update -g @nextbitlabs/onepunch
61
71
```
62
72
63
-
The above command assumes you have installed the latest release of **onepunch**.
64
-
If this is not the case, update **onepunch**to the latest release with:
73
+
To align the `src` directory of a past presentation to the latest release of **onepunch**,
74
+
first update **onepunch**itself with the command above, then use:
65
75
66
76
```sh
67
-
$ npm update -g @nextbitlabs/onepunch
77
+
$ onepunch update
68
78
```
79
+
This will make any new feature available to the current presentation.
80
+
Please note that any custom change inside directory `src` will be overwritten.
69
81
70
82
### Create custom styles
71
83
@@ -74,14 +86,14 @@ Each slide is created by means of tag `article`, for example:
74
86
```html
75
87
<main>
76
88
77
-
<!--Slides 1 -->
89
+
<!--Slide 1 -->
78
90
<article>
79
91
<header>
80
92
<h1>My Presentation Title</h1>
81
93
</header>
82
94
</article>
83
95
84
-
<!--Slides 2 -->
96
+
<!--Slide 2 -->
85
97
<article>
86
98
<header>
87
99
<h1>My Presentation Title</h1>
@@ -94,7 +106,8 @@ Each slide is created by means of tag `article`, for example:
94
106
</main>
95
107
```
96
108
97
-
As usual, designers can define CSS classes to apply custom style. For example, the following class defines a specific grid layout:
109
+
As usual, designers can define CSS classes to apply custom style.
110
+
For example, the following class defines a specific grid layout:
0 commit comments