GodotDocMobile / Gearence

Read class reference documents of Godot Engine on your mobile devices.
GNU General Public License v3.0
21 stars 2 forks source link

Code needs better formatting #2

Closed pwab closed 3 years ago

pwab commented 3 years ago

GDScript code examples inside the docs aren't formatted well. This could be improved by working around the following problems:

  1. Codeboxes have no monospaced font (like FiraCode or Source Code Pro)
  2. Code isnt' highlighted (like with CodeField but as far as I can see flutter_highlight doesn't support GDScript yet)
  3. Code is wrapped (make it scrollable with touch-input would be a better alternative)

I hope I have made my issues clear. If not I'll gladly add some screenshots for more explanation.

fengjiongmax commented 3 years ago

I have improving code/codeblock display in mind, but I'm too lazy to try them after I checking flutter_lighlight and know it does not support GDScript...

pwab commented 3 years ago

I looked into flutter_lighlight and its language specification. It could be possible to just copy the python implementation and use this as a starting point.

fengjiongmax commented 3 years ago

Just did some digging, I think in highlight.dart, supported language definition files were generated by tools/highlight.js, and it requires the highlight.js library itself, which supports GDScript but need some extra work.
Because GDScript.js does not exist in highlight.js/src/languages/, and highlight.js support for GDScript is in another repository.
This should work, thanks.

fengjiongmax commented 3 years ago

code now can scroll horizontally Screenshot_1633256161 Screenshot_1633256177 Will ship under version 0.2.0, should be available in the next day or two. Closing this, reopen if needed.

pwab commented 3 years ago

Looks super awesome! :+1: