# Cheatsheet - TSYS Dev Stack Docs Toolbox ## Table of Contents - [Quick Commands](#quick-commands) - [Pandoc Conversions](#pandoc-conversions) - [MdBook Commands](#mdbook-commands) - [Typst Commands](#typst-commands) - [Marp Commands](#marp-commands) - [Quarto Commands](#quarto-commands) - [Document Templates](#document-templates) - [File Locations](#file-locations) ## Quick Commands | Task | Command | |------|---------| | Run container interactively | `./run.sh` | | Build image | `./build.sh` | | Run tests | `./test.sh` | | Run detached container | `./run.sh -d` | | Build and run | `./run.sh -b` | ## Pandoc Conversions ### Markdown to PDF ```bash # Basic conversion pandoc input.md -o output.pdf # With a specific template (e.g., for resumes) pandoc input.md -o output.pdf --template=altacv --pdf-engine=xelatex # With custom CSS (for HTML) pandoc input.md -o output.html --css=styles.css ``` ### Advanced Pandoc Options ```bash # Include metadata for title page pandoc --metadata title="Document Title" --metadata author="Author Name" input.md -o output.pdf # Use specific LaTeX engine for different fonts pandoc input.md -o output.pdf --pdf-engine=xelatex # Include TOC and specify depth pandoc input.md -o output.pdf --toc --toc-depth=2 ``` ## MdBook Commands ### Basic Operations ```bash # Create a new book mdbook init mybook # Build the book mdbook build # Serve with live reload mdbook serve # Open in browser after serving mdbook serve --open ``` ### Directory Structure ``` mybook/ ├── book.toml # Configuration file ├── src/ │ ├── SUMMARY.md # Table of contents │ ├── chapter_1.md │ └── chapter_2.md └── book/ # Generated files (ignored by git) ``` ## Typst Commands ### Compilation ```bash # Compile to PDF typst compile document.typ document.pdf # Watch for changes and recompile typst watch document.typ # Format the document typst format document.typ ``` ## Marp Commands ### Slide Generation ```bash # Convert to PDF slides marp --pdf slides.md # Convert to HTML slides marp --html slides.md # Serve with live preview marp --server slides.md # Use custom theme marp --theme custom-theme.css slides.md ``` ### Marp Slide Format ```markdown --- marp: true theme: gaia _class: lead paginate: true backgroundColor: ffffff backgroundImage: url('https://cdn.url-to-image') --- # Page 1 --- # Page 2 ``` ## Quarto Commands ### Document Rendering ```bash # Basic render quarto render document.qmd # Render to specific format quarto render document.qmd --to pdf quarto render document.qmd --to html quarto render document.qmd --to docx # Render with custom format quarto render document.qmd --to revealjs # For presentations ``` ### Project Creation ```bash # Create a new project quarto create-project myproject --type default quarto create-project mybook --type book quarto create-project myslides --type presentation ``` ## Document Templates ### Standard Markdown Template ```markdown --- title: "Document Title" author: ["Author Name"] date: "2025-01-01" lang: "en" header-includes: - \usepackage{fancyhdr} - \pagestyle{fancy} --- # Section Title Content goes here... ## Subsection More content here... ``` ### Resume Markdown Template (for Pandoc) ```markdown --- title: "John Doe" author: [] date: [] output: pdf_document: template: altacv pandoc_args: ["--top-level-division=section"] --- # Personal Info **Address:** 123 Main St, City, State **Phone:** (555) 123-4567 **Email:** john.doe@example.com **LinkedIn:** [johndoe](https://linkedin.com/in/johndoe) # Experience ## Job Title **Company Name** | Month Year - Present - Point 1 - Point 2 ``` ## File Locations ### Container Paths - Working directory: `/home/tsysdevstack/docs` - Output directory: `/home/tsysdevstack/output` - User home: `/home/tsysdevstack` - Mise tools: `~/.local/share/mise` ### Host Paths (when using run.sh) - Source documents: `./docs` - Output documents: `./output` - Examples: `./examples` - Documentation: `./documentation` ### Mise Management ```bash # Check currently managed tools mise ls # Install a new version of a tool mise install python@3.12.0 # Switch to a specific version mise use python@3.12.0 # Execute command with specific tool version mise exec -- python script.py ```