mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
docs: use README as a source for the docs
This commit is contained in:
parent
ab693bb1cd
commit
1654f97a79
3 changed files with 21 additions and 24 deletions
|
@ -12,6 +12,8 @@
|
||||||
- [Quick set up tutorial](https://www.youtube.com/watch?v=b641h63lqy0) (by [@Vimjoyer](https://www.youtube.com/@vimjoyer))
|
- [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/))
|
- [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?
|
## What is it?
|
||||||
NixVim is a [Neovim](https://neovim.io) distribution built around
|
NixVim is a [Neovim](https://neovim.io) distribution built around
|
||||||
[Nix](https://nixos.org) modules. It is distributed as a Nix flake, and
|
[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)!
|
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?
|
## How does it work?
|
||||||
When you build the module (probably using home-manager), it will install all
|
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
|
your plugins and generate a lua config for NeoVim with all the options
|
||||||
|
|
|
@ -347,6 +347,7 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
|
||||||
|
|
||||||
# Patch index.md
|
# Patch index.md
|
||||||
substituteInPlace ./index.md \
|
substituteInPlace ./index.md \
|
||||||
|
--replace-fail "@README@" "$(cat ${finalAttrs.passthru.readme})" \
|
||||||
--replace-fail "@DOCS_VERSIONS@" "$(cat ${finalAttrs.passthru.docs-versions})"
|
--replace-fail "@DOCS_VERSIONS@" "$(cat ${finalAttrs.passthru.docs-versions})"
|
||||||
|
|
||||||
# Patch user-configs
|
# Patch user-configs
|
||||||
|
@ -369,6 +370,21 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
copy-docs = pkgs.writeShellScript "copy-docs" docs.commands;
|
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 {
|
search = search.override {
|
||||||
baseHref = finalAttrs.baseHref + "search/";
|
baseHref = finalAttrs.baseHref + "search/";
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,30 +16,7 @@ Documentation is currently available for the following versions:
|
||||||
>
|
>
|
||||||
> The old behaviour can be restored by enabling `nixpkgs.useGlobalPackages`.
|
> The old behaviour can be restored by enabling `nixpkgs.useGlobalPackages`.
|
||||||
|
|
||||||
## What is it?
|
@README@
|
||||||
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)!
|
|
||||||
|
|
||||||
## Welcome to the docs!
|
## Welcome to the docs!
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue