Skip to content

doc: add contributing guide #1688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

awwpotato
Copy link
Contributor

as discussed (very briefly) in #1687

TODO:

  • Add redirects from old pages
  • Give headers custom names
  • Possible reword some things that don't make sense now that's it one big document.

Things done

Notify maintainers

cc @danth @trueNAHO @MattSturgeon

@stylix-automation stylix-automation bot added the topic: documentation Documentation additions or improvements label Jul 13, 2025
CONTRIBUTING.md Outdated
build the documentation, start a localhost web-server, and open it in your
browser.

See also: [Development environment → Documentation](./contributing.html#documentation-1)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what I mean by give headers custom names, documention-1 might change if we add another documention above it. it should be possible using [development-enviroment-documentation]: #development-enviroment-documentation, but I'm not sure if mdbook support this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe mdbook does support headers that use {} annotations. The same pandoc-inspired syntax that nixpkgs uses:

## Some heading { #some-id .some-class }

This is a subset of what nixpkgs supports though, for example iirc it only works on headings; other elements cannot have {} annotations.

Copy link
Member

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add redirects from old pages

Agreed.

It should be simple to add the removed pages to book.toml. I believe you can redirect the page to target a specific anchor on the new page, but I'm not sure.

Give headers custom names

Good idea if any headings are particularly ambiguous. Comments below.

Possible reword some things that don't make sense now that's it one big document.

I've not reviewed the old/new text, but this may be a good idea. This shouldn't necessarily block the PR though, imo.


It looks like currently, you only have links to external sites and to other anchors on the same page.

If that ever changes and you end up with links to the docs, you'll likely want to have absolute URLs in your contributing file, but convert them to relative-path links when building the docs.

Nixvim solves this using a "fix links" wrapper derivation that uses pandoc.

But for now it's a non-issue afaict.

CONTRIBUTING.md Outdated
build the documentation, start a localhost web-server, and open it in your
browser.

See also: [Development environment → Documentation](./contributing.html#documentation-1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe mdbook does support headers that use {} annotations. The same pandoc-inspired syntax that nixpkgs uses:

## Some heading { #some-id .some-class }

This is a subset of what nixpkgs supports though, for example iirc it only works on headings; other elements cannot have {} annotations.

CONTRIBUTING.md Outdated
This will build the documentation, start a localhost web-server, and open it in
your browser.

See also: [Adding modules → Documentation](./contributing.html#documentation)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
See also: [Adding modules → Documentation](./contributing.html#documentation)
See also: [Documentation](#documentation)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we still want the adding modules prefix, perhaps a different format to indicate it's sub-header tho?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we still want the adding modules prefix

I assume the link text was previously referring to a separate file, i.e. File → Heading.

So that'd now be Contributing → Documentation iiuc, which feels redundant.

I agree "Documentation" is kinda vague though, but it feels strange that it'd be the only example of using to indicate heading→sub-heading 🫤


I'm happy for it to say as is if you think it still makes sense.

@awwpotato awwpotato force-pushed the contrubiting-guide branch from 998aa2f to 1dfec68 Compare July 13, 2025 22:15
Copy link
Member

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not important or blocking, but just for the record these are the only links to the repo or to elsewhere in the docs:

Comment on lines +84 to +82
the [`/stylix/mk-target.nix`](
https://github.com/danth/stylix/blob/-/stylix/mk-target.nix) in-source
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In nixvim, we would write this as a repo-relative link:

Suggested change
the [`/stylix/mk-target.nix`](
https://github.com/danth/stylix/blob/-/stylix/mk-target.nix) in-source
the [`/stylix/mk-target.nix`](
./stylix/mk-target.nix) in-source

And our fix-links wrapper would auto-convert it to an external link when copying the file into the docs drv.

Copy link
Member

@MattSturgeon MattSturgeon Jul 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really important, but it'd have some subtle benefits:

  • In forks, the link would stay within the fork.
  • In the docs, you could link to the specific commit; like you already do for other links to stylix's repo.
  • The owner would automatically be in sync with other repo links; this is still using the old repo owner.


> [!IMPORTANT]
> The `mkTarget` argument is only available to modules imported by Stylix's
> [autoload system](https://github.com/danth/stylix/blob/-/stylix/autoload.nix),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

### Documentation

The documentation in the `doc` subtree gets
[published](https://nix-community.github.io/stylix) automatically, using GitHub
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In nixvim, the fix-links wrapper would convert this to a relative link (./) when copying into the docs drv.

@@ -1,19 +1,13 @@
[Introduction](README.md)

[Contributing guide](contributing.md)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to place the contibuting information at the bottom, as previously done, since most people will never read this. The more commonly used information should be at the top.

This will build the documentation, start a localhost web-server, and open it in
your browser.

See also: [Adding modules → Documentation](#documentation)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I find the character confusing:

Suggested change
See also: [Adding modules Documentation](#documentation)
See also: [Adding modules > Documentation](#documentation)

More flowy phrasings would be:

  • Suggested change
    See also: [Adding modules → Documentation](#documentation)
    See also the [documentation on adding modules](#documentation)
  • Suggested change
    See also: [Adding modules → Documentation](#documentation)
    See also the ["Adding modules" documentation](#documentation)

I prefer the "documentation on adding modules" variant.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the "documentation on adding modules" variant.

Agreed.

build the documentation, start a localhost web-server, and open it in your
browser.

See also: [Development environment → Documentation](#documentation-1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I find the character confusing:

Suggested change
See also: [Development environment Documentation](#documentation-1)
See also: [Development environment > Documentation](#documentation)

More flowy phrasings would be:

  • Suggested change
    See also: [Development environment → Documentation](#documentation-1)
    See also the [documentation on the development environment](#documentation)
  • Suggested change
    See also: [Development environment → Documentation](#documentation-1)
    See also the ["Development environment" documentation](#documentation)

I prefer the "documentation on the development environment" variant.

@awwpotato awwpotato force-pushed the contrubiting-guide branch from 1dfec68 to 7aa2cdd Compare July 14, 2025 18:40
@stylix-automation stylix-automation bot added the status: merge conflict Merge conflict label Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: merge conflict Merge conflict topic: documentation Documentation additions or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants