Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Following YAML snippet that I'm trying to place in my markdown formatted readme:

``` 
libraries:  
- name: numpy     
version: "1.6.1"   
```

Tried the above with both no and 2 trailing spaces at the end of each line. Both turn out on a single line. Obviously I want them on 3 separate lines in my README.md.

How?

edit: note tried adding 'yaml' as the optional lang parameter but no dice either.

share|improve this question

closed as off-topic by GlenH7, MichaelT, Eric King, jwenting, Ampt Jun 16 at 23:42

  • This question does not appear to be about software development within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

6  
This question appears to be off-topic because it is about an implementation issue with a 3rd party site. It would have been better asked on Stack Overflow but is too old to migrate. –  GlenH7 Jun 12 at 13:58
1  
@GlenH7 correction: webapps.SE in the github tag. See Where does my git question go? –  MichaelT Jun 12 at 15:26

2 Answers 2

up vote 2 down vote accepted

IIRC, github uses

```lang
the
code
here
```

syntax. You can omit lang, but if you include it, the syntax highlighting is used for that lang.

share|improve this answer
    
that's what I tried (see edit) - I forgot stackexchange uses markdown too... –  rutherford Oct 28 '12 at 16:28
1  
I just tried it, it works fine for me (in preview, did not actually save). Shows on three lines, plain black with only three backticks, syntax-highlighted with ```yaml. No trailing spaces. –  herby Oct 28 '12 at 16:34
    
only thing I can think of fecking things up is the fact mine is inside a numbered list? - it's @ github.com/rutherford/nltk-gae if it's any use. –  rutherford Oct 28 '12 at 17:07
1  
Add an empty line after closing ``` and it will work. –  herby Oct 28 '12 at 17:13

I didn't have any luck with ``` surrounding the YAML front matter code examples on my site hosted on Github. Github still read it as code, showing the interpreted content as a result.

Didn't work:

```
{% include header.html %}
```

Also tried this with no luck.

```yaml
{% include header.html %}
```

I found a working solution by surrounding the YAML code with {% raw %} and {% endraw %} tags:

```
{% raw %}{{ page.title }}{% endraw %}
```

http://eric-price.co/blog/create-a-jekyll-blog-part1/

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.