docs: use README as a source for the docs

This commit is contained in:
Matt Sturgeon 2025-01-19 13:56:54 +00:00
parent ab693bb1cd
commit 1654f97a79
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
3 changed files with 21 additions and 24 deletions

View file

@ -12,6 +12,8 @@
- [Quick set up tutorial](https://www.youtube.com/watch?v=b641h63lqy0) (by [@Vimjoyer](https://www.youtube.com/@vimjoyer))
- [Nixvim: How to configure Neovim with the power of Nix](https://www.youtube.com/watch?v=GOe0C7Qtypk) (NeovimConf 2023 talk by [@GaetanLepage](https://glepage.com/))
<!-- START DOCS -->
## What is it?
NixVim is a [Neovim](https://neovim.io) distribution built around
[Nix](https://nixos.org) modules. It is distributed as a Nix flake, and
@ -37,6 +39,8 @@ catppuccin as the colorscheme, no extra configuration required!
Check out [this list of real world nixvim configs](https://nix-community.github.io/nixvim/user-guide/config-examples.html)!
<!-- STOP DOCS -->
## How does it work?
When you build the module (probably using home-manager), it will install all
your plugins and generate a lua config for NeoVim with all the options

View file

@ -347,6 +347,7 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
# Patch index.md
substituteInPlace ./index.md \
--replace-fail "@README@" "$(cat ${finalAttrs.passthru.readme})" \
--replace-fail "@DOCS_VERSIONS@" "$(cat ${finalAttrs.passthru.docs-versions})"
# Patch user-configs
@ -369,6 +370,21 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
passthru = {
copy-docs = pkgs.writeShellScript "copy-docs" docs.commands;
readme =
runCommand "readme"
{
start = "<!-- START DOCS -->";
end = "<!-- STOP DOCS -->";
baseurl = "https://nix-community.github.io/nixvim/";
src = ../../README.md;
}
''
# extract relevant section of the README
sed -n "/$start/,/$end/p" $src > $out
# replace absolute links
substituteInPlace $out --replace-quiet "$baseurl" "./"
# TODO: replace .html with .md
'';
search = search.override {
baseHref = finalAttrs.baseHref + "search/";
};

View file

@ -16,30 +16,7 @@ Documentation is currently available for the following versions:
>
> The old behaviour can be restored by enabling `nixpkgs.useGlobalPackages`.
## What is it?
NixVim is a [Neovim](https://neovim.io) distribution built around
[Nix](https://nixos.org) modules. It is distributed as a Nix flake, and
configured through Nix, all while leaving room for your plugins and your vimrc.
## What does it look like?
Here is a simple configuration that uses catppuccin as the colorscheme and uses the
lualine plugin:
```nix
{
programs.nixvim = {
enable = true;
colorschemes.catppuccin.enable = true;
plugins.lualine.enable = true;
};
}
```
When we do this, lualine will be set up to a sensible default, and will use
catppuccin as the colorscheme, no extra configuration required!
Check out [this list of real world nixvim configs](./user-guide/config-examples.md)!
@README@
## Welcome to the docs!