Skip to content

Syntax highlighting - eyes needed #419

@finanalyst

Description

@finanalyst

@Raku/core
We have changed the syntax highlighter from one developed for the atom editor (atom-perl6-highlighter) to a Raku based one (Rainbow).

  • colouration request. Rainbow offers more categories that can be colourised, eg three separate regex categories, separate delimiter categories.
  • The colours chosen for the moment are the same as before, but the same colour is used for duplicate categories. Ideally each category should be a different colour (more generally styling).
  • Although the styling of each category is done via CSS, categories can be styled using colour, font, font decoration etc. However, that would need a bit more refactoring of the SCSS, eg adding variables for font as well as colour.
  • Please offer suggestions. (Values are needed for the light and dark themes separately)
  • concrete suggestions can be made using a PR changing the following files:
    • <repo root>/Website/plugins/rainbow/scss/rainbow-light.scss
    • .../scss/rainbow-dark.scss
    • the relevant colour values for the highlighting are assigned to SCSS variables $code-..... and start at about line 15.

Known problems:

  • when the RakuDoc source has =for code :allow<C> or other value in 'allow', the :allow option is not respected.
    • I think that only the Pod.rakudoc file still retains ':allow'
    • in the discussions about RakuDoc v2, the allow option is difficult to implement in combination with syntax highlighting, and needs to be handled separately. This will be developed in due course. The problem existed with the previous highlighter too.
  • Rainbow does not handle metadata options in RakuDoc blocks correctly as yet. The priority for addressing this flaw is considered low at present.
    • It is not known yet whether this affects any code snippets in the main sources. Help to determine this would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions