在Markdown / Macdown编辑器中格式化MySQL代码

时间:2017-05-22 08:10:42

标签: mysql editor markdown

我试图找出使用Markdown / Macdown编辑器呈现某些MySQL查询的最明智的方式。

我尝试在查询代码段之前使用˜˜˜sql标记应用4个空格,但似乎效果不佳,因为它没有显示代码突出显示。

请参阅下面的屏幕截图:

enter image description here

有什么建议吗? 谢谢你的建议。

2 个答案:

答案 0 :(得分:5)

  

我尝试在...代码段之前使用~~~sql标记应用[四个]空格

您必须在缩进的代码块和受防护的代码块之间进行选择。替代语法的部分混合不起作用。

# Code Block #

What follows is a fenced code block. 
Note that all text starts immediately in the left margin. 
There is no indentation of the fences. 
There are no extra space characters at the start of these lines.

~~~~sql
update employee
  set salary = salary * 2
  where salary < 100000
~~~~

The following will not work

    ~~~~sql
    update employee
      set salary = salary * 2
      where salary < 100000
    ~~~~

You cannot mix indentation and fencing.

语法标识符是fenced code block语法的一部分。您必须结束代码块,并带有一行波浪线。

SQL是语法突出显示的supported language

您还必须“勾选Mac代码中的”在代码块中启用突出显示选项。“

Image of Macdown Preferences dialogue

答案 1 :(得分:0)

我注意到突出显示在Jupyter笔记本上无效。切换到~~~ mysql它确实有用(而不是使用~~~ sql)。

相关问题