Commit Graph

276 Commits

Author SHA1 Message Date
Andrew Kelley
0b1b3f0225 upstream new autodocs implementation 2024-03-10 17:51:06 -07:00
Andrew Kelley
94daf87335 no 2024-03-10 17:50:54 -07:00
Michael Scott
e5dc9b1d09 Update styles in std docs to correct display glitch 2024-01-12 16:25:55 -08:00
Krzysztof Wolicki
1880c799ae
autodoc: Some support for field_call (#16853)
* autodoc: Some support for field_call

* autodoc: Change handling of field_call to respect tryResolveRefPath, add fieldVal to Expr

* autodoc: Fixed errors

* autodoc: sync with latest master changes

---------

Co-authored-by: Loris Cro <kappaloris@gmail.com>
2023-10-30 21:04:49 +00:00
Krzysztof Wolicki
606f0e496e
autodoc: Display type kinds for containers (#17667) 2023-10-22 16:15:00 +02:00
Krzysztof Wolicki
4d1e8ef1eb
autodoc: Add hidden class to [src] link when starting renderApi to only show it for functions (#17322) 2023-10-04 18:42:49 +02:00
Krzysztof Wolicki
9c3165b81b
autodoc: Add handling for array_cat, array_mul, struct_init_empty_result. (#17367)
Fix issue with getting docs for src-less types in main.js
2023-10-04 18:25:00 +02:00
Jay Petacat
731fd217db Add embedded SVG favicon to reference doc templates
The SVG looks way better than the pixelated PNG and will adapt best to
whatever screen it is being displayed on. The PNG continues to be used
because Apple Safari does not support SVG favicons yet. All other major
browsers do. See https://caniuse.com/link-icon-svg.

This is a companion PR to ziglang/www.ziglang.org#310.
2023-09-25 12:24:06 +03:00
Loris Cro
78ebf8f577 autodoc: give explicit width to logo
fix #17251
2023-09-24 01:17:06 +02:00
Loris Cro
c481510c99 autodoc: show more doc comments for namespaces and types
previously, in the container view (the type of view that you see when
you look at `std` for example), when listing types and namespaces, we
would only show doc comments places on the direct child decl, which in
the case of the `std` namespace, for example, it's just a bunch of
re-exports.

now, if we don't find a direct doc comment, we chase indirection and
display doc comments placed directly on the definition, if any.

this is the precise priority order:

```
/// 1
pub const Foo = _Foo;

/// 2
const _Foo = struct {
   //! 3
};
```
The numbers show the priority order for autodoc.
2023-09-20 19:17:00 +02:00
Loris Cro
c1e94b28a3 autodoc: split json payload per field
this will make s3 re-enable compression for the stdlib's autodoc
and improve loading times (and data usage) for users

alongside this commit the deploy script for the official website is also
being updated
2023-09-17 18:23:21 +02:00
Loris Cro
33f3a4d840 autodoc: rename the doctest section in the frontend to 'Usage Examples' 2023-09-17 18:23:21 +02:00
Krzysztof Wolicki
2651363c9d
autodoc: Implement various missing expressions in ex (#17129)
Co-authored-by: Loris Cro <kappaloris@gmail.com>
2023-09-16 17:38:06 +02:00
Krzysztof Wolicki
f2026e7dd6 autodoc: Implement builtin function rendering.
Implement unary ops handling.
Fix getType in main.js
Minor cleanup of builtin function handling.
2023-09-16 17:35:11 +02:00
Krzysztof Wolicki
9a326b22d5 autodoc: Fix styling of the navbar 2023-09-16 17:31:43 +02:00
Krzysztof Wolicki
da28379d6c autodoc: Remove unnecessary Expr tag 2023-09-16 17:30:49 +02:00
Krzysztof Wolicki
8a9aa9e112 autodoc: Handle ref ZIR instruction 2023-09-16 17:30:49 +02:00
Ian Johnson
d2014fe971 Autodoc: simplify search text on mobile
This prevents the placeholder text from spilling out of the search bar
on smaller screens.
2023-09-09 19:48:18 +02:00
Ian Johnson
51d7700c8c Autodoc: tweak page layout
Closes #17011
Closes #17012

This commit allows the logo to scale more freely to fit its container,
and removes some extra margins so that the content scroll bar is flush
with the right side of the viewport.
2023-09-09 19:48:18 +02:00
Ian Johnson
2f26b15995 Autodoc: fix search results navigation
Closes #17013
2023-09-09 19:47:57 +02:00
Loris Cro
fda087ed81 autodoc: style links in source code 2023-09-04 18:56:45 +02:00
Krzysztof Wolicki
5cc1831ca4
autodoc: Fix rendering of enum types (#17058) 2023-09-03 18:34:29 +02:00
Loris Cro
e5c72a32a7 autodoc: fix rendering of std.json.ObjectMap
closes #17014
supersedes #17022
follow up issue #17061
2023-09-03 18:32:26 +02:00
Krzysztof Wolicki
555028086a
autodoc: Implement @call, @unionInit, @mulAdd support (#16918)
* autodoc: Implement `@call`, `@unionInit`, `@mulAdd` support

* autodoc: Implement builtinIndex in ex
2023-09-03 17:20:23 +02:00
Krzysztof Wolicki
86a9e1deaf
autodoc: Implement @bitSizeOf rendering in main.js (#16895) 2023-09-03 17:18:51 +02:00
Krzysztof Wolicki
80c1d48ccb
autodoc: Implement a[b], a.?, and a.* (#16863)
* autodoc: Implement elem_val_node and basic optional_payload_*

* autodoc: Add `.*` loads
2023-09-03 17:18:16 +02:00
Loris Cro
0516a4d629 autodoc: fix typo 2023-09-03 17:15:15 +02:00
Loris Cro
c0da41582b autodoc: better light mode colors
fix #15799
2023-09-03 17:12:52 +02:00
James Chen-Smith
c3a8f1fe92
autodoc: Extract decl ref style and fix light mode color (#15990)
Co-authored-by: James Chen-Smith <james@chen-smith.net>
Co-authored-by: Loris Cro <kappaloris@gmail.com>
2023-09-03 16:51:07 +02:00
Loris Cro
373e48c983
autodoc: new layout (#16715)
* autodoc: init guide TOC work

* autodoc: working guides toc navigation

* autodoc: more improvements

* autodoc: ui refinements

* autodoc: new layout and init descriptions for namespaces in std.zig
2023-08-06 18:12:05 +02:00
Krzysztof Wolicki
b317ca4d6f autodoc: Added line_comment tokens to ziglexer.js tokenizer 2023-08-03 19:07:33 +02:00
Loris Cro
f5239677e2 autodoc: implement typeof support in new rendering system 2023-07-29 19:07:23 +02:00
Loris Cro
e682d6eb29 autodoc: improve styling of new help dropdown 2023-07-28 17:00:07 +02:00
Loris Cro
feff968ec3 autodoc: html page fixes 2023-07-25 19:29:23 +02:00
Loris Cro
4f5082fc86 autodoc: improve handling of periods in search box and add search explainer 2023-07-25 19:19:39 +02:00
Krzysztof Wolicki
4bc90f17bb
autodoc: Fix an issue with aliased functions (#16421) 2023-07-22 16:36:26 +02:00
zooster
996eb01746
collconv -> callconv (#16453) 2023-07-20 00:40:47 +00:00
Loris Cro
7dd1cf26f9 autodoc: improved linking for declrefs 2023-07-14 19:11:55 +02:00
Loris Cro
a187141056
Autodoc tokenizer (#16409)
* autodoc: init work to refactor exprName

* autodoc: Implement more expressions in exprName refactor

* autodoc: more work

* autodoc: More exprName to ex refactoring

* autodoc: Remove whitespace flag from renderer; Add pre tags in
value and variable drawing in renderContainer

* autodoc: add inline styling to pre blocks

* autodoc: move renderer code to main.js

* autodoc: More exprName to ex refactoring; Fn signatures rendered with new code

* autodoc: Fix function rendering. Add more things to ex

* autodoc: nuke exprName

---------

Co-authored-by: Krzysztof Wolicki <der.teufel.mail@gmail.com>
2023-07-14 16:27:09 +02:00
Ian Johnson
91daf1c8d8 Autodoc: implement boolean operations 2023-07-06 17:28:11 +02:00
Emile Badenhorst
8ce68e5f41 changed identifier to white 2023-07-06 16:44:42 +02:00
Emile Badenhorst
2d34b76e72 Fixed names prefix 2023-07-06 16:44:42 +02:00
Emile Badenhorst
e5b2f52213 updated css 2023-07-06 16:44:42 +02:00
Ian Johnson
d3eaa75c07 autodoc: use commonmark.js for Markdown rendering 2023-07-04 17:08:46 +02:00
Loris Cro
28ad74e8a6 autodoc: wire in js tokenizer to frontend 2023-07-03 19:18:44 +02:00
Emile Badenhorst
116a99d3ce
Autodoc: Javascript port of zig lexer. (#16306)
* Most of the js lexer ported

* Fixed lexical Ranges

* Mini test framework

* More testing and bug fixing in zig js lexer

* Removed bad import

* Implemented good html generation

Closes #15863
2023-07-03 17:47:08 +02:00
Loris Cro
97a1b046ea autodoc: fix scoring bug when matching full decl name 2023-07-01 17:38:18 +02:00
Emile Badenhorst
35a8e8a06c
Fixed Autodoc rendering of @truncate builtin (#16263)
* fixed autodoc rendering of @trucate builtin

* Changed to LHS for typeRef

* autodoc: fix typeref for `truncate`

---------

Co-authored-by: Loris Cro <kappaloris@gmail.com>
2023-07-01 16:43:17 +02:00
Ian Johnson
4dacaa1e12 Autodoc: add preference for / search
Closes #16081
2023-06-28 18:16:16 +02:00
Krzysztof Wolicki
5804f3f757 autodoc: walkResultTypeRef returns Zig's undefined instead of 0th type 2023-06-27 19:07:39 +02:00