BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

Add x86/x86_64 assembly to list of supported languages in code blocks

Open qbe4 opened this issue 1 year ago • 2 comments

Describe the feature you'd like

I'd like syntax highlighting for x86 and x86_64 assembly languages in code blocks.

Describe the benefits this would bring to existing BookStack users

Be able to read assembly code blocks more easily.

Can the goal of this request already be achieved via other means?

No

Have you searched for an existing open/closed issue?

  • [X] I have searched for existing issues and none cover my fundamental request

How long have you been using BookStack?

3 months to 1 year

Additional context

There is "x86asm" in highlight.js : https://github.com/highlightjs/highlight.js/blob/main/src/languages/x86asm.js

qbe4 avatar Apr 26 '24 07:04 qbe4

Thanks for the suggestion @qbe4, Since I'm not too familiar with the forms of assembly, does the syntax highlighting here look correct?: https://codemirror.net/5/mode/gas/index.html

Saving this for my implementation reference: https://github.com/codemirror/legacy-modes/blob/main/mode/gas.js

ssddanbrown avatar Apr 26 '24 16:04 ssddanbrown

Hi @ssddanbrown, in fact the syntax used in GAS is the AT&T syntax which is quite ugly and not very used. The most commonly used syntax is the Intel syntax. To see the difference between the two : AT&T Syntax and Intel Syntax.

I doesn't have found an implementation of the Intel syntax in codemirror :(

qbe4 avatar Apr 26 '24 16:04 qbe4