deck
is a tool for creating deck using Markdown and Google Slides.
- Continuous deck building
- Generate and modify deck iteratively.
- Separate content and design
- Markdown for content, Google Slides for design.
- Create (or reuse) a developer project at https://console.cloud.google.com.
- Enable
Google Slides API
andGoogle Drive API
atAPI & Services
page. - Go to
Credentials
page and click+ CREATE CREDENTIALS
at the top. - Create
OAuth client ID
type of credentials. - Choose type
Desktop app
. - Download credentials file to
~/.local/share/deck/credentials.json
( or${XDG_DATA_HOME}/deck/credentials.json
).
Get the presentation ID you want to operate. You can get a list with deck ls
.
For example, presentation ID is xxxxxXXXXxxxxxXXXXxxxxxxxxxx
of https://docs.google.com/presentation/d/xxxxxXXXXxxxxxXXXXxxxxxxxxxx/edit .
You can create a new presentation with the deck new command and obtain the presentation ID.
If you want to apply a theme, specify the presentation ID of a presentation that is already using that theme with the --from
option.
$ deck new --from yyyyyyyYYYYyYYYYYYYyyyyyyyyy --title "Talk about deck"
xxxxxXXXXxxxxxXXXXxxxxxxxxxx
The slide pages are represented by dividing them with horizontal lines ---
.
Note
The ---
at the beginning of the markdown is ignored.
$ deck apply xxxxxXXXXxxxxxXXXXxxxxxxxxxx deck.md
You can use the --watch
flag to continuously monitor changes to your markdown file and automatically apply them to the presentation:
$ deck apply --watch xxxxxXXXXxxxxxXXXXxxxxxxxxxx deck.md
This is useful during the content creation process as it allows you to see your changes reflected in the presentation in real-time as you edit the markdown file.
Note
The --watch
flag cannot be used together with the --page
flag.
deck
inserts values according to the following rules regardless of the slide layout.
- Heading1 (
#
) is inserted into the title placeholder (CENTERED_TITLE
orTITLE
) in order. - Heading2 (
##
) is inserted into the subtitle placeholder (SUBTITLE
) in order. - All other items are inserted into the body placeholder (
BODY
) in order.
Note
They are inserted in the order they appear in the markdown document, from the placeholder at the top of the slide (or from the placeholder on the left if the slides are the same height).
# CAP theorem
## In Database theory
## Consistency
Every read receives the most recent write or an error.
## Availability
Every request received by a non-failing node in the system must result in a response.
## Partition tolerance
The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between nodes.
- Bold (
**bold**
) - Italic (
*italic*
__italic__
) - List (
-
*
) - Ordered list (
1.
1)
) - Link (
[Link](https://example.com)
) - Code (
`code`
) <br>
(for newline)- Image (

)
Create a layout named style
and add a Text box
to enter specific word. The styles (bold
, italic
, underline
, backgroundColor
, foregroundColor
, fontFamily
) will be applied as the style for each Markdown syntax.
Word | |
---|---|
bold |
style for bold. |
italic |
style for italic. |
link |
style for link. |
code |
style for code . |
(other word) | style for content of inline HTML elements with matching class name ( e.g. <span class="notice">THIS IS NOTICE</span> ) |
By using the --code-block-to-image-command (-c)
option, you can convert Markdown code blocks to images. The specified command is executed for each code block, and its standard output is treated as an image.
$ deck apply --code-block-to-image-command "some-command" xxxxxXXXXxxxxxXXXXxxxxxxxxxx deck.md
The command is executed with bash -c
.
The command must output image data (PNG, JPEG, GIF) to standard output.
From code blocks like the following, you can obtain the optional language identifier go
and the content within the code block.
```go
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}
```
There are three ways to receive code block information within the command:
-
Receive from standard input
- The content of the code block is passed as standard input
- The optional language identifier cannot be obtained, so use it in combination with other methods
-
Receive as environment variables
CODEBLOCK_LANG
: Optional language identifier of the code block (e.g.,go
,python
)CODEBLOCK_CONTENT
: Content of the code block
-
Receive with template syntax ( with expr-lang )
{{lang}}
: Optional language identifier of the code block{{content}}
: Content of the code block{{env.XXX}}
: Value of environment variable XXX
These methods can be used in combination, and you can choose the appropriate method according to the command requirements.
# Convert Mermaid diagrams to images
$ deck apply -c 'mmdc -i - -o output.png --quiet; cat output.png' xxxxxXXXXxxxxxXXXXxxxxxxxxxx deck.md
# Generate code images with syntax highlighting (e.g., silicon)
$ deck apply -c 'silicon -l {{lang == "" ? "-l md" : "-l " + lang}} -o output.png; cat output.png' xxxxxXXXXxxxxxXXXXxxxxxxxxxx deck.md
# Use different tools depending on the language
$ deck apply -c 'if [ {{lang}} = "mermaid" ]; then mmdc -i - -o output.png --quet; else silicon {{lang == "" ? "-l md" : "-l " + lang}} --output output.png; fi; cat output.png' xxxxxXXXXxxxxxXXXXxxxxxxxxxx deck.md
The comments <!--
-->
are used as a speaker notes or page config.
If the comment <!--
-->
can be JSON-encoded, it will be processed as page config.
<!-- {"layout": "title-and-body"} -->
It is possible to specify the page layout.
The layout name (e.g. title-and-body
) is specified.
<!-- {"layout": "title-and-body"} -->
Tip
With deck ls-layouts
it is possible to obtain a list of the layout names for a specific presentation.
$ deck ls-layouts xxxxxXXXXxxxxxXXXXxxxxxxxxxx
title
section
section-dark
title-and-body
title-and-body-half
title-and-body-2col
title-and-body-3col
It is possible to skip the operation of the target page.
Tip
If you set it to a page that has been completed with layout and design, the page will not be modified unnecessarily by deck.
<!-- {"freeze": true} -->
- zonuexe/deck-slides.el ... Creating deck using Markdown and Google Slides.
homebrew tap:
$ brew install k1LoW/tap/deck
go install:
$ go install github.com/k1LoW/deck/cmd/deck@latest
manually:
Download binary from releases page
- googleworkspace/md2googleslides: Generate Google Slides from markdown
- MIT License
- Include logo as well as source code.
- Only logo license can be selected CC BY 4.0.
- Also, if there is no alteration to the logo and it is used for technical information about deck, I would not say anything if the copyright notice is omitted.