Commit Graph

69 Commits

Author SHA1 Message Date
Ian Johnson 75ccdcc356 Autodoc: report errors in user interface
Also includes panics by virtue of the previous commit, checking one item off #19249.
2025-02-15 17:32:44 -05:00
nobkd 4e8c436f69 autodoc: fix device width 2025-01-16 21:15:48 +01:00
Ryan Liptak ac2459327f autodoc: Preserve whitespace in inline code spans
Fixes #20754
2024-07-23 10:02:54 -07:00
expikr 7cf6650663 autodoc: fix misaligned table header when alignment is default (#20220) 2024-06-08 12:37:07 -07:00
Andrew Kelley b13a55db97 update autodocs web application to latest
upstream commit 1f921d540e1a8bb40839be30239019c820eb663d

after this branch is merged, ziglang/zig becomes the new repository for
this code.
2024-03-10 18:13:25 -07:00
Andrew Kelley 0b1b3f0225 upstream new autodocs implementation 2024-03-10 17:51:06 -07:00
Michael Scott e5dc9b1d09 Update styles in std docs to correct display glitch 2024-01-12 16:25:55 -08: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 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 9a326b22d5 autodoc: Fix styling of the navbar 2023-09-16 17:31:43 +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
Loris Cro fda087ed81 autodoc: style links in source code 2023-09-04 18:56:45 +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 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
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
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
Loris Cro 28ad74e8a6 autodoc: wire in js tokenizer to frontend 2023-07-03 19:18:44 +02:00
Ian Johnson 4dacaa1e12 Autodoc: add preference for / search
Closes #16081
2023-06-28 18:16:16 +02:00
Loris Cro 216ef10dc4 Merge branch 'master' into autodoc-searchkey 2023-06-18 09:06:40 +02:00
cryptocode 0fc1d39649 Add new shortcut to help popup 2023-05-03 12:10:52 +02:00
r00ster91 6f1336a50c autodoc: make the help modal toggleable
Now you can simply press "?" again to toggle the help modal instead of
requiring Esc. Both Esc and "?" work.
2023-05-02 04:41:25 +02:00
cryptocode 5d20a4e35c autodoc: Add / as an alternative search key
Per Discord discussion. Motivation: `/` is now the de facto standard for initating search on webpages.
2023-04-29 20:48:18 +02:00
Loris Cro b294bff1a8 Autodoc: new decl search system (#15475)
New search system is based on a Radix Tree. The Radix Tree contains a shallow list of all decl names (ie no paths), plus some suffixes, split by following the official style guide (eg "HashMapUnmanaged" also produces "MapUnmanaged" and "Unmanaged", same with snake_case and camelCase names).

Additionally, the search system uses the decl graph data to recognize hierarchical relationships between decls, allowing you to zero on a target namespace for search. As an example "fs create" will score highe all things related to the creation of files and directories inside of `std.fs`, while still showing (but with lower score) matches from `std.Bulild`. 

As another example "fs windows" will prioritize windows-related results in `std.fs`, while "windows fs" will prioritize fs-related results in `std.windows`.
2023-04-26 18:17:20 +02:00
Krzysztof Wolicki a260fa8bf2 autodoc: Change package to module to better reflect the new names 2023-04-23 01:02:09 +02:00
Loris Cro aa765c1d70 autodoc: add support for defining guide sections
For example:

//!zig-autodoc-section: Advanced Topics
2023-04-15 18:26:53 +02:00
Loris Cro af820bbb94 autodoc: init support for guides 2023-01-24 18:56:35 +01:00
Clement Espeute 66569c7ec6 autodoc: use js instead of details for collapsing descriptions 2023-01-12 13:38:26 +01:00
Loris Cro 0e66df2094 autodoc: scroll up when collapsing long fn description 2023-01-11 18:14:56 +01:00
Clement Espeute b63a771e18 autodoc: allow function descriptions expansion 2023-01-10 18:55:49 +01:00
Loris Cro 1878bdfbb1 autodoc: fix bodyless fn type analysis and rendering 2023-01-05 17:12:43 +01:00
Nguyễn Gia Phong c91adbbde7 autodoc: show binding in lowercase
<S-s> is not bound and shortcuts popup already use lowercase.
2023-01-03 15:11:44 +09:00
Loris Cro 201dca323e autodoc: improve rendering of long fn signatures 2022-09-05 17:26:59 +02:00
Loris Cro dbd60e3d29 autodoc: add support for doc tests 2022-09-04 22:45:57 +02:00
Loris Cro 102a6e9e9c Merge pull request #12481 from alichraghi/patch-1
docs: add padding between functions list
2022-08-23 15:48:35 +02:00
Ryan Liptak 9740bb2423 autodoc: Fix border color around field docs in light mode
Follow up to https://github.com/ziglang/zig/pull/12305
2022-08-19 19:06:01 -07:00
Ali Chraghi 51b2aa1643 docs: add padding between functions list 2022-08-18 22:02:02 +04:30
r00ster91 78bb29d1dc fix: scroll page to very top when S is pressed
Credits go to @rudedogg
2022-08-14 19:19:44 +02:00
r00ster91 9900413eb1 feat: indent keyboard shortcuts
This indents the keyboard shortcuts related to the S key because you can only
use these keyboard shortcuts after you pressed S (when the search field is focused).
This is a visual hint.
2022-08-14 11:54:51 +02:00
r00ster91 e1eaa1f7d6 fix: var(--mono) used for font-size 2022-08-14 11:54:51 +02:00
r00ster91 dc5174440c feat: better No Results Found page
This adds some helpful links to the page and makes it look nicer by using <kbd> etc.
2022-08-14 11:54:51 +02:00