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?

asked 03 Mar '11, 12:21

Volker%20Barth's gravatar image

Volker Barth
31.3k312458674
accept rate: 33%

edited 18 Mar '11, 11:28

Mark%20Culp's gravatar image

Mark Culp
23.3k9132275


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.

permanent link

answered 03 Mar '11, 14:09

Graeme%20Perrow's gravatar image

Graeme Perrow
8.7k374111
accept rate: 52%

edited 02 Nov '12, 12:30

2

Note that the code highlighting will not show up until this question is migrated to sqlanywhere-forum.sap.com.

(03 Mar '11, 14:10) Graeme Perrow

@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)?

(02 Nov '12, 12:34) Volker Barth
Replies hidden
1

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.

(02 Nov '12, 13:05) Graeme Perrow
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×166

question asked: 03 Mar '11, 12:21

question was seen: 889 times

last updated: 02 Nov '12, 13:05