Skip to content

Commit c6abdff

Browse files
committed
Update README
1 parent 9e77920 commit c6abdff

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,33 @@ directory, with the `.janet` suffix. If the binding includes the `/` character,
4747
an underscore - this works because no bindings in the core use an underscore. For example, the
4848
binding `array/new` has examples in the `examples/array_new.janet` file.
4949

50-
If such a file already exists, you can simply append your example code the existing file.
50+
To cope with some of Janet's symbols having names with characters that
51+
are not-so-friendly to certain filesystem and/or operating system
52+
combinations, an escaping scheme is used.
53+
54+
For a given symbol, use the `content/examples.janet` script to
55+
generate an appropriate filename. For example, for `array/new`,
56+
invoking:
57+
58+
```
59+
$ janet content/examples.janet array/new
60+
```
61+
62+
should give the output:
63+
64+
```
65+
array_47new.janet
66+
```
67+
68+
If such a file already exists, you can simply append your example code
69+
to the existing file.
70+
71+
When building the site, the new examples will be included in the
72+
generated documentation. Make sure that your example has correct janet
73+
syntax, as syntax errors will cause the entire site to not build. If
74+
the example has valid syntax (has a 0 exit code when loaded with
75+
`janet -k example/my-fn.janet`), there may be a bug in the mendoza
76+
janet syntax highlighter in which case please open a bug in mendoza.
5177

5278
When building the site, the new examples will be included in the generated documentation. Make
5379
sure that your example has correct janet syntax, as syntax errors will cause the entire site

0 commit comments

Comments
 (0)