You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ If you are using Arch or Manjaro Linux, you can install [toc](https://aur.archli
66
66
67
67
You should now be able to run `toc -h` to display a list of parameter you can use.
68
68
69
-
See [USAGE.md](./USAGE.md) for step-by-step explanations of the different features, and languages that don't need comments (e.g. Markdown) or needs special attention (e.g. CSS)
69
+
See [USAGE.md](./USAGE.md) for step-by-step explanations of different features, and a list of languages supported natively (e.g. Markdown, AsciiDoc, reStructuredText) or that need special attention (e.g. CSS)
70
70
71
71
See <https://regex101.com/r/ngzZXN/1> for examples of valid and invalid comments.
Copy file name to clipboardExpand all lines: USAGE.md
+25-7Lines changed: 25 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,8 @@
21
21
// │ │ ├── HTML
22
22
// │ │ ├── Man pages
23
23
// │ │ ├── Markdown
24
-
// │ │ └── Perl
24
+
// │ │ ├── Perl
25
+
// │ │ └── reStructuredText
25
26
// │ ├──┐Wrap around comments needed
26
27
// │ │ ├── CSS
27
28
// │ │ └── OCaml
@@ -40,7 +41,7 @@ The scenarios below show different features of `toc`
40
41
### Read the table of contents
41
42
42
43
Let's say you want to structure your javascript file "example.js".
43
-
Singleline comments in this language start with `//`.
44
+
Single-line comments in this language start with `//`.
44
45
You open your file and add these comments where you need them:
45
46
46
47
```js
@@ -344,7 +345,6 @@ For [AsciiDoc](https://raw.githubusercontent.com/apple/pkl/main/CONTRIBUTING.ado
344
345
===== Level 4 Section Title
345
346
346
347
====== Level 5 Section Title
347
-
348
348
```
349
349
350
350
#### Beancount
@@ -416,9 +416,27 @@ Text
416
416
=cut
417
417
```
418
418
419
+
#### reStructuredText
420
+
421
+
For [ReStructured Text](https://raw.githubusercontent.com/sphinx-doc/sphinx/master/doc/usage/restructuredtext/basics.rst) files, just use the [conventional heading format](https://devguide.python.org/documentation/markup/#sections):
422
+
423
+
```rst
424
+
*******
425
+
Chapter
426
+
*******
427
+
428
+
=======
429
+
Section
430
+
=======
431
+
432
+
----------
433
+
Subsection
434
+
----------
435
+
```
436
+
419
437
### Wrap around comments needed
420
438
421
-
These languages do not support singleline comments, and thus every comment should be wrapped by a multiline comment separator
439
+
These languages do not support single-line comments, and thus every comment should be wrapped by a multi-line comment separator
422
440
423
441
#### CSS
424
442
@@ -471,7 +489,7 @@ void main() { exit(0);}
471
489
#### RStudio
472
490
473
491
If you are using RStudio, you may want to end your comments with at least 4 `-`, `=` or `#`.
0 commit comments