### Run Slides Presentation from File or Stdin Source: https://github.com/maaslalani/slides/blob/main/README.md Commands to start a 'slides' presentation, either by specifying a markdown file (which supports live updates) or by piping content from stdin. ```Bash slides presentation.md ``` ```Bash curl http://example.com/slides.md | slides ``` -------------------------------- ### Basic Go Program Example Source: https://github.com/maaslalani/slides/blob/main/examples/ascii_slides.md A simple 'Hello World' style program written in Go, demonstrating the core language structure with package declaration, imports, and a main function. ```go package main import "fmt" func main() { fmt.Println("Written in Go!") } ``` -------------------------------- ### Start `slides` Presentation Server (Bash) Source: https://github.com/maaslalani/slides/blob/main/README.md Run this command on a machine to host a `slides` presentation, making it accessible over SSH. The `[file]` argument specifies the presentation markdown file. ```bash slides serve [file] ``` -------------------------------- ### Install Slides Terminal Presentation Tool Source: https://github.com/maaslalani/slides/blob/main/README.md Instructions for installing the 'slides' terminal presentation tool on various operating systems and environments, including package managers and direct Go installation. ```Bash brew install slides ``` ```Bash yay -S slides ``` ```Bash nix-env -iA nixpkgs.slides ``` ```Bash sudo snap install slides ``` ```Go go install github.com/maaslalani/slides@latest ``` ```Bash git clone https://github.com/maaslalani/slides.git cd slides go install ``` -------------------------------- ### Basic Go Program Example Source: https://github.com/maaslalani/slides/blob/main/examples/slides.md A simple 'Hello World' style program written in Go, demonstrating basic package and function structure. This snippet likely indicates the language the 'Slides' tool itself is built in. ```Go package main import "fmt" func main() { fmt.Println("Written in Go!") } ``` -------------------------------- ### Generate ASCII Art UML Diagrams using PlantUML Source: https://github.com/maaslalani/slides/blob/main/examples/preprocess.md Demonstrates how to integrate PlantUML definitions into markdown slides. The PlantUML syntax within the code block is processed by the `plantuml` command, and the resulting ASCII art UML diagram replaces the block. Requires `plantuml` to be installed and in the system's PATH. ```Shell ~~~plantuml -utxt -pipe @startuml A --> B: to @enduml ~~~ ``` ```Text ┌─┐ ┌─┐ │A│ │B│ └┬┘ └┬┘ │ to │ │ ─ ─ ─ ─ ─ >│ ┌┴┘ ┌┴┘ │A│ │B│ └─┘ └─┘ ``` -------------------------------- ### Generate ASCII Art Graphs using graph-easy Source: https://github.com/maaslalani/slides/blob/main/examples/preprocess.md Demonstrates how to embed `graph-easy` commands within markdown slides. The content inside the code block is passed as standard input to `graph-easy`, and its standard output replaces the block, generating ASCII box art diagrams. Requires `graph-easy` to be installed and in the system's PATH. ```Shell ~~~graph-easy --as=boxart [ A ] - to -> [ B ] ~~~ ``` ```Text ┌───┐ to ┌───┐ │ A │ ────> │ B │ └───┘ └───┘ ``` -------------------------------- ### Execute Arbitrary Shell Commands in Slides Source: https://github.com/maaslalani/slides/blob/main/examples/preprocess.md Illustrates the flexibility of the 'Slides' pre-processing mechanism, allowing any shell command to be executed. The command's standard output replaces the code block. This example uses `echo` to demonstrate that the original content of the block is disregarded if the command doesn't process stdin. ```Shell ~~~echo "You can do whatever, really" This doesn't matter, since it will be replaced by the stdout of the command above because the command will disregard stdin. ~~~ ``` -------------------------------- ### Define Slides with Markdown Source: https://github.com/maaslalani/slides/blob/main/README.md Example of a markdown file structure used to create presentations with 'slides', demonstrating basic content, slide separators, and embedded code blocks. ```Markdown # Welcome to Slides A terminal based presentation tool --- ## Everything is markdown In fact, this entire presentation is a markdown file. --- ## Everything happens in your terminal Create slides and present them without ever leaving your terminal. --- ## Code execution ```go package main import "fmt" func main() { fmt.Println("Execute code directly inside the slides") } ``` You can execute code inside your slides by pressing ``, the output of your command will be displayed at the end of the current slide. --- ## Pre-process slides You can add a code block with three tildes (`~`) and write a command to run *before* displaying the slides, the text inside the code block will be passed as `stdin` to the command and the code block will be replaced with the `stdout` of the command. ``` ~~~graph-easy --as=boxart [ A ] - to -> [ B ] ~~~ ``` The above will be pre-processed to look like: ┌───┐ to ┌───┐ │ A │ ────> │ B │ └───┘ └───┘ For security reasons, you must pass a file that has execution permissions for the slides to be pre-processed. You can use `chmod` to add these permissions. ```bash chmod +x file.md ``` ``` -------------------------------- ### Graphviz DOT Language for Diagrams Source: https://github.com/maaslalani/slides/blob/main/examples/slides.md An example of a directed graph defined using the Graphviz DOT language. This demonstrates how complex diagrams can be embedded and rendered within presentations created with the 'Slides' tool. ```Graphviz DOT digraph { rankdir = LR; a -> b; b -> c; } ``` -------------------------------- ### Display ASCII Art Graph Source: https://github.com/maaslalani/slides/blob/main/internal/model/tutorial.md Shows an example of embedding a pre-formatted ASCII art graph directly into a slide. This allows for simple, text-based diagrams to be presented. ```Text ┌───┐ ┌───┐ ┌───┐ │ a │ ──▶ │ b │ ──▶ │ c │ └───┘ └───┘ └───┘ ``` -------------------------------- ### Customize Slides Bottom Bar with Frontmatter Metadata Source: https://github.com/maaslalani/slides/blob/main/examples/metadata.md This snippet demonstrates how to add custom metadata fields like author, date, and paging to the `slides.md` file. These fields are used to populate the bottom information bar of the presentation, providing details such as the presenter's name, presentation date, and page numbering. ```Frontmatter --- author: Gopher date: May 22, 2022 paging: Page %d of %d --- ``` -------------------------------- ### Hide Slides Bottom Bar by Emptying Frontmatter Metadata Source: https://github.com/maaslalani/slides/blob/main/examples/metadata.md This snippet shows how to hide the bottom information bar in `slides.md` by providing empty string values for the author, date, and paging metadata fields. Setting these fields to empty strings effectively disables the display of the bottom bar, offering a cleaner presentation view. ```Frontmatter --- author: "" date: "" paging: "" --- ``` -------------------------------- ### Build and Test Project with Make Source: https://github.com/maaslalani/slides/blob/main/docs/development/README.md To test changes during development, run the `make` command. This executes `go run main.go examples/slides.md` to ensure core functionality remains intact. ```Shell make ``` -------------------------------- ### Print Hello World in Go with Hidden Boilerplate Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This Go snippet prints 'Hello, world!' to the console. It demonstrates the use of `///` comments to hide verbose boilerplate code while still allowing the full program to be executed or copied. ```go ///package main /// import "fmt" /// ///func main() { fmt.Println("Hello, world!") ///} ``` -------------------------------- ### Import External File Content into Slides Source: https://github.com/maaslalani/slides/blob/main/examples/preprocess.md Shows a method to dynamically import content from other files directly into the slides. By piping the filename to `cat` via `xargs`, the content of the specified file (`examples/import.md`) is inserted into the presentation at the location of the code block. ```Shell ~~~xargs cat examples/import.md ~~~ ``` -------------------------------- ### Pre-process Slides with External Commands Source: https://github.com/maaslalani/slides/blob/main/README.md Illustrates how to use a special markdown block with three tildes (~~~) to run an external command, passing the block content as stdin and replacing it with stdout. This enables dynamic content generation within slides. File must have execution permissions. ```Markdown ``` ~~~graph-easy --as=boxart [ A ] - to -> [ B ] ~~~ ``` ``` ```Bash chmod +x file.md ``` -------------------------------- ### Print Hello World in Java Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This Java snippet defines a `Main` class with a `main` method, the entry point for Java applications, that prints 'Hello, world!' to the console using `System.out.println`. ```java public class Main { public static void main(String[] args) { System.out.println("Hello, world!"); } } ``` -------------------------------- ### Print Hello World in Elixir Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This Elixir snippet prints the classic 'Hello, world!' message to the console using the `IO.puts` function, a common first program in many languages. ```elixir IO.puts "Hello, world!" ``` -------------------------------- ### Run Project Tests with Make Source: https://github.com/maaslalani/slides/blob/main/docs/development/README.md After making changes, ensure all existing tests are still passing by running the `make test` command. ```Shell make test ``` -------------------------------- ### Print Hello in Scala Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This Scala snippet defines an `App` object that prints 'Hello' to the console. It also includes a using directive for a dependency, demonstrating how to manage external libraries. ```scala //> using dep com.lihaoyi::pprint:0.8.1 object Main extends App { println("Hello") } ``` -------------------------------- ### Display and Execute Go Code in Slides Source: https://github.com/maaslalani/slides/blob/main/internal/model/tutorial.md Demonstrates how to embed Go programming code directly within a slide. The tool allows users to execute the displayed code by pressing `ctrl+e`, making presentations interactive. ```go package main import "fmt" func main() { // You can show code in slides // Press ctrl+e to execute this code directly in slides fmt.Println("Tada!") } ``` -------------------------------- ### Print Hello World in C++ Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This C++ snippet includes the iostream library and defines a `main` function, the standard entry point for C++ programs, that prints 'Hello, world!' to the console using `std::cout`. ```cpp #include int main() { std::cout << "Hello, world!" << std::endl; return 0; } ``` -------------------------------- ### Print Hello World in Rust Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This Rust snippet defines a `main` function that prints 'Hello, world!' to the console using the `println!` macro, which is a common entry point for Rust applications. ```rust fn main() { println!("Hello, world!"); } ``` -------------------------------- ### Print Hello World in V Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This V snippet prints 'Hello, world!' to the console using the `println` function, which is used for outputting text followed by a newline. ```v println('Hello, world!') ``` -------------------------------- ### Execute Fish Command Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This snippet demonstrates executing a basic `ls` command in a Fish shell environment, useful for listing directory contents. ```fish ls ``` -------------------------------- ### Print Hello World in Swift Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This Swift snippet prints 'Hello, world!' to the console using the `print` function, a fundamental way to display output in Swift applications. ```swift print("Hello, world!") ``` -------------------------------- ### Print Hello World in Dart Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This Dart snippet defines a `main` function, the entry point for Dart applications, that prints 'Hello, world!' to the console using the `print` function. ```dart void main() { print("Hello, world!"); } ``` -------------------------------- ### Print Hello World in Javascript Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This Javascript snippet prints 'Hello, world!' to the console using `console.log`, a standard method for outputting messages in web browsers and Node.js environments. ```javascript console.log("Hello, world!") ``` -------------------------------- ### Access `slides` Presentation via SSH Client (Bash) Source: https://github.com/maaslalani/slides/blob/main/README.md Connect to a running `slides` presentation server from another machine or the same machine using SSH. Replace `53531` with the actual port specified by the `slides serve` command. ```bash ssh 127.0.0.1 -p 53531 ``` -------------------------------- ### Print Hello World in Julia Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This Julia snippet prints 'Hello, world!' to the console using the `println` function, which is commonly used for outputting text followed by a newline. ```julia println("Hello, world!") ``` -------------------------------- ### Print Hello World in Perl Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This Perl snippet prints 'hello, world' to the console using the `print` function, a basic command for text output. ```perl print ("hello, world"); ``` -------------------------------- ### Execute Go Code within Slides Source: https://github.com/maaslalani/slides/blob/main/README.md Demonstrates how to embed and execute Go code directly within a slide, with the output displayed after execution by pressing Ctrl+E. ```Go package main import "fmt" func main() { fmt.Println("Execute code directly inside the slides") } ``` -------------------------------- ### Configure `slides` Presentation Metadata (YAML) Source: https://github.com/maaslalani/slides/blob/main/README.md Customize `slides` presentation appearance and information using a YAML front matter block. This includes setting a theme path, author name, date format, and paging display. All fields are optional and have sensible defaults. ```yaml --- theme: ./path/to/theme.json author: Gopher date: MMMM dd, YYYY paging: Slide %d / %d --- ``` -------------------------------- ### Print Hello World in Python Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This Python snippet prints 'Hello, world!' to the console using the built-in `print` function, a simple and common way to display text output. ```python print("Hello, world!") ``` -------------------------------- ### Print Hello World in Lua Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This Lua snippet prints 'Hello, World!' to the console using the built-in `print` function, a fundamental operation for displaying output. ```lua print("Hello, World!") ``` -------------------------------- ### Execute Bash Command Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This snippet demonstrates executing a basic `ls` command in a Bash shell environment, useful for listing directory contents. ```bash ls ``` -------------------------------- ### Enable Execution Permissions for Slide Preprocessing Source: https://github.com/maaslalani/slides/blob/main/examples/preprocess.md Explains a security requirement for the 'Slides' project. For pre-processing to occur, the markdown file containing the embedded commands must have execution permissions enabled. This snippet shows the command to grant execute permissions. ```Shell chmod +x file.md ``` -------------------------------- ### Print Hello World in Ruby Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This Ruby snippet prints 'Hello, world!' to the console using the `puts` method, which also appends a newline character. ```ruby puts "Hello, world!" ``` -------------------------------- ### Execute Zsh Command Source: https://github.com/maaslalani/slides/blob/main/examples/code_blocks.md This snippet demonstrates executing a basic `ls` command in a Zsh shell environment, useful for listing directory contents. ```zsh ls ``` -------------------------------- ### Render Directed Graph using DOT Language Source: https://github.com/maaslalani/slides/blob/main/internal/model/tutorial.md Illustrates how to embed a graph definition written in the DOT language. The 'Slides' tool can render these definitions visually, allowing for complex diagrams within presentations. ```DOT digraph { rankdir = LR; a -> b; b -> c; } ``` -------------------------------- ### Date Formatting Directives for `slides` Configuration (APIDOC) Source: https://github.com/maaslalani/slides/blob/main/README.md Reference table for date formatting directives used in the `date` configuration field. Shows how different format values translate to specific date components for January 02, 2006. ```APIDOC Date Formatting Directives: Given the date January 02, 2006: - Value: YYYY, Translates to: 2006 - Value: YY, Translates to: 06 - Value: MMMM, Translates to: January - Value: MMM, Translates to: Jan - Value: MM, Translates to: 01 - Value: mm, Translates to: 1 - Value: DD, Translates to: 02 - Value: dd, Translates to: 2 ``` -------------------------------- ### Separate Slides with Markdown Delimiter Source: https://github.com/maaslalani/slides/blob/main/internal/model/tutorial.md Explains the standard markdown syntax for defining separate slides within a single file. Three hyphens (`---`) on a new line act as a delimiter, allowing for multi-slide presentations from one markdown document. ```markdown # Slide 1 Some stuff --- # Slide 2 Some other stuff ``` -------------------------------- ### Markdown Syntax for Slide Separation Source: https://github.com/maaslalani/slides/blob/main/examples/slides.md Demonstrates the essential syntax for separating individual slides within a markdown file using three hyphens (`---`) on a new line. This is crucial for structuring presentations with the 'Slides' tool. ```Markdown # Slide 1 Some stuff --- # Slide 2 Some other stuff ``` -------------------------------- ### ASCII Art Diagram Representation Source: https://github.com/maaslalani/slides/blob/main/examples/slides.md A simple ASCII art representation of a directed graph, illustrating an alternative method for including visual diagrams directly in text-based presentations. ```ASCII Art ┌───┐ ┌───┐ ┌───┐ │ a │ ──▶ │ b │ ──▶ │ c │ └───┘ └───┘ └───┘ ``` -------------------------------- ### Markdown Slide Separation Source: https://github.com/maaslalani/slides/blob/main/examples/ascii_slides.md Illustrates the method for separating individual slides within a presentation using the 'Slides' tool. Slides are delineated by three hyphens (---) on a separate line. ```markdown # Slide 1 Some stuff --- # Slide 2 Some other stuff ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.