Skip to content

Commit

Permalink
Add syntax highlighting, updated vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristineTham committed Jan 4, 2021
1 parent e68a0b7 commit 9edfcf9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
4 changes: 3 additions & 1 deletion content/en/Themes/macOS-Terminal/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ colortest-8 results

{{< imgproc colortest-16 Fit "644x559" >}}
colortest-16 results
{{< /imgproc >}}
{{< /imgproc >}}

Please note, if you want to automatically switch between dark and light versions of the macOS Terminal profiles, you may want to read [The macOS Dark Mode, your Terminal and Vim](https://stefan.sofa-rockers.org/2018/10/23/macos-dark-mode-terminal-vim/).
Binary file modified content/en/Themes/vs-code/rosely-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion content/en/docs/Colours and palettes/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ The colours in this group include a delectable raspberry, a periwinkle blue, a c

This is an optional palette to be used in designs which require an expanded gamut and are intended to be drop in replacements for ANSI terminal colour schemes.

The [ANSI escape code standard](https://en.wikipedia.org/wiki/ANSI_escape_code), formally adopted as [ISO/IEC 6429](https://www.ecma-international.org/publications/standards/Ecma-048.htm), defines a series of control sequences. Each control sequence begins with a *Control Sequence Inducer* (CSI), defined as an escape character followed immediately by a bracket: `ESC[`. In particular, a CSI followed by a certain number of “parameter bytes” (ASCII `0–9:;<=>?`) then the letter m forms a control sequence known as a *Select Graphic Rendition* (SGR). If no parameter bytes are explicitly given, then it is assumed to be 0. SGR parameters can be chained together with a semicolon ; as the delimiter.
> The [ANSI escape code standard](https://en.wikipedia.org/wiki/ANSI_escape_code), formally adopted as [ISO/IEC 6429](https://www.ecma-international.org/publications/standards/Ecma-048.htm), defines a series of control sequences. Each control sequence begins with a *Control Sequence Inducer* (CSI), defined as an escape character followed immediately by a bracket: `ESC[`. In particular, a CSI followed by a certain number of “parameter bytes” (ASCII `0–9:;<=>?`) then the letter m forms a control sequence known as a *Select Graphic Rendition* (SGR). If no parameter bytes are explicitly given, then it is assumed to be 0. SGR parameters can be chained together with a semicolon ; as the delimiter.
>- [Information from Chris Yeh's blog post on Terminal Colours](https://chrisyeh96.github.io/2020/03/28/terminal-colors.html)
The 8 actual colors within the ranges (30-37, 40-47, 90-97, 100-107) are defined by the ANSI standard as follows:

Expand Down
23 changes: 23 additions & 0 deletions content/en/docs/Concepts/syntax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "Syntax Highlighting Guidelines"
linkTitle: "Syntax Highlighting"
description: >
The Rosely colour palette can be easily used for syntax highlighting using guidelines similar to Base16
---

[base16](http://chriskempson.com/projects/base16/) is an architecture for building themes based on carefully chosen syntax highlighting using a base of sixteen colours. Base16 provides a set of guidelines detailing how to style syntax and how to code a builder for compiling base16 schemes and templates.

Rosely is not completely compatible with base16 (although it is possible to get base16 compliance by rearranging the colour palette) but a similar technique can be used for syntax highlighting. The aim is to group similar language constructs with a single color. For example, floats, ints, and doubles would belong to the same colour group.

The following are base16 guidelines for syntax highlighting adapted for Rosely (colours are selected from the ANSI palette to be consistent with syntax highlighting on terminal):

| base16 | Syntax highlighting elements | Colour |
| --- | --- | --- |
| base08 | Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted | bright red |
| base09 | Integers, Boolean, Constants, XML Attributes, Markup Link Url | green |
| base0A | Classes, Markup Bold, Search Text Background | bright magenta |
| base0B | Strings, Inherited Class, Markup Code, Diff Inserted | bright green |
| base0C | Support, Regular Expressions, Escape Characters, Markup Quotes | cyan |
| base0D | Functions, Methods, Attribute IDs, Headings | blue |
| base0E | Keywords, Storage, Selector, Markup Italic, Diff Changed | magenta |
| base0F | Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?> | white |

0 comments on commit 9edfcf9

Please sign in to comment.