# Markdown and Markdown Tools ## DCS Wednesdays --- # What is Markdown - lightweight markup language - formats text using a plain-text editor - easy to read source code - wide support - can be learned in an afternoon ---- # Markdown is easy to learn - this is an unordered list in markdown - you can put **emphasize text** and *italicize* - supports inline [links](https://www.markdownguide.org/) - supports formatted `inline code` --- # Code Blocks ```md # Markdown is easy to learn - this is an unordered list in markdown - you can put **emphasize text** and *italicize* - supports inline [links](https://www.markdownguide.org/) - supports formatted `inline code` ``` ---- # Code Blocks Supports syntax highlighting for a lot of languages ```python= def factorial(n:int) -> int: if x <= 1: return 1 else: return n * factorial(n-1) ``` ---- # Code Blocks Supports syntax highlighting for a lot of languages ```haskell= factorial :: Int -> Int factorial 0 = 1 factorial n = n * (factorial (n-1)) ``` ---- # Code Blocks Supports syntax highlighting for a lot of languages ```c= int factorial(int n){ if (n<=1) return 1; else return n * factorial(n-1); } ``` --- # Document Formatting ```md # Title ## Section ### Subsection 1 Text ### Subsection 2 - list item 1 - list item 2 ``` --- ### Images and Animations ```md ![collapse pca](https://i.imgur.com/nPZOo3t.gif) ``` ![collapse pca](https://i.imgur.com/nPZOo3t.gif) --- # Tables ```md | $p$ | $\neg p$ | | :--: | :------: | | $T$ | $F$ | | $F$ | $T$ | ``` | $p$ | $\neg p$ | | :--: | :------: | | $T$ | $F$ | | $F$ | $T$ | --- # LaTex Display Math ```latex \begin{aligned} \lim_{n \to \infty} \frac{f(n)}{g(n)} &<\infty \to f(n) \in O(g(n))\\ \lim_{n \to \infty} \frac{f(n)}{g(n)} &> 0 \to f(n) \in \Omega(g(n))\\ \end{aligned} ``` $$ \begin{aligned} \lim_{n \to \infty} \frac{f(n)}{g(n)} &<\infty \to f(n) \in O(g(n))\\ \lim_{n \to \infty} \frac{f(n)}{g(n)} &> 0 \to f(n) \in \Omega(g(n))\\ \end{aligned} $$ ---- # LaTex Inline Math ```md - vertical stretch: $\begin{bmatrix} 1 & 0\\ 0 &2 \end{bmatrix}$ - vertical shear: $\begin{bmatrix} 1 & 0\\ 1 &1 \end{bmatrix}$ ``` - vertical stretch: $\begin{bmatrix} 1 & 0\\ 0 &2 \end{bmatrix}$ - vertical shear: $\begin{bmatrix} 1 & 0\\ 1 &1 \end{bmatrix}$ --- # Sequence Diagrams ```mermaid %% Example of sequence diagram sequenceDiagram Alice->>Eli: Hello Eli, how are you? alt is sick Bob->>Alice: Not so good :( else is well Bob->>Alice: Feeling fresh like a daisy end opt Extra response Bob->>Alice: Thanks for asking end ``` ---- # Flowcharts ```mermaid! graph LR A[/input x/] --> B[/input y/] B --> C{x < y} C -->|True| D[\output x\] C -->|False| E[\output y\] ``` ---- # Class Diagrams ```mermaid classDiagram Animal <|-- Duck Animal <|-- Fish Animal <|-- Zebra Animal : +int age Animal : +String gender Animal: +isMammal() Animal: +mate() class Duck{ +String beakColor +swim() +quack() } class Fish{ -int sizeInFeet -canEat() } class Zebra{ +bool is_wild +run() } ``` --- # Supported by `Pandoc` ```bash pandoc -f markdown 'Term Paper.md' -o 'Term Paper.pdf' ``` ---- # Supported by so many tools - [Reveal.js](https://revealjs.com/) - [notion](https://www.notion.so/) - [obsidian](https://obsidian.md/) - [jupyter notebooks](https://jupyter.org/) - and many more
{"title":"type: slides","description":"type: slides","contributors":"[{\"id\":\"caa45ba8-d26f-46a6-8627-2ea0f2059fe9\",\"add\":4101,\"del\":475}]"}
    165 views