Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I correctly paste multi-line xml snippet to github wiki when using markdown

I am trying to create a github wiki for my project. But I am unable to format a snippet from a Spring beans xml file, into this wiki. What is the proper way to do it? I tried using pre tag, code tag, the multiline code tag etc. But either it is not getting displayed at all or It displays everything in the same line.

like image 440
Abe Avatar asked Mar 17 '12 16:03

Abe


People also ask

How do you add a code snippet in Markdown?

There are two ways to format code in Markdown. You can either use inline code, by putting backticks (`) around parts of a line, or you can use a code block, which some renderers will apply syntax highlighting to.

How do you create a table of contents in Markdown?

Press CTRL + SHIFT + P. Select Markdown: Create Table of Contents.


2 Answers

not 100% sure if this is the same thing or not, but I just setup some xml snippets in my readme.md and used the

<myxml>
   <someElement />  
</myxml>

notation.

like image 172
Jon Avatar answered Oct 23 '22 17:10

Jon


Replace all the less-than < and greater-than > symbols with &lt; and &gt; respectively, then wrap in <pre> and <code> as before.

like image 36
Glim Avatar answered Oct 23 '22 15:10

Glim