1 | ---
|
2 | default_highlighter: oils-sh
|
3 | preserve_anchor_case: yes
|
4 | ---
|
5 |
|
6 | Oils Reference
|
7 | =============
|
8 |
|
9 | <style>
|
10 | .highlight {
|
11 | background-color: #eee;
|
12 | padding-top: 0.2em;
|
13 | padding-bottom: 0.2em;
|
14 | padding-left: 1em;
|
15 | padding-right: 1em;
|
16 | }
|
17 | </style>
|
18 |
|
19 | A guide to everything in Oils (in progress).
|
20 |
|
21 | Go back to [All Docs on Oils](../index.html) for design docs and tutorials.
|
22 |
|
23 | <div id="toc">
|
24 | </div>
|
25 |
|
26 | ## Online HTML
|
27 |
|
28 | <div class="highlight">
|
29 |
|
30 | Oils has two major "modes" for shell:
|
31 |
|
32 | [**OSH Table of Contents**](toc-osh.html) - Compatible
|
33 |
|
34 | [**YSH Table of Contents**](toc-ysh.html) - New and Powerful
|
35 |
|
36 | You can use OSH by itself, YSH by itself, or upgrade OSH to YSH.
|
37 |
|
38 | </div>
|
39 |
|
40 | Those two docs link to dozens of **topics** within these 12 **chapters**:
|
41 |
|
42 | 1. [Front End](chap-front-end.html)
|
43 | 1. [Command Language](chap-cmd-lang.html)
|
44 | 1. [Word Language](chap-word-lang.html)
|
45 | 1. [OSH Assignment](chap-osh-assign.html)
|
46 | 1. [Mini Languages](chap-mini-lang.html)
|
47 | 1. [Builtin Commands](chap-builtin-cmd.html)
|
48 | 1. [Global Shell Options](chap-option.html)
|
49 | 1. [Special Variables](chap-special-var.html)
|
50 | 1. [Plugins and Hooks](chap-plugin.html)
|
51 | 1. [YSH Expression Language](chap-expr-lang.html)
|
52 | 1. [YSH Types and Methods](chap-type-method.html)
|
53 | 1. [Builtin Functions](chap-builtin-func.html)
|
54 |
|
55 | <div class="highlight">
|
56 |
|
57 | [**Data Notation Table of Contents**](toc-data.html) - Languages for data are
|
58 | complementary to shell programs.
|
59 |
|
60 | </div>
|
61 |
|
62 | Topics in these 3 chapters:
|
63 |
|
64 | 13. [JSON / J8 Notation](chap-j8.html)
|
65 | 1. Packle (TODO)
|
66 | 1. [Errors](chap-errors.html)
|
67 |
|
68 | ## `help` builtin command
|
69 |
|
70 | When you type `help` in OSH or YSH, the command shows some of this material,
|
71 | and prints hyperlinks to it.
|
72 |
|
73 | ## More About This Reference
|
74 |
|
75 | ### Terminology
|
76 |
|
77 | There are 3 levels in this tree of docs, which underlies the `help` builtin:
|
78 |
|
79 | 1. *Chapter* - An HTML doc that's part of the reference. May apply to OSH, YSH
|
80 | or both.
|
81 | 1. *Section* - An `<h2>` heading in a chapter
|
82 | 1. *Topic* - An `<h3>` heading in a chapter.
|
83 | - It has text with a **globally unique** name like `doc-comment`.
|
84 | - May apply to OSH, YSH or both.
|
85 |
|
86 | More terminology:
|
87 |
|
88 | - *Table of Contents* - a doc that links to topics, within chapters.
|
89 | - *Card* - Topics maybe be exported as `help` builtin "cards", either as inline
|
90 | text, or a URL to online HTML. A card may also have a URL to POSIX or bash
|
91 | docs.
|
92 |
|
93 | ### Directory Structures
|
94 |
|
95 | The source code is simply a tree of Markdown files:
|
96 |
|
97 | doc/
|
98 | release-index.md # /release/$VERSION/
|
99 |
|
100 | index.md # All Docs on Oils, /release/$VERSION/doc/
|
101 | getting-started.md
|
102 | ...
|
103 |
|
104 | ref/
|
105 | index.md # this page, the Oils Reference
|
106 | toc-osh.md # link to OSH topics
|
107 | toc-ysh.md # link to YSH topics
|
108 | toc-data.md
|
109 |
|
110 | chap-cmd-lang.md # chapter on the command language
|
111 | ...
|
112 |
|
113 |
|
114 | And the URLs basically mirror the source code:
|
115 |
|
116 | /release/$VERSION/
|
117 | index.html
|
118 | doc/
|
119 | index.html
|
120 | getting-started.html
|
121 | ...
|
122 |
|
123 | ref/
|
124 | index.html
|
125 | toc-osh.html
|
126 | toc-ysh.html
|
127 | toc-data.html
|
128 |
|
129 | chap-cmd-lang.html
|
130 | ...
|
131 |
|
132 | You can link to topics with internal anchors:
|
133 |
|
134 | - [chap-option.html#parse_at](chap-option.html#parse_at)
|
135 | - [chap-builtin-cmd.html#compgen](chap-builtin-cmd.html#compgen)
|