Skip to content

Instantly share code, notes, and snippets.

@martinandersen3d
Created May 21, 2022 01:45
Show Gist options
  • Save martinandersen3d/12a30d19e82cacb2b1d7d4d9daf36d49 to your computer and use it in GitHub Desktop.
Save martinandersen3d/12a30d19e82cacb2b1d7d4d9daf36d49 to your computer and use it in GitHub Desktop.
documentation-cheatsheet

[TOC]

Code tour

CodeTour is a Visual Studio Code (VSCode) extension which allows you to record and play back guided walkthroughs of your codebases

Markdown

e.g. used for readme.md files and other markdown files in repos Reference

Emoji

  • https://emojipedia.org/
  • You can use the emoji markup: :boom:
  • Or you can just copy the image/character from that webpage: ๐Ÿ’ฅ
  • Recommended images:
    Emoji Tags
    โ˜ธ๏ธ helm
    ๐Ÿณ docker
    ๐Ÿ“ฆ package
    ๐Ÿ“ directory, folder
    โฌ†๏ธ up, upload, push, publish
    โฌ‡๏ธ down, get, download
    ๐Ÿงน clean, delete
    โ›ฐ๏ธ overview, summary
    ๐Ÿ“œ log
    ๐Ÿ’ฌ log
    โ„น๏ธ information
    ๐Ÿ”Ž search
    ๐ŸŒŽ global
    ๐Ÿก home
    ๐Ÿ‘€ eyes, watching, review, read
    ๐Ÿงฎ abacus, calculate, determine
    ๐Ÿงช testing
    ๐Ÿ“Š test results
    ๐Ÿ“ˆ chart up, increase, code coverage, analysis
    ๐Ÿ“‰ chart down, lower, code coverage, analysis
    ๐Ÿ•ต๏ธ security, inspect
    ๐Ÿ‘ฎ police, authorize, validate, gatekeeper, gate
    ๐Ÿง™ wizard, mage, script
    โœจ sparkles, magic
    ๐Ÿ”ฎ crystal ball, waiting
    ๐Ÿฆ„ unicorn, special
    โš™๏ธ settings, configuration
    ๐Ÿ‘ท construction, worker, configure, change
    ๐Ÿญ assemble, construct, build
    ๐Ÿ—๏ธ develop, create, terraform
    โ˜” umbrella, protection, guard
    ๐Ÿ”’ secure, protect
    ๐Ÿ” secure, protect
    ๐Ÿ”‘ key, unlock, credentials, user
    ๐Ÿƒ running, fast
    ๐ŸŒ snail, slow
    โšก lightening
    ๐Ÿ‘ good, positive
    ๐Ÿ‘Ž bad, negative
    โญ star
    ๐Ÿ† trophy, complete, success
    ๐ŸŽฏ bullseye
    โœ”๏ธ success
    โŒ cross, x, error, failed
    ๐Ÿ’ฅ errors, failed
    ๐Ÿšฉ issue, flag
    ๐Ÿ”” notify, bell
    ๐Ÿ“ข loudspeaker, alert
    โš ๏ธ warning
    ๐Ÿ›‘ stop
    ๐Ÿšซ prohibited
    ๐Ÿ˜ฒ astonished, shocked
    ๐Ÿ˜ค frustrated
    โค๏ธ heart, love
    ๐Ÿฅ drum
    ๐Ÿงฉ puzzle
    ๐Ÿ’ค sleep, wait
    โณ hourglass, wait
    โŒš watch, timer
    โฒ๏ธ timer clock
    โฑ๏ธ timer, wait, stopwatch
    โฐ alarm
    ๐Ÿ“† calendar, schedule
    ๐ŸŽ“ graduate
    ๐Ÿ’ป laptop
    ๐Ÿ”‡ mute, silent
    โ˜€๏ธ sun
    ๐ŸŒป sunflower
    ๐Ÿ”ฅ fire
    โ–ถ๏ธ play
    โธ๏ธ pause
    โน๏ธ stop
    ๐Ÿ” repeat
    โ™พ๏ธ infinity
    ใ€ฐ๏ธ wavy dash
    ๐ŸŸข status green
    ๐ŸŸก status yellow
    ๐Ÿ”ด status red
    โšช status neutral
    โšซ status null
    ๐Ÿ”— link

Mermaid diagrams

Mermaid lets you create diagrams and visualizations using text and code.

  • Mermaid Live editor allows you to create the following diagrams
    • Flow chart
    • Sequence diagram
    • Class diagram
    • State diagram
    • Gantt chart
    • Pie chart
    • ER (entity relationship) diagram
    • User journey
  • Once created, you can copy a link to the markdown and put it in your markdown file, or save the image as PNG/SVG

Comment

<!---
this is a markdown comment
--->

H1

# title

h2

## title

H3

### title

H4

#### title

H5

##### title

H6

###### title

bold

  • this is **bold** text. [preferred]
  • this is __bold__ text.

italics

  • this is *italic* text. [preferred]
  • this is _italic_ text.

bold and italic

  • this is ***bold and italic*** text. [preferred]
  • this is ___bold and italic___ text.

code (use single backtick before and after)

  • Start-Thing -Env Dev -App Batch

fenced code block

  • Use three backtick, and no need to indent
  • Add syntax highlighting by adding language after backtick
  • Language support
    • JSON
    • PWSH, PowerShell
    • XML
    • YAML
Start-Thing -Env Dev -App Batch
variables:
  - name: myVarName
    value: someValue

blockquote

  • > this is a blockquote

example

horitzontal rule

  • ---
  • ***

table

Syntax Description
Header Title
Paragraph Text

