Commit Graph

19 Commits

Author SHA1 Message Date
Andrew Kelley
6082c14753 generated docs: add optional type support 2019-10-10 20:32:17 -04:00
Andrew Kelley
78d06ec4af Merge branch 'docs-union-enum' of https://github.com/Vexu/zig into Vexu-docs-union-enum 2019-10-10 13:36:37 -04:00
Timon Kruiper
e34e3344d4 Generated docs: Add function paramater names 2019-10-10 15:23:24 +02:00
Timon Kruiper
4250d27fe5 Generated docs: store static container info in a containerDecl astNode
And then get the struct field astNodes through the containerDecl astNode.
The type of a struct field is still stored in the types array, but the
static information is in the astNodes.
2019-10-10 14:21:35 +02:00
Vexu
2b55484f3f implement doc generation for union and enum 2019-10-10 10:27:12 +03:00
Andrew Kelley
000a1df4a3 generated docs: add array type support
See #3404
2019-10-09 18:22:46 -04:00
Andrew Kelley
e0ab685467 generated docs: more verbose fields
also prevent docs making hyperlinks for integer types
2019-10-09 16:31:20 -04:00
Andrew Kelley
e0f0e2aace generated docs: error sets in fn docs 2019-10-08 18:09:08 -04:00
Timon Kruiper
f74c29b49a Add initial support for struct fields in the docs 2019-10-08 17:29:03 -04:00
Andrew Kelley
784a493dc7 generated docs: functions with inferred error sets display nicely
infrastructure in place for displaying error sets
2019-10-08 13:41:13 -04:00
Andrew Kelley
03a6b33a73 generated docs: bool type and fix error for some fns 2019-10-08 11:59:55 -04:00
Andrew Kelley
6814d6b332 generated docs: function parameters have links 2019-10-08 11:52:06 -04:00
Andrew Kelley
a55db08a7b generated docs contain generic instantiations and comptime calls 2019-10-08 00:15:16 -04:00
Andrew Kelley
2ccb48ddc3 generated docs: show doc comments on functions 2019-10-07 12:21:11 -04:00
Andrew Kelley
0e40fc46d1 generated docs: show public stuff only 2019-10-05 16:38:42 -04:00
Andrew Kelley
dca6e74fec proof of concept of stage1 doc generation
This commit adds `-fgenerate-docs` CLI option, and it outputs:
 * doc/index.html
 * doc/data.js
 * doc/main.js

In this strategy, we have 1 static html page and 1 static javascript
file, which loads the semantic analysis dump directly and renders it
using dom manipulation.

Currently, all it does is list the declarations. But there is a lot more
data available to work with. The next step would be making the
declarations hyperlinks, and handling page navigation.

Another strategy would be to generate a static site with no javascript,
based on the semantic analysis dump that zig now provides. I invite the
Zig community to take on such a project. However this version which
heavily relies on javascript will also be a direction explored.

I also welcome contributors to improve the html, css, and javascript of
what this commit started, as well as whatever improvements are necessary
to the static analysis dumping code to provide more information.

See #21.
2019-10-04 20:18:06 -04:00
Michael Dusan
81c6bd37aa stage1: fix compile error on macOS Xcode 11.1 2019-10-04 01:33:31 -04:00
Andrew Kelley
39d47b2c51 handle when std lib is unused 2019-10-03 18:05:44 -04:00
Andrew Kelley
59ac7b91da add -fdump-analysis to dump type information to json
This commit adds -fdump-analysis which creates
a `$NAME-analysis.json` file with all of the finished
semantic analysis that the stage1 compiler produced.
It contains types, packages, declarations, and files.

This is an initial implementation; some data will be
missing. However it's easy to improve the implementation,
which is in `src/dump_analysis.cpp`.

The next step for #21 will be to create Zig code which parses
this json file and creates user-facing HTML documentation.

This feature has other uses, however; for example, it could
be used for IDE integration features until the self-hosted
compiler is available.
2019-10-03 17:58:22 -04:00