Star

MIT License
Copyright © 2020
CONNECT-platform

linkCode Highlights

To highlight a line in a code snippet, add /*!*/ symbol to the beginning of the line:

1```go | clojure-example.go

2package main

3

4import "fmt"

5

6func intSeq() func() int {

7/*!*/ i := 0

8/*!*/ return func() int {

9/*!*/ i++

10/*!*/ return i

11/*!*/ }

12}

13

14func main() {

15 nextInt := intSeq()

16 fmt.Println(nextInt())

17 fmt.Println(nextInt())

18 fmt.Println(nextInt())

19

20/*!*/ newInts := intSeq()

21/*!*/ fmt.Println(newInts())

22}

23```

clojure-example.go
1package main

2

3import "fmt"

4

5func intSeq() func() int {

6 i := 0

7 return func() int {

8 i++

9 return i

10 }

11}

12

13func main() {

14 nextInt := intSeq()

15 fmt.Println(nextInt())

16 fmt.Println(nextInt())

17 fmt.Println(nextInt())

18

19 newInts := intSeq()

20 fmt.Println(newInts())

21}


linkSpacing and Language Support

The symbol /*!*/ is pre-processed by codedoc before syntax highlighting and removed from the code, so it will not cause any issues in languages where /* ... */ is not a valid comment syntax. This also means that you should not factor it in for line indentation and spacing:

1```go

2func a() int {

3/*!*/ i := 0 // --> these two lines will have same indentation

4 i++ // --> these two lines will have same indentation

5}

6```

1func a() int {

2 i := 0 // --> these two lines will have same indentation

3 i++ // --> these two lines will have same indentation

4}

Code HighlightsSpacing and Language Support

Home Overview CLI Theme

Markdownchevron_right
Code Featureschevron_right

Images & Assets

Configurationchevron_right
Customizationchevron_right