Skip to content

autodoc: std.crypto.core.aes documentation is hard to reach #22312

Open
@sorairolake

Description

@sorairolake

Zig Version

0.14.0-dev.2563+af5e73172

Steps to Reproduce and Observed Behavior

First, open the link to std.crypto.core.aes:

std.crypto.core.aes

Next, open the link to std.crypto.core.aes.AesEncryptCtx:

std.crypto.core.aes.AesEncryptCtx

Next, open the link to impl.AesEncryptCtx:

impl.AesEncryptCtx

I thought I would be able to view the documentation for this type function, but in fact, the result returned was "Declaration not found" as shown in the image above.

Search for AesEncryptCtx to find documentation for backend type functions:

search results for AesEncryptCtx

Documentation for std.crypto.aes.aesni.AesEncryptCtx:

std.crypto.aes.aesni.AesEncryptCtx

I think it's inconvenient that we can't find this document without searching. I think this issue occurs when using different backends depending on the conditions (CPU architecture, etc.), just like with std.crypto.core.aes.

Expected Behavior

We can view the documentation by opening the link to std.crypto.core.aes.AesEncryptCtx or impl.AesEncryptCtx.

It might be good to be able to open the documentation in aes/aesni.zig when builtin.cpu.arch == .x86_64 and builtin.zig_backend != .stage2_c and has_aesni and has_avx is true in the environment where the documentation was built.

const impl = if (builtin.cpu.arch == .x86_64 and builtin.zig_backend != .stage2_c and has_aesni and has_avx) impl: {
break :impl @import("aes/aesni.zig");
} else if (builtin.cpu.arch == .aarch64 and builtin.zig_backend != .stage2_c and has_armaes)
impl: {
break :impl @import("aes/armcrypto.zig");
} else impl: {
break :impl @import("aes/soft.zig");
};

The above is just an example, there may be a better way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    autodocThe web application for interactive documentation and generation of its assets.enhancementSolving this issue will likely involve adding new logic or components to the codebase.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions