Skip to content

Commit e6905dd

Browse files
author
Iļja Ketris
committed
TOC tests
1 parent 8e2945e commit e6905dd

File tree

6 files changed

+20
-21
lines changed

6 files changed

+20
-21
lines changed

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
<<<<<<< HEAD
2-
<<<<<<< HEAD
3-
<!--- ![](https://github.com/punund/20ful/workflows/publish-npmjs/badge.svg) -->
4-
=======
51
![](https://github.com/punund/20ful/workflows/publish-npmjs/badge.svg)
6-
>>>>>>> current item in TOC
7-
=======
8-
![](https://github.com/punund/20ful/workflows/publish-npmjs/badge.svg)
9-
>>>>>>> badge update
102

113
# 20ful
124

bin/toc.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "20ful",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "Static site generator",
55
"engines": {
66
"node": ">=13.5"

source/toc.ls

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
build = (y) ->
33

44
hsh = y.hsh
5-
makeOl = values >> sortBy(path <[$ ord]>) >> map(desc) >> (* '')
65

7-
desc y
6+
makeOl = values >> sortBy(path <[$ ord]>) >> map(desc) >> (* '')
87

98
function desc x
109
li = switch
@@ -21,4 +20,6 @@ build = (y) ->
2120

2221
li + ol
2322

23+
desc y
24+
2425
export build

test/tocmaker.js

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/tocmaker.ls

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@ require! ava: test
33
require! '../bin/toc.js'
44

55
test ' makes TOC', ->>
6-
x = _:
7-
aa: $: key: \ak1, lnk: \al1
8-
bb: $: key: \bk1, lnk: \bl1
9-
6+
x =
7+
_:
8+
aa: $: key: \ak1, lnk: \al1
9+
bb: $: key: \bk1, lnk: \bl1, hsh: \abc
10+
hsh:
11+
'abc'
12+
1013
built = toc.build x
14+
console.log built
1115
it.is built, """
1216
1317
<ol><li><a href='/al1'>ak1</a>
14-
<li><a href='/bl1'>bk1</a>
18+
<li class=current-item>bk1
1519
</ol>
1620
1721
"""

0 commit comments

Comments
 (0)