link and title

  • [Duck Duck Go](https://duckduckgo.com "The best search engine for privacy").

link to header in current doc

  • [HeaderName](#HeaderName)

url and email

ordered list

1. first
2. second
3. third

unordered list

* item 
* item 
* item

image

![Show pic in local folder](/images/local-picture-file.jpg "alt text")

![Philly Magic Gardens](https://applehostels.com/wp-content/uploads/2015/03/magicgarden.jpg "Philadelphia's Magic Gardens")

or

<img src="mypic.jpg" alt="this is my pic">

HTML

Use HTML tags instead of standard markdown based on your preferences.

  • Image tags:
    <img src="mypic.jpg" alt="this is my pic">
  • Text/background color

Diagrams cheat sheet

Flowcharts

Why use flowcharts?

  • Flowcharts are helpful in a variety of scenarios
    • Document a process and visualize ideas
      • Not everyone on your team will have the time (or resources) to read through a complicated and lengthy process document. A flowchart allows everyone to follow the workflow, understand the tasks, and analyze the individual steps quickly and easily.
    • Make a justify decisions
    • Organize teams and tasks
    • Identify bottlenecks or issues
    • Standardize processes
    • Track progress
  • In Business, there are generally 5 types of flowcharts
    1. Decision to make or justify a step
    2. Logic to uncover and prevent issues
    3. System to represent data flow
    4. Product to visualize product creation process
    5. Process to display process outcomes

Definitions:

  • Data Flow Diagram (DFD) ...[todo]
  • Process Flow Diagram (PFD) ...[todo]
  • Workflow diagram (WFD) is an end-to-end process that helps teams meet their goals by connecting the right people to the right data at the right time

How to make a flowchart

Steps:

  1. Define the scope of your project:
    • Before you hit the drawing board or open your flowchart maker, define your project scope and process purpose. Ask yourself what your project should accomplish and what appropriate beginning and end dates are.
  2. Identify tasks in chronological order:
    • Depending on the kind of flowchart youโ€™re creating, you may want to review existing documentation, interview team members on their past experiences, or observe an existing process. It can help to write down some of the steps as a list before you create your first flowchart draft.
  3. Organize tasks by type and symbol:
    • Once you have all of your tasks written out and organized chronologically, assign them to their corresponding symbol so youโ€™re prepared to draw your flowchart.
  4. Draw your flowchart:
    • You can sketch it out by hand or use a flowchart maker or flowchart software to create a flowchart that you can easily share with your team.
  5. Confirm and refine your flowchart:
    • Getting a second, third, or even fourth set of eyes on your flowchart will help you uncover bottlenecks or potential problems and allow you to refine the flowchart before the process starts.

What are flowcharts components?

All flowcharts are composed of nodes (the geometric shapes) and links (the arrows or lines).

Node Shapes Usage
rectangle shape with square edges process
rectangle shape with round edges alternate process, usually connected with dotted line
stadium shape (rectangle with very rounded sides) start, end
rectangle in a subroutine (rectangle with vertical lines on both sides) pre-defined series of steps to perform a task, i.e. a function
cylindrical shape (database) store data
circle shape connector used to join different flow lines, inspection point
rhombus shape (diamond) decision
hexagon shape (6-sided) preparation
parallelogram shape (rectangle leaning right or left) data input, output
trapezoid shape (rectangle with skinnier top or bottom) manual operation
triangle (pointing up or down) merge, extract
pentagon off-page link or connector

Link show relationships between nodes

Link Style Usage
solid line primary flow
dotted line alternate flow
thick solid line
arrowhead end direction of process flow
circle end
X end

Each line can optionally have text

Subgraphs show smaller groups of nodes and how they interact with other groups of nodes, or individual nodes within those groups

Swimlanes

Swimlanes help show cross-team processes, where each lane will hold nodes for a respective team

Mermaid diagrams

  • Create diagrams here
  • Documentation
  • Can create diagrams here too
  • GitHub Diagrams with Mermaid
    stateDiagram-v2
      [*] --> Still
      Still --> [*]
    
      Still --> Moving
      Moving --> Still
      Moving --> Crash
      Crash --> [*]
    digraph PolicyState {
      size="8,5"
      node [shape = doublecircle]; Unwritten;
      node [shape = rectangle style=filled]; Void Cancelled;
      node [shape = circle];
      Unwritten -> Open [ label = "Open" ];
      Unwritten -> Void[ label = "Void" ];
      Open -> Cancelled [ label = "Cancel" ];
      Open -> Closed [label = "Close" ];
      Open -> Open [label = "Update"];
      Open -> Void [label = "Void"];
      Closed -> Open [label = "Open"];
      Void [color="0.000 1.000 1.000"];
      Cancelled [color="0.201 0.753 1.000"];
    }
    • Not sure when ADO will support Mermaid

Tree

Tree cmd graphically displays the folder structure of a drive or path.

TREE [drive:][path] [/F] [/A]
/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.

โ”‚   buildver.txt
โ”‚   RolloutSpec.json
โ”‚   ScopeBindings.json
โ”‚   ServiceModel.json
โ”‚
โ”œโ”€โ”€โ”€bin
โ”‚       WebApp.zip
โ”‚
โ”œโ”€โ”€โ”€Parameters
โ”‚       WebApp.Parameters.json
โ”‚       WebApp.RolloutParameters.json
โ”‚
โ””โ”€โ”€โ”€Templates
        WebApp.Template.json

Could use these character manually as well:

  • โ”‚
  • โ””
  • โ”œ
  • โ”€

Documentation conversion

Pandoc

If you need to convert files from one markup format into another, pandoc is your swiss-army knife.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment