Skip to content

Commit c9fba7b

Browse files
committed
fix: update README
1 parent 369d800 commit c9fba7b

File tree

1 file changed

+46
-23
lines changed

1 file changed

+46
-23
lines changed

README.md

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,60 @@ Then get your OAuth client ID credentials:
1616
* Create (or reuse) a developer project at <https://console.developers.google.com>
1717
* Enable Google Slides API at [API library page](https://console.developers.google.com/apis/library)
1818
* Go to [Credentials page](https://console.developers.google.com/apis/credentials) and click "+ Create credentials" at the top
19-
* Select "OAuth client ID" authorization credentials
19+
* Create "OAuth client ID" type of credentials.
2020
* Choose type "Computer Application" and give it some name.
21-
* Download client credentials file.
22-
* Copy it to `client_id.json` (name has to match) and save to `~/.md2googleslides`.
21+
* Download client ID/secret file and shorten the name to: `client_id.json`.
22+
* Move `client_id.json` (name has to be exact) to `~/.md2googleslides`.
2323

2424
After installing, import your slides by running:
2525

26+
```sh
27+
md2gslides slides.md
28+
```
29+
30+
You'll get a slide deck named "slides.md".
31+
32+
> NOTE: The first time you run the `md2gslides` command, you will be prompted for authorization. OAuth token credentials are stored in `~/.md2googleslides/credentials.json`. You may get a "scary-looking" screen that says, "Google hasn't verified this app." Click "Advanced" then "Go to _APP-NAME_ (unsafe)" if you trust yourself as the author of the app that's requesting to access your Slides files in Drive.
33+
34+
35+
If you want to give the presentation a different name, use the `--title` option:
36+
2637
```sh
2738
md2gslides slides.md --title "Talk Title"
2839
```
2940

3041
This will generate new Google Slides in your account with title `Talk Title`.
3142

32-
NOTE: The first time the command is run you will be prompted for authorization. OAuth token
33-
credentials are stored locally in a file named `~/.md2googleslides/credentials.json`.
43+
Each time you run `md2gslides`, a new slide deck will be generated. If you want to append to or replace an existing slide deck, get the Drive file ID of that deck. The file ID is the 44-character string in a presentation's URL. For example, for this slide deck URL: `https://docs.google.com/presentation/d/1EAYk18WDjIG-zp_0vLm3CsfQh_i8eXc67Jo2O9C6Vuc/edit`, its file ID is `1EAYk18WDjIG-zp_0vLm3CsfQh_i8eXc67Jo2O9C6Vuc`.
44+
45+
Let's say you made some additional slides in `slides2.md`. To generate those slides and append to your existing deck, run:
46+
47+
```sh
48+
md2gslides slides2.md --append FILE_ID
49+
```
50+
51+
To regenerate and replace a deck you've created with file ID `FILE_ID`, run:
52+
53+
```sh
54+
md2gslides slides.md --erase --append FILE_ID
55+
```
3456

35-
Each time you will run the above comment, new slide deck will be generated. In order to work on exactly the same
36-
deck, just get the ID of the already generated slides. For example, you can use following command:
57+
Each time you run the `md2gslides` command, the newly-created or edited slide deck will open in a new browser tab. If you want to suppress that from happening because you already have it open in an existing tab, issue the `--no-browser` option. This command replaces an existing deck but doesn't open up a new browser tab:
3758

59+
```sh
60+
md2gslides slides.md --no-browser --erase --append FILE_ID
3861
```
39-
# To reuse deck available at: https://docs.google.com/presentation/d/<some id>/edit#
40-
md2gslides slides.md --title "Talk Title" --append <some id> --erase
62+
63+
If you're an advanced user, you can use the shorter alternative 1-character options:
64+
65+
```sh
66+
md2gslides slides.md -nea FILE_ID -t "Talk Title"
4167
```
4268

69+
70+
Images (see syntax below) are expected to be online (have URLs), but if you have local files you wish you use the `--use-fileio` option. More info on this option down below in the [Local images](#local-images) section.
71+
72+
4373
## Supported markdown rules
4474

4575
md2gslides uses a subset of the [CommonMark](http://spec.commonmark.org/0.26/) and
@@ -157,11 +187,7 @@ Even if you will use `--append` option for deck reuse, theme will be not changed
157187

158188
#### Inline images
159189

160-
Images can be placed on slides using image tags. Multiple images
161-
can be included. Mulitple images in a single paragraph are arranged in columns,
162-
mutiple paragraphs arranged as rows.
163-
164-
Note: Images are currently scaled and centered to fit the
190+
Images can be placed on slides using image tags. Multiple images can be included. Mulitple images in a single paragraph are arranged in columns, multiple paragraphs arranged as rows. **NOTE:** Images are currently scaled and centered to fit the
165191
slide template.
166192

167193
<pre>
@@ -322,6 +348,7 @@ console.log('Hello world');
322348
```{style="font-size: 36pt"}
323349
</pre>
324350

351+
325352
### Tables
326353

327354
Tables are supported via
@@ -343,22 +370,18 @@ Dogs | 75 million
343370
Birds | 16 million
344371
</pre>
345372

373+
346374
### Local images
347375

348-
Images referencing local paths temporarily uploaded and hosted to [file.io](https://file.io). File.io
349-
is an emphemeral file serving service that generates short-lived random URLs to the upload file and deletes
350-
content shortly after use.
376+
Images referencing local paths temporarily uploaded and hosted to [file.io](https://file.io). File.io is an ephemeral file serving service that generates short-lived random URLs to the upload file and deletes content shortly after use.
351377

352-
Since local images are uploaded to a thrid party, explicit opt-in is required to use this feature.
353-
Include the `--use-fileio` option to opt-in to uploading images. This applies to file-based images as well
378+
Since local images are uploaded to a third party, explicit opt-in is required to use this feature. Include the `--use-fileio` option to opt-in to uploading images. This applies to file-based images as well
354379
as automatically rasterized content like math expressions and SVGs.
355380

381+
356382
### Image rasterization
357383

358-
Slides can also include generated images, using `$$$` fenced blocks
359-
for the data. Currently supported generated images are math expression (TeX
360-
and MathML) as well as SVG. Rasterized images are treated like local images are require
361-
opt-in to uploading images to a 3rd party service via the `--use-fileio` option.
384+
Slides can also include generated images, using `$$$` fenced blocks for the data. Currently supported generated images are math expression (TeX and MathML) as well as SVG. Rasterized images are treated like local images are require opt-in to uploading images to a 3rd party service via the `--use-fileio` option.
362385

363386
Using TeX:
364387

0 commit comments

Comments
 (0)