Coder Social home page Coder Social logo

autodoc's Introduction

Zig Documentation Generator

Creates an interactive, searchable, static web application for presenting Zig package documentation.

Status

Nearly reached feature parity with previous implementation.

Will be upstreamed soon

See the roadmap below.

Development

While Firefox and Safari support are obviously required, I recommend Chromium for development for one reason in particular:

C/C++ DevTools Support (DWARF)

This makes debugging Zig WebAssembly code a breeze.

After making changes to src/ or lib/:

zig build

Use whatever local static file server you want to host the files:

cd zig-out
python -m http.server

Finally, create the tarball to serve as the input file, name it sources.tar, and put it also into zig-out/. The system expects the top level of the tarball to be the set of modules documented. So for the Zig standard library you would do this: tar cf std.tar std/. Don't compress it; the idea is to rely on HTTP compression.

I also suggest to omit test fixtures and test files. In other words, use the set of files that zig installs to zig-out when you run zig build, which is the same as the set of files that are provided on ziglang.org/download.

If the system doesn't find a file named "foo/root.zig" or "foo/foo.zig" it's going to use the first file in the tar as the module root, which is probably not what you want.

Pre-Merge Roadmap

  • implement view: functions that return types that end with return struct
  • add source view links, currently you have to use the keyboard shortcut

Post-Merge Roadmap

  • redundant search results (search "format")
  • in query_exec_fallible, sorting should also check the local namespace inside the file
  • walk assign_destructure not implemented yet
  • escape URLs when rendering html (look for missing_feature_url_escape)
  • implement renderHome for multiple modules
  • struct fields: render each component separate rather than via source rendering
  • infer comptime_int constants (example: members of #std.time)
  • when global const has a type of type, categorize it as a type despite its value
    • example: std.DynLib (requires patching to add type annotation)
  • show abbreviated doc comments in types and namespaces listings
  • show type function names as e.g. ArrayList(T)
  • enum fields should not be linkified (example: std.log.Level)
  • shrink Ast to fit the slices
  • linkification of methods (example: std.array_hash_map.ArrayHashMap.count)
  • navigating to source from a decl should scroll to the decl
  • in source view, make @imports into links, but keep same syntax highlighting
  • include struct field names and doc comments in search query matching
  • include function parameter names and doc comments in search query matching
  • instead of logging "can't index foo because it has syntax errors" put it in the UI
  • in Walk.expr() it is missing support for asm_input/asm_output nodes
  • in renderNamespace, handle an aliasing loop
  • add a history item when clicking a search result (it already works when keyboard triggered)
  • instead of "declaration not found", show the decl that can't be penetrated (example: #std.os.system.fd_t)

autodoc's People

Contributors

andrewrk avatar ianprime0509 avatar der-teufel-programming avatar arrufat avatar rexicon226 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.