md2googleslides icon indicating copy to clipboard operation
md2googleslides copied to clipboard

Document the headless mode option (-n or --no-browser)

Open zenmaster24 opened this issue 6 years ago • 6 comments

Hi,

If I want to run this in a container, it wants to authorize via a browser which is obviously not going to work. How can I authorize otherwise? Copying ~/.credentials/md2gslides.json with correct data?

Thanks

zenmaster24 avatar Feb 27 '19 08:02 zenmaster24

There is a headless mode command line flag (-n or --no-browser) you can use, which will print the URLs out but not attempt to open a web browser. This isn't documented in the README however, so changing this to a feature request to document it.

erickoledadevrel avatar Mar 07 '19 02:03 erickoledadevrel

ok cool - is there anyway to pre-auth the app? cos even if you use the -n arg, you get asked to authorise the app and enter in the code. eg:

sudo docker logs 70881ae9a5bb
Authorize this app by visiting this url: 
https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fpresentations&login_hint=default&response_type=code&client_id=<client_id_string>
Enter the code here: % 

I am also using this as slides.md and getting a #comment error?:

# This is a title slide
## Your name here
---
# This is a section title
---
# Section title & body slide
## This is a subtitle
This is the body
---
# Title & body slide
This is the slide body.
---
# This is the main point {.big}
---
# 100% {.big}
This is the body
---
# Two column layout
This is the left column
{.column}
This is the right column
---
# Slides can have images
![](https://placekitten.com/900/900)
---
# Slides can have background images
![](https://placekitten.com/1600/900){.background}
---
# Slides can have videos
@[youtube](MG8KADiRbOU)
---
# Slide title
![](https://placekitten.com/1600/900){.background}
<!--
These are speaker notes.
-->
---
**Bold**, *italics*, and ~~strikethrough~~ may be used.

Ordered lists:
1. Item 1
1. Item 2
  1. Item 2.1

Unordered lists:
* Item 1
* Item 2
  * Item 2.1
---
### I :heart: cats
:heart_eyes_cat:
---
### Hello World
```javascript
console.log('Hello world');

Error:

Unable to generate slides: Error: Unsupported inline HTML element: #comment
    at inlineTokenRules.html_inline (/usr/lib/node_modules/md2gslides/lib/extract_slides.js:274:23)
    at processMarkdownToken (/usr/lib/node_modules/md2gslides/lib/extract_slides.js:84:9)
    at inlineTokenRules.inline (/usr/lib/node_modules/md2gslides/lib/extract_slides.js:229:13)
    at processMarkdownToken (/usr/lib/node_modules/md2gslides/lib/extract_slides.js:84:9)
    at processTokens (/usr/lib/node_modules/md2gslides/lib/extract_slides.js:73:9)
    at extractSlides (/usr/lib/node_modules/md2gslides/lib/extract_slides.js:61:5)
    at SlideGenerator.generateFromMarkdown (/usr/lib/node_modules/md2gslides/lib/slide_generator.js:86:27)
    at generateSlides (/usr/lib/node_modules/md2gslides/bin/md2gslides.js:179:27)
    at tryCallOne (/usr/lib/node_modules/md2gslides/node_modules/promise/lib/core.js:37:12)
    at /usr/lib/node_modules/md2gslides/node_modules/promise/lib/core.js:123:15
    at flush (/usr/lib/node_modules/md2gslides/node_modules/asap/raw.js:50:29)
    at process._tickCallback (internal/process/next_tick.js:61:11)
Error: Unsupported inline HTML element: #comment
    at inlineTokenRules.html_inline (/usr/lib/node_modules/md2gslides/lib/extract_slides.js:274:23)
    at processMarkdownToken (/usr/lib/node_modules/md2gslides/lib/extract_slides.js:84:9)
    at inlineTokenRules.inline (/usr/lib/node_modules/md2gslides/lib/extract_slides.js:229:13)
    at processMarkdownToken (/usr/lib/node_modules/md2gslides/lib/extract_slides.js:84:9)
    at processTokens (/usr/lib/node_modules/md2gslides/lib/extract_slides.js:73:9)
    at extractSlides (/usr/lib/node_modules/md2gslides/lib/extract_slides.js:61:5)
    at SlideGenerator.generateFromMarkdown (/usr/lib/node_modules/md2gslides/lib/slide_generator.js:86:27)
    at generateSlides (/usr/lib/node_modules/md2gslides/bin/md2gslides.js:179:27)
    at tryCallOne (/usr/lib/node_modules/md2gslides/node_modules/promise/lib/core.js:37:12)
    at /usr/lib/node_modules/md2gslides/node_modules/promise/lib/core.js:123:15
    at flush (/usr/lib/node_modules/md2gslides/node_modules/asap/raw.js:50:29)
    at process._tickCallback (internal/process/next_tick.js:61:11)
{}

I just wanted to test the feature of md2googleslides

zenmaster24 avatar Mar 09 '19 03:03 zenmaster24

You should only need to authorize the tool once, and then it will re-use your tokens for later runs. Please open a new issue about the comment.

erickoledadevrel avatar Mar 12 '19 13:03 erickoledadevrel

You should only need to authorize the tool once, and then it will re-use your tokens for later runs.

Not for docker runs. Would you copy the credentials file as part of the container build, or something else?

zenmaster24 avatar Mar 14 '19 08:03 zenmaster24

Yes, I guess you'd need to copy the saved credentials file along with the build.

erickoledadevrel avatar Mar 14 '19 13:03 erickoledadevrel

I believe this is solved and can be closed, I can see proper flag help in https://github.com/gsuitedevs/md2googleslides/blob/master/bin/md2gslides.js#L65 :hugs:

bwplotka avatar Jun 07 '20 14:06 bwplotka