on 2011 Mar 03 12:21 PM
This is a question originally asked in the beta of the new SQL Anywhere forum:
The "Markdown Basics" on the right side suggest to:
Code blocks should be indented by 4 spaces.
SQL code should begin with ":::SQL" on the first line.
Why? What is the effect of this prefix?
This tells the markdown code that the following block is SQL and it will colour the text accordingly. To wit:
select * from table where name like 'Volker%' order by id asc;
Note how SQL keywords (not all SQL Anywhere keywords - TODO) are coloured. Without the ":::SQL" it just shows up like this:
select * from table where name like 'Volker%' order by id asc;
If you don't have a language indicator, the markdown code attempts to determine what language it is, but I've found usually gets it wrong. In the preview window, you do not see the syntax colouring but in the final result, it should show up - and the ":::SQL" line should vanish.
You can use a whole bunch of language indicators: ":::bash" for shell scripts, ":::C", ":::C++", ":::python", ":::perl", etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Note that the code highlighting will not show up until this question is migrated to sqlanywhere-forum.sap.com.
@Graeme: Just in time - can you please explain why that prefix doesn't work in that answer I've just edited to include it (and have tried it several times yesterday with no luck)?
There's some weirdness with lists. There was no way for markdown to detect the end of the list so it tried to include the code block in the list element and did not format it as a code block. The "solution" was to end the list and add a separate paragraph after the end of the list.
User | Count |
---|---|
75 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.