Skip to content

Commit 16d5ef0

Browse files
committed
Docs: correct problems.
1 parent e7ae18a commit 16d5ef0

File tree

1 file changed

+54
-14
lines changed

1 file changed

+54
-14
lines changed

docs/design.md

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,20 @@ These form a set of high-level requirements to guide the project.
2626
<a id="vision-code-blocks-and-doc-blocks"></a>[code blocks and doc blocks](index.md#code-blocks-and-doc-blocks).
2727
Doc blocks are lines of source which contain only correctly-formatted
2828
comments.
29-
3029
* Provide support for a
3130
<a id="vision-programming-language-support"></a>[wide variety of programming languages](index.md#programming-language-support).
32-
3331
* Provide integration with a
3432
<a id="vision-ide-integration"></a>[wide variety of IDEs/text editors](index.md#ide-integration).
35-
3633
* Load a document from source code, allow edits in a GUI, then save it back to
3734
source code.
38-
3935
* Provide word processor GUI tools (insert hyperlink, images, headings, change
4036
font, etc.) for doc blocks.
4137
* Provide text editor/IDE tools (syntax highlighting, line numbers, show
4238
linter feedback) for code blocks.
4339
* Zero build: eliminate the traditional project build process -- make it almost
4440
instantaneous.
45-
4641
* Doc block markup should be readable and well-known: markdown.
47-
4842
* Support both a single-file mode and a project mode.
49-
5043
* A project is a specific directory tree, identified by the presence of a TOC.
5144
A TOC is just a plain Markdown file with a specific name. A better term: not
5245
a TOC, but a navigation pane, since the TOC can contain anything (see
@@ -59,17 +52,20 @@ These form a set of high-level requirements to guide the project.
5952
* <a id="authoring-support"></a>Provide
6053
[authoring support](index.md#authoring-support), which allows authors to
6154
easily create book/project-like features. In particular:
62-
6355
* Counters for numbering figures, tables, equations, etc. All counters are
6456
page-local (no global counters).
57+
6558
* Auto-titled links: the link text is automatically derived from the link's
6659
destination (the heading text at the link's destination; a figure/table
6760
caption, etc.).
61+
6862
* Auto-generated back links: anchors support auto-generated links back to all
6963
their referents, which can be used for footnotes, endnotes, citations, and
7064
indices. To enable this, all forward links must include an anchor and
7165
optionally the text to display at the target.
66+
7267
* TOC support which:
68+
7369
* Given some file(s), expands to a nested list of headings in the file(s).
7470
Authors may specify the depth of headings to include.
7571
* Show the filesystem, optionally not including files that are linked in th
@@ -82,42 +78,53 @@ These form a set of high-level requirements to guide the project.
8278
the currently viewed file, and tracks headings within the current file.
8379
* A gathering element: given an anchor, it shows the context of all hyperlinks
8480
to this anchor.
81+
8582
* If the hyperlink is a heading, the context extends to the next same-level
8683
heading;
8784
* If the hyperlink is a start of context, the context ends at the end of
8885
context or end of file, whichever comes first.
8986
* Otherwise, the context extends to the following code block.
9087
* A report view: an extended gathering element that operates more like a
9188
query, producing nested, hierarchical results from the codebase.
89+
9290
* Headings can be collapsed, which code code and doc blocks until the next
9391
same-level heading.
92+
9493
* A sequencing/path element: given a starting hyperlink, it produces prev/next
9594
icons to show a startup/shutdown sequence, etc.
95+
9696
* A graph view: shows the entire document as a directed graph of hyperlinks.
97+
9798
* An inlined output mode, like Jupyter: includes graphs and console output
9899
produced by executing the code.
100+
99101
* Graphical code views:
102+
100103
* Present a case statement as a state machine.
101104
* Present if/else statements as a truth table.
102105
* Visualize data structures.
103106
* More?
104107
* Interactive learning support: multiple choice, fill-in-th-blank, short/long
105108
answer, coding problem, etc. from Runestone or similar.
109+
106110
* Autogenerated anchors for all anchors (headings, hyperlinks, etc.)
111+
107112
* Hyperlinks to identifiers in code (use
108113
[ctags](https://github.com/universal-ctags/ctags)); perhaps auto-generate
109114
headings for these identifiers?
115+
110116
* An API view; show only parts of the code that's
111117
exported/publicly-accessible.
118+
112119
* Substitutions.
120+
113121
* Files/anchors can be freely moved without breaking links. This requires all
114122
anchors to be globally unique. HTML allows upper/lowercase ASCII plus the
115123
hyphen and underscore for IDs, meaning that a 5-character string provides
116124

117125
> 250 million unique anchors.
118126
* Make picking a file/anchor easy: provide a searchable, expanded TOC listing
119127
every anchor.
120-
121128
* Provide edit and view options. (Rely on an IDE to edit raw source.)
122129

123130
### Nice to have features
@@ -153,17 +160,50 @@ whitespace and optionally succeeded by whitespace. At least one whitespace
153160
character must separate the opening comment delimiter from the doc block text.
154161
Some examples in C:
155162

156-
<pre>void foo(); // This is not a doc block, because these comments are preceded<br>void bar(); // by non-whitespace characters. Instead, they're a code block.<br>//This is not a doc block, because these inline comments lack<br>//whitespace after the opening comment delimiter //. They're also a code block.<br>/*This is not a doc block, because this block comment lacks<br> whitespace after the opening comment delimiter /*. It's also a code block. */<br>/* This is not a doc block, because non-whitespace <br> characters follow the closing comment delimiter. <br> It's also a code block. */ void food();<br><br>// This is a doc block. It has no whitespace preceding the inline<br>// comment delimiters and one character of whitespace following it.<br> // This is also a doc block. It has two characters of whitespace <br> // preceding the comment delimiters and one character of whitespace following it.<br>/* This is a doc block. Because it's based on<br> a block comment, a single comment can span multiple lines. */<br>/* This is also a doc block, even without the visual alignment<br>or a whitespace before the closing comment delimiter.*/<br> /* This is a doc block<br> as well. */</pre>
163+
```c
164+
void foo(); // This is not a doc block, because these comments are preceded
165+
void bar(); // by non-whitespace characters. Instead, they're a code block.
166+
//This is not a doc block, because these inline comments lack
167+
//whitespace after the opening comment delimiter //. They're also a code block.
168+
/*This is not a doc block, because this block comment lacks
169+
whitespace after the opening comment delimiter /*. It's also a code block. */
170+
/* This is not a doc block, because non-whitespace
171+
characters follow the closing comment delimiter.
172+
It's also a code block. */ void food();
173+
174+
// This is a doc block. It has no whitespace preceding the inline
175+
// comment delimiters and one character of whitespace following it.
176+
// This is also a doc block. It has two characters of whitespace
177+
// preceding the comment delimiters and one character of whitespace following it.
178+
/* This is a doc block. Because it's based on
179+
a block comment, a single comment can span multiple lines. */
180+
/* This is also a doc block, even without the visual alignment
181+
or a whitespace before the closing comment delimiter.*/
182+
/* This is a doc block
183+
as well. */
184+
```
157185

158186
Doc blocks are differentiated by their indent: the whitespace characters
159187
preceding the opening comment delimiter. Adjacent doc blocks with identical
160188
indents are combined into a single, larger doc block.
161189

162-
<pre>// This is all one doc block, since only the preceding<br>// whitespace (there is none) matters, not the amount of <br>// whitespace following the opening comment delimiters.<br> // This is the beginning of a different doc<br> // block, since the indent is different.<br> // Here's a third doc block; inline and block comments<br> /* combine as long as the whitespace preceding the comment<br>delimiters is identical. Whitespace inside the comment doesn't affect<br> the classification. */<br>// These are two separate doc blocks,<br>void foo();<br>// since they are separated by a code block.</pre>
163-
164-
### <a id="implementation-programming-language-support"></a>\[Programming language
190+
```c
191+
// This is all one doc block, since only the preceding
192+
// whitespace (there is none) matters, not the amount of
193+
// whitespace following the opening comment delimiters.
194+
// This is the beginning of a different doc
195+
// block, since the indent is different.
196+
// Here's a third doc block; inline and block comments
197+
/* combine as long as the whitespace preceding the comment
198+
delimiters is identical. Whitespace inside the comment doesn't affect
199+
the classification. */
200+
// These are two separate doc blocks,
201+
void foo();
202+
// since they are separated by a code block.
203+
```
204+
205+
### <a id="implementation-programming-language-support"></a>\[Programming language support\](index.md#programming-language-support)
165206

166-
support\](index.md#programming-language-support)
167207

168208
Initial targets come from the Stack Overflow Developer Survey 2022's section on
169209
[programming, scripting, and markup languages](https://survey.stackoverflow.co/2022/#section-most-popular-technologies-programming-scripting-and-markup-languages)

0 commit comments

Comments
 (0)