Coder Social home page Coder Social logo

nix-community / docnix Goto Github PK

View Code? Open in Web Editor NEW
25.0 3.0 0.0 1.45 MB

nix-community reference documentation (until officially released) [maintainer=@hsjobeki]

Home Page: https://nix-community.github.io/docnix/

Nix 36.23% JavaScript 16.68% TypeScript 0.71% MDX 8.19% Rust 38.19%
documentation nix nixos nixpkgs references toolset

docnix's Introduction

Docnix

Finally, complete autogenerated documentation for the whole nix-ecosystem.

๐Ÿšง๐Ÿšง๐Ÿšง Under Construction ๐Ÿšง๐Ÿšง๐Ÿšง

Content

Autogenerated documentation from source code including

  • lib.*
  • pkgs.*
    • pkgs.stdenv.*
  • builtins.*

How it works

  1. Preparation

For this to work properly we need doc-comments in format according to RFC-145. Since nixpkgs is not entirely written in this format we use our package codemod to automatically migrate all comments.

Nixpkgs -> Nixpkgs'

  1. Data extraction

The next step is calling our custom builtins unsafeGetAttrDoc and unsafeGetLambdaDoc to retrieve the documentation for all functions in the nixpkgs expression tree.

Nixpkgs' -> json

  1. Data separation / aggregation

Data is scanned, and additional information from positions, partially applied aliases, etc. is collected and dumped into separate markdown files. Every markdown file also includes a short yaml header needed by the rendering framework.

It contains information about the navigation, tags, headlines and other meta information.

Json -> Markdown

  1. Rendering

We then utilize a simple javascript rendering framework to transform all the scraped data into separate markdown / html pages.

A search index and sitemap.xml is built for page search as well as for external search engines like Google.

Markdown -> Static html

Et voila ๐Ÿฅณ

Contributing / Remaining work

All contributions are welcome! โค๏ธ

  • We still need the RFC-145 to be accepted. ๐Ÿ‘
  • review all the nixpkgs doc-comments changes. ๐Ÿ‘€
    • This draft PR#262987 should be split into multiple PRs, reviewed manually and merged. ๐Ÿ”ช
  • Change the current nixpkgs manual rendering as it will break when using plain markdown in nixpkgs comments. ๐Ÿ˜ฑ
  • Clarify rendering rules / best practices โ˜๏ธ
    • for aliased functions.
    • for builtins
  • Writing more doc-comments โŒจ โœ๏ธ
    • lib. types and options are almost completely undocumented
    • pkgs.stdenv is missing some documented functions

docnix's People

Contributors

adisbladis avatar hsjobeki avatar olafklingt avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docnix's Issues

Some functions missing from the list

I'm missing some functions like pkgs.buildEnv or pkgs.dockerTools.buildLayeredImage. Noogle is missing those as well. Maybe the logic for finding functions needs to be improved?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

  • Update all dependencies (@astrojs/starlight, actions/deploy-pages, actions/upload-pages-artifact, astro, cachix/cachix-action, cachix/install-nix-action, expect-test, pagefind, regex, rowan, textwrap, walkdir)
  • Lock file maintenance

Detected dependencies

cargo
codemod/Cargo.toml
  • regex 1.9.5
  • rnix 0.11.0
  • rowan *
  • textwrap 0.16.0
  • walkdir 2.4.0
  • expect-test 1.4.0
github-actions
.github/workflows/deploy.yml
  • actions/checkout v4
  • cachix/install-nix-action v23
  • cachix/cachix-action v12
  • actions/upload-pages-artifact v2
  • actions/deploy-pages v2
nix
flake.nix
  • nixpkgs nixpkgs-unstable
npm
packages/static-docs/package.json
  • @astrojs/starlight ^0.12.0
  • astro ^3.0.6
  • pagefind ^1.0.3

  • Check this box to trigger a request for Renovate to run again on this repository

Link to code definition

Hi, I stumbled across the reference page the other day and am quite impressed.

With the best documentation it can be quite helpful to read code, and especially helpful if the documentation is not as good. I'm wondering if it would be possible to link back to the code definitions?

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.