Why my markdown output is different from github?

The output in my page adds bullets points as such:

Whereas in github it doesn’t show it!

Your markdown is badly structured. Fix that and see if that makes bullet points on GitHub.

Bullet points are not meant to have empty lines between them. Taking the lines out will make them all bullets.

Taking the whitespace out between numbered points keep them all in the same sequence as 1 2 3 not 1 1 1 as in your result.

Also indenting the bullets inside the numbered points ensures your numbering appears as 1 2 3 and not 1 1 1. I recommend 4 spaces for indentation.

Sample

1. First question
    - [ ] first answer 
    - [x] second answer
    - [ ]
    - [ ]
2. Second question
    - [x] first answer 
    - [ ] second answer
    - [ ]
    - [ ]

Result. Oh Jekyll forums doesn’t support checkbox it seems.

  1. First question
    • [ ] first answer
    • [x] second answer
    • [ ]
    • [ ]
  2. Second question
    • [x] first answer
    • [ ] second answer
    • [ ]
    • [ ]
1 Like

Note also that the numbers are meaningless in markdown. Markdown numbering gets evaluated for you.

I often use all ones for long lists and let the markdown converter number from 1 to 10 for me. Then if I move points around then I don’t have to fix up my numbers

Sample code

1. A
1. B
1. C
1. D
1. E

Result:

  1. A
  2. B
  3. C
  4. D
  5. E

For background on why you saw inconsistent bullet point output.

Markdown is not standardized. There ambiguities in the spec so each platform implements their own. GitHub Pages / Jekyll also lets you choose different styles. The GitHub-flavored markdown is the default and I’m happy with that. But there can still be minor differences.

1 Like

The difference in appearance is due to CSS styles. Github’s default styles hide the bullet points on task lists using the following rule. Applying a similar style to your page would remove the bullets.

.task-list-item {
    list-style-type: none
}
1 Like

which specific file shall i put this rule in?

How many spaces should i use for indentation?
Should there be space inside the square brackets?
What the after the square brackets should there be space too?

Thanks helped alot :slight_smile:

Add that rule to CSS or in this case scss file.

1 Like

The CSS rules could be placed in assets/css/style.scss or any of the SCSS imported from there.

1 Like

4 spaces is best for markdown. Even though 2 spaces is usually valid, it breaks things sometimes like putting code snippets under bullet points.

You should experiment to see what markdown approaches so you can learn and make notes for youself.

Yes there must be a space inside the hard brackets. Try without and you’ll see it break.

It will probably break if you leave out space after hard brackets but I’ve never tried because it would look squashed up with text next to it.

1 Like

I didn’t have to add it chirpy theme had it aready :slight_smile: