Skip to content

Instantly share code, notes, and snippets.

@josemvidal
Last active October 16, 2023 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josemvidal/352ba0b846ae39ab2398865076ca3a0e to your computer and use it in GitHub Desktop.
Save josemvidal/352ba0b846ae39ab2398865076ca3a0e to your computer and use it in GitHub Desktop.
Markdown Tips: Common Issues for New GitHub Users

Note that you can click the "Raw" button on the top-right of this box to see the source code, that is, the original markdown.

Github Markdown Cheatsheet

The Mastering Markdown page contains all the basic syntax. Read it. Checkout the task lists in that handout; you will be using them. BTW, I have a ton of little markdown booklets similar to this guide in my office. Just ask me for one.

HTML is Markdown

You can add almost any HTML to your markdown and it will work. Useful when you can't get markdown to do what you want.

Newline

To insert a newline, a <br/>, just end your line with 2 spaces
then a Return.
The next line with start in a new line but without an empty line in between.

Nested Lists and Auto Numbering

  1. I just have to put the number 1
  2. at the beginning of each line and MD will
  3. increase it automatically.
    1. To do nested sublist just add
    2. three spaces at the beginning.
    3. It is that simple.
      1. and a third level
      2. is also ok
        1. and even a fourth
        2. level

The source code for this is:

1. I just have to put the number 1
1. at the beginning of each line and MD will
1. increase it automatically.
   1. To do nested sublist just add
   1. three spaces at the beginning.
   1. It is that simple.

Embedding images in Wiki

You can embed images in Issues by just dragging and dropping them, or using the image button.

Collapsible Sections for Long Output

If you have a really long output that you want to add but don't want to make the Issue pages long, use the following bit of HTML in your markdown

Put Summary Here: Click to expand

You Can Put Markdown here

And you can paste the long output inside a code block

> ls /etc                                                                                                            Mon 07:32
afpovertcp.cfg                        hosts.equiv                           php.ini.default
afpovertcp.cfg~orig                   hosts~orig                            php.ini.default-previous
aliases                               irbrc                                 php.ini.default-previous~orig
aliases.db                            kern_loader.conf                      postfix
apache2                               kern_loader.conf~previous             ppp
asl                                   krb5.keytab                           profile
asl.conf                              localtime                             profile~orig
auto_home                             locate.rc                             protocols
auto_master                           mach_init.d                           protocols~previous
auto_master~orig                      mach_init_per_login_session.d         racoon
autofs.conf                           mach_init_per_user.d                  rc.common
bashrc                                mail.rc                               rc.common~previous
bashrc_Apple_Terminal                 mail.rc~orig                          rc.netboot
bashrc~previous                       man.conf                              resolv.conf
com.apple.screensharing.agent.launchd manpaths                              rmtab
csh.cshrc                             manpaths.d                            rpc
csh.cshrc~orig                        master.passwd                         rpc~previous
csh.login                             master.passwd~orig                    rtadvd.conf
csh.login~orig                        nanorc                                rtadvd.conf~previous
csh.logout                            networks                              security
csh.logout~orig                       networks~orig                         services
cups                                  newsyslog.conf                        services~previous
defaults                              newsyslog.d                           shells
dnsextd.conf                          nfs.conf                              shells~orig
emond.d                               nfs.conf~orig                         snmp
exports                               notify.conf                           ssh
exportsbak                            ntp.conf                              ssl
find.codes                            ntp_opendirectory.conf                sudo_lecture
find.codes~orig                       openldap                              sudoers
fing                                  pam.d                                 sudoers.d
fstab.hd                              passwd                                sudoers~orig
fstab.hd~previous                     paths                                 syslog.conf
ftpusers                              paths.d                               syslog.conf~previous
ftpusers~orig                         paths~orig                            ttys
gettytab                              periodic                              ttys~previous
gettytab~orig                         pf.anchors                            wfs
group                                 pf.conf                               xtab
group~previous                        pf.os                                 zprofile
hosts                                 php-fpm.conf.default                  zshrc
hosts-e                               php-fpm.d

Also works for code snippets

def hello:
   print("hello world!")

This way your Issue does not use tons of vertical space but still contains all the needed info.

Style

Quotes (>) are only for quoting

You should use quotes only to quote what others have said, for example:

You can create .NET Core apps for Windows, macOS, and Linux for x64, x86, ARM32, and ARM64 processors using multiple programming languages. --from the manual

Codes blocks are for code

The code blocks are just for code, command-line commands, output from commands, etc. Code blocks are rendered in a monospace font and handle long lines by letting the user just scroll left-right.

You use code blocks for code, not for quoting English text.

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