Skip to content
This repository was archived by the owner on May 26, 2019. It is now read-only.
This repository was archived by the owner on May 26, 2019. It is now read-only.

Update Code Blocks to include additions, removals, and highlights  #77

@trek

Description

@trek

A big challenge in writing tutorials where code mutates over time is accurately drawing the reader's attention to lines of code that have been added, removed, or need highlighting.

The react docs do an excellent job here:
getting started react 2015-03-22 10-52-51

They've augments the fenced code 'metadata' section with a micro syntax to define highlights:

Highlight one line:

```javascript{10}

Highlight multiple lines:

```javascript{3,10,55}

In addition to this, we can expand the syntax to include classes for line additions and removals:

Line 10 is removed:

```javascript{-10}

Line 10 is added:

```javascript{+10}

Line 10 is removed, line 15 is added, line 16 is highlighted:

```javascript{-10,+15,16}

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