Skip to content

Redesign How Autodoc Works #19208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
94daf87
no
andrewrk Feb 28, 2024
356e653
better to use AST than ZIR for doc generation
andrewrk Feb 28, 2024
0b1b3f0
upstream new autodocs implementation
andrewrk Mar 6, 2024
33f3443
add `zig std` subcommand
andrewrk Mar 6, 2024
34faf9d
add skeleton of `zig std` command impl
andrewrk Mar 6, 2024
c7c7ad1
zig std: implement serving the wasm binary
andrewrk Mar 7, 2024
574b33e
zig std: use threads for the http server
andrewrk Mar 7, 2024
b7ba0b6
std.io.Writer: add writeFile method
andrewrk Mar 7, 2024
c427685
zig std: implement sources.tar endpoint
andrewrk Mar 7, 2024
6b84c8e
zig std: implement tar format
andrewrk Mar 7, 2024
ed8ee3d
slightly better error name when wasm compilation fails
andrewrk Mar 7, 2024
9126045
frontend: skeleton for creating autodocs
andrewrk Mar 7, 2024
ffd53a4
-femit-docs: creating sources.tar
andrewrk Mar 7, 2024
3efdfe6
std.Thread.WaitGroup: add spawnManaged
andrewrk Mar 7, 2024
261094c
-femit-docs: create main.wasm artifact
andrewrk Mar 7, 2024
8dcc35e
build: don't include std lib docs by default
andrewrk Mar 7, 2024
8b70e4f
autodocs: fix root name and missing dir close
andrewrk Mar 7, 2024
c2e978f
build: spend a lot less time generating std docs
andrewrk Mar 7, 2024
60f1fe5
remove the autodoc issue template
andrewrk Mar 7, 2024
c19657d
cmake: remove -Dno-autodocs
andrewrk Mar 7, 2024
4f1e5f7
autodoc has a new code owner. it's me
andrewrk Mar 7, 2024
6b8c754
fix 32 bit compilation
andrewrk Mar 7, 2024
b13a55d
update autodocs web application to latest
andrewrk Mar 11, 2024
aa852f7
improve documentation in std
andrewrk Mar 11, 2024
1397341
add missing field to module creation
andrewrk Mar 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Autodoc
/src/Autodoc.zig @kristoff-it
/src/autodoc/* @kristoff-it
/lib/docs/* @kristoff-it

# std.json
/lib/std/json* @thejoshwolfe

Expand Down
12 changes: 0 additions & 12 deletions .github/ISSUE_TEMPLATE/autodoc-issue.md

This file was deleted.

3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,6 @@ else()
endif()

# -Dno-langref is currently hardcoded because building the langref takes too damn long
# -Dno-autodocs is currently hardcoded because the C backend generates a miscompilation
# that prevents it from working.
# To obtain these two forms of documentation, run zig build against stage3 rather than stage2.
set(ZIG_BUILD_ARGS
--zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
Expand All @@ -918,7 +916,6 @@ set(ZIG_BUILD_ARGS
${ZIG_STATIC_ARG}
${ZIG_NO_LIB_ARG}
"-Dno-langref"
"-Dno-autodocs"
${ZIG_SINGLE_THREADED_ARG}
${ZIG_PIE_ARG}
"-Dtarget=${ZIG_TARGET_TRIPLE}"
Expand Down
8 changes: 5 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn build(b: *std.Build) !void {
const test_step = b.step("test", "Run all the tests");
const skip_install_lib_files = b.option(bool, "no-lib", "skip copying of lib/ files and langref to installation prefix. Useful for development") orelse false;
const skip_install_langref = b.option(bool, "no-langref", "skip copying of langref to the installation prefix") orelse skip_install_lib_files;
const skip_install_autodocs = b.option(bool, "no-autodocs", "skip copying of standard library autodocs to the installation prefix") orelse skip_install_lib_files;
const std_docs = b.option(bool, "std-docs", "include standard library autodocs") orelse false;
const no_bin = b.option(bool, "no-bin", "skip emitting compiler binary") orelse false;

const docgen_exe = b.addExecutable(.{
Expand All @@ -55,17 +55,19 @@ pub fn build(b: *std.Build) !void {
b.getInstallStep().dependOn(&install_langref.step);
}

const autodoc_test = b.addTest(.{
const autodoc_test = b.addObject(.{
.name = "std",
.root_source_file = .{ .path = "lib/std/std.zig" },
.target = target,
.zig_lib_dir = .{ .path = "lib" },
.optimize = .Debug,
});
const install_std_docs = b.addInstallDirectory(.{
.source_dir = autodoc_test.getEmittedDocs(),
.install_dir = .prefix,
.install_subdir = "doc/std",
});
if (!skip_install_autodocs) {
if (std_docs) {
b.getInstallStep().dependOn(&install_std_docs.step);
}

Expand Down
Loading