Dough is a command-line tool written in Rust that allows you to create and present presentations using Markdown. It provides a simple and customizable way to create presentation decks and present them in both terminal and HTML modes.
Get the latest release from the releases page.
create a project directory and write your presentation in markdown.
mkdir my_folder && touch my_folder/1.md
./dough present <project-name>
Clone the Dough repository:
git clone https://github.com/fuzzymfx/dough.git
Navigate to the Dough project directory:
cd dough
Build the project using Cargo:
cargo build --release
Install the binary:
cargo install --path .
export PATH="$HOME/.cargo/bin:$PATH"
Create a new dir and create your presentations using markdown:
dough present <project-name> [directory name]
Dough provides two main subcommands: new and present.
dough new <project-name> [--template <template-name>]
<project-name>
: The name of the new project (required).
--template <template-name>
: Choose a template for the project (default is "default").
Example:
dough new my_presentation --template fancy_template
Currently, there are three templates:
default
code
light
You can add new templates
under the templates folder. Each template is a folder containing a template.md
file that contains the template's Markdown code.
dough present <project-name> [--mode <presentation-mode>]
<project-name>
: The name of the project to present (required).
--mode <presentation-mode>
: Choose the mode of presentation: "html" or "term" (default is "term").
Example:
dough present my_presentation --mode html
t
:highlighting
modescrolling
mode
q
,Esc
, orctrl + c
to quit the presentation.ctrl + r
to refresh the presentation.l
orright arrow
to move to the next slide.h
orleft arrow
to move to the previous slide.j
ordown arrow
to move to the next line.k
orup arrow
to move to the previous line.
The t
key is used to toggle between highlighting and scrolling modes. In highlighting mode, you can use the arrow keys to navigate between slides. In scrolling mode, you can use the arrow keys to scroll through the content of the current slide.
You can use arrow keys to navigate: right and left arrows to move between slides, and up and down arrows to move between lines.
Vim keybindings are also supported: h
and l
to move between slides, and j
and k
to move between lines.
The letters are case-insensitive.
You can customize the presentation by modifying the style.yml
file in the project directory. The config.yaml
file contains the default style settings for the terminal markdown renderer.
# This file contains the default style settings for the terminal markdown renderer.
# The highlighter
highlighter: black on white
# Markdown styles
h1: red
h2: yellow
h3: green
h4: cyan
h5: blue
h6: purple
blockquote: white on black
ordered_list_bullet: yellow
unordered_list_bullet: yellow
ordered_list: white
unordered_list: white
link_text: black
link_url: blue
definition: yellow
# Terminal styles
# clear will clear the terminal before rendering, you would need to scroll down to render each line
clear: false
box: true
box_color: black on white
# vertical_alignment will vertically align the text to the middle of the terminal
vertical_alignment: true
# horizontal_alignment will horizontally align the text to the middle of the terminal
horizontal_alignment: true
# syntax_highlighting will highlight the code syntax
# this works well with the warp terminal, but not with the default Mac OS terminal
syntax_highlighting: true
syntax_theme: base16-ocean.dark
#themes:[base16-ocean.dark,base16-eighties.dark,base16-mocha.dark,base16-ocean.light, Solarized (dark) and Solarized (light)]
syntax_bg: false
# shows the progress of the presentation: " i [1/10] " : current slide/total slides in the bottom left corner
progress: false
# runtime map is used to store the runtimes for different languages
# you can add your own runtimes for different languages. Currently, the following runtimes are supported:
- runtime_map:
python: python3
javascript: node
ruby: ruby
c: gcc
cpp: g++
java: java
go: go run
rust: cargo run
swift: swift
kotlin: kotlinc
typescript: tsc
Dough supports running code blocks in the terminal. The code blocks are internally ordered in the order they appear in the markdown file. The code blocks are run in a separate thread, and the results are displayed in the terminal.
n
: runs then
th code block. and outputs the result in the terminal.
If you're familiar with Rust and are looking for a project to contribute to, Dough would be a decent starting point. Feel free to open an issue or submit a pull request.
TODO:
- Scrolling issues in highlight mode:
- bug Over Scroll in infinite scrolling
- feat. Skip empty lines in both highlight and scroll modes
- feat. Hot Module Reload
- feat. Add a support for maximum width and height of the terminal. Write a word wrapper.
- feat. Add comprehensive support for common Markdown elements.
- feat. Enhance rendering for complex markdown elements
- headings withing blockquotes
- links within headings or lists
- feat. Image support for terminals with image capabilities (Kitty, iTerm2, etc.)
This project is licensed under the MIT License - see the LICENSE file for details