在 Markdown/Macdown 个编辑器中格式化 MySQL 代码
Format MySQL code in Markdown/Macdown editors
我正在尝试找出使用 Markdown/Macdown 编辑器呈现 MySQL 部分查询的最聪明的方法。
我曾尝试在查询代码片段之前使用 ˜˜˜sql
标记应用 4 个空格,但它似乎效果不佳,因为它不显示代码高亮显示。
见下方截图:
有什么建议吗?
谢谢指教。
I have tried to apply [four] spaces with ~~~sql
markup before the ... code snippet
简述:
- 不要混用缩进和代码屏蔽
- 检查降价处理器中的选项
- 确保使用足够的波浪字符,
~~~
不够,~~~~
足够。
更长的答案:
1。不要混用缩进和代码围栏
您必须在缩进代码块和围栏代码块之间做出选择。替代语法的部分混合将不起作用。
# 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。
2。 Macdown 选项
您还必须“勾选在代码块选项中启用突出显示。” 在 Macdown 中。
3。波浪号 (~) 字符的数量很重要
(注意 O.P。Ugol 最终注意到了这一点 - 查看评论。最初我们都忽略了它)
~~~sql
波浪字符太少,只有三个
~~~~sql
具有正确数量的波浪字符以指示“围栏”
我注意到突出显示在 Jupyter 笔记本上不起作用。通过切换到 ~~~ mysql
它确实有效(而不是使用 ~~~ sql
)。
我正在尝试找出使用 Markdown/Macdown 编辑器呈现 MySQL 部分查询的最聪明的方法。
我曾尝试在查询代码片段之前使用 ˜˜˜sql
标记应用 4 个空格,但它似乎效果不佳,因为它不显示代码高亮显示。
见下方截图:
有什么建议吗? 谢谢指教。
I have tried to apply [four] spaces with
~~~sql
markup before the ... code snippet
简述:
- 不要混用缩进和代码屏蔽
- 检查降价处理器中的选项
- 确保使用足够的波浪字符,
~~~
不够,~~~~
足够。
更长的答案:
1。不要混用缩进和代码围栏
您必须在缩进代码块和围栏代码块之间做出选择。替代语法的部分混合将不起作用。
# 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。
2。 Macdown 选项
您还必须“勾选在代码块选项中启用突出显示。” 在 Macdown 中。
3。波浪号 (~) 字符的数量很重要
(注意 O.P。Ugol 最终注意到了这一点 - 查看评论。最初我们都忽略了它)
~~~sql
波浪字符太少,只有三个
~~~~sql
具有正确数量的波浪字符以指示“围栏”
我注意到突出显示在 Jupyter 笔记本上不起作用。通过切换到 ~~~ mysql
它确实有效(而不是使用 ~~~ sql
)。