[英]Display highlighted code blocks in Markdown code block in GitHub Flavored Markdown
[英]github markdown for block of code
下面的代碼沒有將 ``` 之間的內容格式化為匯編代碼,我想知道為什么。 謝謝!
- here is an example of an appropriate input file
```
.text
main:
la $s0, A # load variables A and B into registers
lw $s0, 0($s0)
la $s1, B
lw $s1, 0($s1)
add $s2, $s0, $s1 # calculate sum
la $s3, Sum # assign result to Sum
sw $s2, 0($s3)
sub $s2, $s0, $s1 # calculate difference
la $s3, Diff # assign result to Diff
sw $s2, 0($s3)
exit:
li $v0, 10 # system call to terminate program
syscall # make call
.data
A: .word 32
B: .word 16
Sum: .word 0
Diff: .word 0
```
<h3>Output:</h3> a ASCII text file with the corresponding MIPS machine code. Here is the corresponding output file to the above input file
就其價值而言,現在(提出問題后 3 年),組裝似乎很有魅力
```assembly
.text
main:
la $s0, A # load variables A and B into registers
lw $s0, 0($s0)
la $s1, B
lw $s1, 0($s1)
```
不同的降價實現可能使用不同的語法高亮字符串。
Stackoverflow 使用這個 javascript 文件: https : //dev.sstatic.net/js/prettify-full.en.js
不幸的是,不支持組裝。
根據這個元問題,stackexchange 上支持的語言列表是:
"bsh", "c", "cc", "cpp", "cs", "csh",
"cyc", "cv", "htm", "html", "java",
"js", "m", "mxml", "perl", "pl", "pm",
"py", "rb", "sh", "xhtml", "xml", "xsl"
Github 使用這個 yaml 文件: https : //github.com/github/linguist/blob/master/lib/linguist/languages.yml正確的字符串是assembly
Discord:可在此處找到語言列表: https : x86asm
對於 Intel x86,相關代碼為x86asm
他們的語法高亮“語言學家”引擎只知道這么多語言; 似乎匯編代碼不在其中,因為我似乎在他們的linguist/samples目錄中看不到任何示例。
但是,如果它位於 ``` 標記之間,它仍應顯示為等寬字體的代碼塊。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.