From 4424731ba41064f6abde4bda50574d8498fa670a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Joly?= <7347374+cljoly@users.noreply.github.com> Date: Wed, 12 Jan 2022 08:42:47 +0000 Subject: [PATCH] Starting point for a website (#1114) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Create a simple Zola website on a subdirectory This uses the [Juice theme](https://www.getzola.org/themes/juice/), with small customizations. It could be further customized later. * Automate website content update RISS and Makefile are used to pull the website content from various parts of the neovide repository (reusing images and the README.md file for instance) * Document how to build and edit the website It can be counter-intuitive to have to make changes outside of the `website` directory, adding documentation and scripting clarify it. * Deploy automatically to GitHub Pages Uses https://github.com/marketplace/actions/zola-deploy-to-pages to build and deploy the website on GitHub Pages. TODO (after merging) * A `TOKEN` need to be set as explained in https://github.com/marketplace/actions/zola-deploy-to-pages#secrets * I’ve tested with https://cljoly.github.io/neovide/, but we need to change this to at least https://neovide.github.io/neovide/. * Fix website URL Co-authored-by: Keith Simmons --- .github/workflows/website.yml | 38 +++ .gitmodules | 3 + README.md | 507 +++++++++++++++--------------- website/.gitignore | 6 + website/Makefile | 16 + website/README.md | 18 ++ website/config.toml | 23 ++ website/content/.gitkeep | 0 website/riss.awk | 41 +++ website/templates/_variables.html | 15 + website/templates/index.html | 32 ++ website/themes/juice | 1 + 12 files changed, 451 insertions(+), 249 deletions(-) create mode 100644 .github/workflows/website.yml create mode 100644 .gitmodules create mode 100644 website/.gitignore create mode 100644 website/Makefile create mode 100644 website/README.md create mode 100644 website/config.toml create mode 100644 website/content/.gitkeep create mode 100644 website/riss.awk create mode 100644 website/templates/_variables.html create mode 100644 website/templates/index.html create mode 160000 website/themes/juice diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml new file mode 100644 index 0000000..7795493 --- /dev/null +++ b/.github/workflows/website.yml @@ -0,0 +1,38 @@ +name: Website + +on: + push: + branches: + - main + pull_request: +jobs: + build: + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/main' + steps: + - name: 'Checkout' + uses: actions/checkout@master + - name: 'Content update' + run: | + make -C website content_update + - name: 'Build only' + uses: shalzz/zola-deploy-action@master + env: + BUILD_DIR: website + BUILD_ONLY: true + build_and_deploy: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - name: 'Checkout' + uses: actions/checkout@master + - name: 'Content update' + run: | + make -C website content_update + - name: 'Build and deploy' + uses: shalzz/zola-deploy-action@master + env: + PAGES_BRANCH: gh-pages + BUILD_DIR: website + # See https://github.com/marketplace/actions/zola-deploy-to-pages#secrets for details + TOKEN: ${{ secrets.TOKEN }} diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4c5850e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "website/themes/juice"] + path = website/themes/juice + url = https://github.com/huhu/juice diff --git a/README.md b/README.md index 858e8a6..b73d8cb 100644 --- a/README.md +++ b/README.md @@ -1,249 +1,258 @@ -# Neovide [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/SjFpZdQys6) [![Chat on Matrix](https://matrix.to/img/matrix-badge.svg)](https://matrix.to/#/#neovide_community:gitter.im) [![Discussions](https://img.shields.io/badge/GitHub-Discussions-green?logo=github)](https://github.com/Kethku/neovide/discussions) - -This is a simple graphical user interface for [Neovim](https://github.com/neovim/neovim) (an aggressively refactored and updated -Vim editor). Where possible there are some graphical improvements, but functionally it should act like the terminal UI. - -![Basic Screen Cap](./assets/BasicScreenCap.png) - -I've been using this as my daily driver since November 2019. It should be relatively stable, but I'm still working out some kinks -and ironing out some cross platform issues. In general it should be usable at this point, and if it isn't I consider that a bug and -appreciate a report in the issues! Any help and ideas are also greatly appreciated. - -I'm also very interested in suggestions code quality/style wise when it comes to Rust. I'm pretty new to the language and appreciate -any critiques that you might have to offer. I won't take all of them, but I promise to consider anything you might have to offer. - -## Features - -Should be a standard fully featured Neovim GUI. Beyond that there are some visual niceties: - -### Ligatures - -Supports ligatures and font shaping. - -![Ligatures](./assets/Ligatures.png) - -### Animated Cursor - -Cursor animates into position with a smear effect to improve tracking of cursor position. - -![Animated Cursor](./assets/AnimatedCursor.gif) - -### Smooth Scrolling - -Scroll operations on buffers in neovim will be animated smoothly pixel wise rather than line by line at a time. Note, multigrid must be -enabled for this to work. -https://github.com/Kethku/neovide/wiki/Configuration#multigrid - -![Smooth Scrolling](./assets/SmoothScrolling.gif) - -### Animated Windows - -Windows animate into position when they are moved making it easier to see how layout changes happen. Note, multigrid must be enabled for -this to work. -https://github.com/Kethku/neovide/wiki/Configuration#multigrid - -![Animated Windows](./assets/AnimatedWindows.gif) - -### Blurred Floating Windows - -The backgrounds of floating windows are blurred improving the visual separation between foreground and background from -built in window transparency. Note, multigrid must be enabled for this to work. -https://github.com/Kethku/neovide/wiki/Configuration#multigrid - -![Blurred Floating Windows](./assets/BlurredFloatingWindows.png) - -### Emoji Support - -Font fallback supports rendering of emoji not contained in the configured font. - -![Emoji](./assets/Emoji.png) - -### WSL Support - -Neovide supports displaying a full gui window from inside wsl via the `--wsl` command argument. Communication is passed via standard io into the wsl copy of neovim providing identical experience similar to visual studio code's remote editing https://code.visualstudio.com/docs/remote/remote-overview. - -### Remote TCP Support - -Neovide supports connecting to a remote instance of Neovim over a TCP socket via the `--remote-tcp` command argument. This would allow you to run Neovim on a remote machine and use the GUI on your local machine, connecting over the network. - -Launch Neovim as a TCP server (on port 6666) by running: - -```sh -nvim --headless --listen localhost:6666 -``` - -And then connect to it using: - -```sh -/path/to/neovide --remote-tcp=localhost:6666 -``` - -By specifying to listen on localhost, you only allow connections from your local computer. If you are actually doing this over a network you will want to use SSH port forwarding for security, and then connect as before. - -```sh -ssh -L 6666:localhost:6666 ip.of.other.machine nvim --headless --listen localhost:6666 -``` - -Finally, if you would like to leave the neovim server running, close the neovide application window instead of issuing a `:q` command. - -### Some Nonsense ;) - -```vim -let g:neovide_cursor_vfx_mode = "railgun" -``` - -![Railgun](./assets/Railgun.gif) - -### More to Come - -I've got more ideas for simple unobtrusive improvements. More to come. - -## Configuration - -Configuration is done almost completely via global neovide variables in your vim config and can be manipulated live at runtime. Details can be found [here](https://github.com/Kethku/neovide/wiki/Configuration). - -## Install - -**Note**: Building instructions are somewhat limited at the moment. All the libraries I use are cross platform and should have -support for Windows, Mac, and Linux. On Windows this should be enabled by default if you have a relatively recent system. - -**Note**: Neovide requires neovim version 0.6 or greater if built from main, or 0.4 if downloaded from releases. - -### From binary - -Building instructions are somewhat limited at the moment. All the libraries I use are cross platform and should have support for Windows, Mac, and Linux. The rendering is based on opengl, so a good gpu driver will be -necessary. On Windows this should be enabled by default if you have a relatively recent system. - -Installing should be as simple as downloading the binary, making sure `nvim.exe` with version 0.4 or greater is on your path, and running it. Everything should be self contained. - -### Windows - -#### Package manager - -[Scoop](https://scoop.sh/) has Neovide in the `extras` bucket. Ensure you have the `extras` bucket, and install: - -``` -$ scoop bucket list -main -extras -$ scoop install neovide -``` - -#### From source - -1. Install the latest version of Rust. I recommend -2. Install CMake. I use chocolatey: `choco install cmake --installargs '"ADD_CMAKE_TO_PATH=System"' -y` -3. Install LLVM. I use chocolatey: `choco install llvm -y` -4. Ensure graphics libraries are up to date. -5. Build and install Neovide: - - ```sh - git clone https://github.com/Kethku/neovide - cd neovide - cargo build --release - ``` - -6. Copy `./target/release/neovide.exe` to a known location and enjoy. - -### Mac (from source) - -1. Install the latest version of Rust. Using homebrew: `brew install rustup-init` -2. Configure rust by running `rustup-init` -3. Install CMake. Using homebrew: `brew install cmake` -4. `git clone https://github.com/Kethku/neovide` -5. `cd neovide` -6. `cargo build --release` -7. Copy `./target/release/neovide` to a known location and enjoy. -8. `cargo install cargo-bundle` -9. `cargo bundle --release` -10. Copy `./target/release/bundle/osx/neovide.app` to `~/Applications` and enjoy. - -### Linux - -#### Arch Linux - -There is an [AUR package for neovide](https://aur.archlinux.org/packages/neovide-git/). - -##### With Paru (or your preferred AUR helper) - -```sh -paru -S neovide-git -``` - -##### Without helper - -```sh -git clone https://aur.archlinux.org/neovide-git.git -cd neovide-git -makepkg -si -``` - -To install a non-default branch: - -```sh -git clone https://aur.archlinux.org/neovide-git.git -cd neovide-git -nvim PKGBUILD -:%s/l}/l}#branch=branch-name-here/ -:wq -makepkg -si -``` - -Note: Neovide requires that a font be set in `init.vim` otherwise errors might be encountered. -See [#527](https://github.com/Kethku/neovide/issues/527) - -##### With non-default branch - -```sh -git clone https://aur.archlinux.org/neovide-git.git -cd neovide-git -REGEX=$(printf 's/{url}/&\#branch=%s/g' '') -sed "$REGEX" PKGBUILD -makepkg -si -``` -#### With Snap -Neovide is also available in the Snap Store. You can install it -using the command below. - -``` -snap install neovide -``` -[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-white.svg)](https://snapcraft.io/neovide) - - -#### From source -1. Install necessary dependencies (adjust for your preferred package manager) - - ```sh - sudo apt install -y curl \ - gnupg ca-certificates git \ - gcc-multilib g++-multilib cmake libssl-dev pkg-config \ - libfreetype6-dev libasound2-dev libexpat1-dev libxcb-composite0-dev \ - libbz2-dev libsndio-dev freeglut3-dev libxmu-dev libxi-dev libfontconfig1-dev - ``` - -2. Install Rust - - ```sh - curl --proto '=https' --tlsv1.2 -sSf "https://sh.rustup.rs" | sh - ``` - -3. Clone the repository - - ```sh - git clone "https://github.com/Kethku/neovide" - ``` - -4. Build - - ```sh - cd neovide && ~/.cargo/bin/cargo build --release - ``` - -5. Copy `./target/release/neovide` to a known location and enjoy. - -## Troubleshooting -- Neovide requires that a font be set in `init.vim` otherwise errors might be encountered. This can be fixed by adding `set guifont=Your\ Font\ Name:h15` in init.vim file. Reference issue [#527](https://github.com/Kethku/neovide/issues/527). - -### Linux-specific -- If you recieve errors complaining about DRI3 settings, please reference issue [#44](https://github.com/Kethku/neovide/issues/44#issuecomment-578618052). + + +# Neovide [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/SjFpZdQys6) [![Chat on Matrix](https://matrix.to/img/matrix-badge.svg)](https://matrix.to/#/#neovide_community:gitter.im) [![Discussions](https://img.shields.io/badge/GitHub-Discussions-green?logo=github)](https://github.com/Kethku/neovide/discussions) + + + +This is a simple graphical user interface for [Neovim](https://github.com/neovim/neovim) (an aggressively refactored and updated +Vim editor). Where possible there are some graphical improvements, but functionally it should act like the terminal UI. + +![Basic Screen Cap](./assets/BasicScreenCap.png) + +I've been using this as my daily driver since November 2019. It should be relatively stable, but I'm still working out some kinks +and ironing out some cross platform issues. In general it should be usable at this point, and if it isn't I consider that a bug and +appreciate a report in the issues! Any help and ideas are also greatly appreciated. + +I'm also very interested in suggestions code quality/style wise when it comes to Rust. I'm pretty new to the language and appreciate +any critiques that you might have to offer. I won't take all of them, but I promise to consider anything you might have to offer. + +## Features + +Should be a standard fully featured Neovim GUI. Beyond that there are some visual niceties: + +### Ligatures + +Supports ligatures and font shaping. + +![Ligatures](./assets/Ligatures.png) + +### Animated Cursor + +Cursor animates into position with a smear effect to improve tracking of cursor position. + +![Animated Cursor](./assets/AnimatedCursor.gif) + +### Smooth Scrolling + +Scroll operations on buffers in neovim will be animated smoothly pixel wise rather than line by line at a time. Note, multigrid must be +enabled for this to work. +https://github.com/Kethku/neovide/wiki/Configuration#multigrid + +![Smooth Scrolling](./assets/SmoothScrolling.gif) + +### Animated Windows + +Windows animate into position when they are moved making it easier to see how layout changes happen. Note, multigrid must be enabled for +this to work. +https://github.com/Kethku/neovide/wiki/Configuration#multigrid + +![Animated Windows](./assets/AnimatedWindows.gif) + +### Blurred Floating Windows + +The backgrounds of floating windows are blurred improving the visual separation between foreground and background from +built in window transparency. Note, multigrid must be enabled for this to work. +https://github.com/Kethku/neovide/wiki/Configuration#multigrid + +![Blurred Floating Windows](./assets/BlurredFloatingWindows.png) + +### Emoji Support + +Font fallback supports rendering of emoji not contained in the configured font. + +![Emoji](./assets/Emoji.png) + +### WSL Support + +Neovide supports displaying a full gui window from inside wsl via the `--wsl` command argument. Communication is passed via standard io into the wsl copy of neovim providing identical experience similar to visual studio code's remote editing https://code.visualstudio.com/docs/remote/remote-overview. + +### Remote TCP Support + +Neovide supports connecting to a remote instance of Neovim over a TCP socket via the `--remote-tcp` command argument. This would allow you to run Neovim on a remote machine and use the GUI on your local machine, connecting over the network. + +Launch Neovim as a TCP server (on port 6666) by running: + +```sh +nvim --headless --listen localhost:6666 +``` + +And then connect to it using: + +```sh +/path/to/neovide --remote-tcp=localhost:6666 +``` + +By specifying to listen on localhost, you only allow connections from your local computer. If you are actually doing this over a network you will want to use SSH port forwarding for security, and then connect as before. + +```sh +ssh -L 6666:localhost:6666 ip.of.other.machine nvim --headless --listen localhost:6666 +``` + +Finally, if you would like to leave the neovim server running, close the neovide application window instead of issuing a `:q` command. + +### Some Nonsense ;) + +```vim +let g:neovide_cursor_vfx_mode = "railgun" +``` + +![Railgun](./assets/Railgun.gif) + +### More to Come + +I've got more ideas for simple unobtrusive improvements. More to come. + +## Configuration + +Configuration is done almost completely via global neovide variables in your vim config and can be manipulated live at runtime. Details can be found [here](https://github.com/Kethku/neovide/wiki/Configuration). + +## Install + +**Note**: Building instructions are somewhat limited at the moment. All the libraries I use are cross platform and should have +support for Windows, Mac, and Linux. On Windows this should be enabled by default if you have a relatively recent system. + +**Note**: Neovide requires neovim version 0.6 or greater if built from main, or 0.4 if downloaded from releases. + +### From binary + +Building instructions are somewhat limited at the moment. All the libraries I use are cross platform and should have support for Windows, Mac, and Linux. The rendering is based on opengl, so a good gpu driver will be +necessary. On Windows this should be enabled by default if you have a relatively recent system. + +Installing should be as simple as downloading the binary, making sure `nvim.exe` with version 0.4 or greater is on your path, and running it. Everything should be self contained. + +### Windows + +#### Package manager + +[Scoop](https://scoop.sh/) has Neovide in the `extras` bucket. Ensure you have the `extras` bucket, and install: + +``` +$ scoop bucket list +main +extras +$ scoop install neovide +``` + +#### From source + +1. Install the latest version of Rust. I recommend +2. Install CMake. I use chocolatey: `choco install cmake --installargs '"ADD_CMAKE_TO_PATH=System"' -y` +3. Install LLVM. I use chocolatey: `choco install llvm -y` +4. Ensure graphics libraries are up to date. +5. Build and install Neovide: + + ```sh + git clone https://github.com/Kethku/neovide + cd neovide + cargo build --release + ``` + +6. Copy `./target/release/neovide.exe` to a known location and enjoy. + +### Mac (from source) + +1. Install the latest version of Rust. Using homebrew: `brew install rustup-init` +2. Configure rust by running `rustup-init` +3. Install CMake. Using homebrew: `brew install cmake` +4. `git clone https://github.com/Kethku/neovide` +5. `cd neovide` +6. `cargo build --release` +7. Copy `./target/release/neovide` to a known location and enjoy. +8. `cargo install cargo-bundle` +9. `cargo bundle --release` +10. Copy `./target/release/bundle/osx/neovide.app` to `~/Applications` and enjoy. + +### Linux + +#### Arch Linux + +There is an [AUR package for neovide](https://aur.archlinux.org/packages/neovide-git/). + +##### With Paru (or your preferred AUR helper) + +```sh +paru -S neovide-git +``` + +##### Without helper + +```sh +git clone https://aur.archlinux.org/neovide-git.git +cd neovide-git +makepkg -si +``` + +To install a non-default branch: + +```sh +git clone https://aur.archlinux.org/neovide-git.git +cd neovide-git +nvim PKGBUILD +:%s/l}/l}#branch=branch-name-here/ +:wq +makepkg -si +``` + +Note: Neovide requires that a font be set in `init.vim` otherwise errors might be encountered. +See [#527](https://github.com/Kethku/neovide/issues/527) + +##### With non-default branch + +```sh +git clone https://aur.archlinux.org/neovide-git.git +cd neovide-git +REGEX=$(printf 's/{url}/&\#branch=%s/g' '') +sed "$REGEX" PKGBUILD +makepkg -si +``` +#### With Snap +Neovide is also available in the Snap Store. You can install it +using the command below. + +``` +snap install neovide +``` +[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-white.svg)](https://snapcraft.io/neovide) + + +#### From source +1. Install necessary dependencies (adjust for your preferred package manager) + + ```sh + sudo apt install -y curl \ + gnupg ca-certificates git \ + gcc-multilib g++-multilib cmake libssl-dev pkg-config \ + libfreetype6-dev libasound2-dev libexpat1-dev libxcb-composite0-dev \ + libbz2-dev libsndio-dev freeglut3-dev libxmu-dev libxi-dev libfontconfig1-dev + ``` + +2. Install Rust + + ```sh + curl --proto '=https' --tlsv1.2 -sSf "https://sh.rustup.rs" | sh + ``` + +3. Clone the repository + + ```sh + git clone "https://github.com/Kethku/neovide" + ``` + +4. Build + + ```sh + cd neovide && ~/.cargo/bin/cargo build --release + ``` + +5. Copy `./target/release/neovide` to a known location and enjoy. + +## Troubleshooting +- Neovide requires that a font be set in `init.vim` otherwise errors might be encountered. This can be fixed by adding `set guifont=Your\ Font\ Name:h15` in init.vim file. Reference issue [#527](https://github.com/Kethku/neovide/issues/527). + +### Linux-specific +- If you recieve errors complaining about DRI3 settings, please reference issue [#44](https://github.com/Kethku/neovide/issues/44#issuecomment-578618052). diff --git a/website/.gitignore b/website/.gitignore new file mode 100644 index 0000000..bcb80c0 --- /dev/null +++ b/website/.gitignore @@ -0,0 +1,6 @@ +# Zola output +public +# Will be copied during the build process +static/assets +# Most md files are created by RISS on the fly, updated during the build process +content/*.md diff --git a/website/Makefile b/website/Makefile new file mode 100644 index 0000000..defdd31 --- /dev/null +++ b/website/Makefile @@ -0,0 +1,16 @@ +.PHONY: md_update +md_update: + @awk -f ./riss.awk < ../README.md >content/_index.md + +.PHONY: content_update +content_update: md_update + @mkdir -p static/assets + @cp -r ../assets static/ + +.PHONY: all +all: content_update + @zola build + +.PHONY: serve +serve: content_update + @zola serve diff --git a/website/README.md b/website/README.md new file mode 100644 index 0000000..d26c2c1 --- /dev/null +++ b/website/README.md @@ -0,0 +1,18 @@ +## Build + +To build neovide’s website, ensure you have [zola](https://getzola.org/) and `awk` installed. + +Then, in this directory, run: +```sh +git submodule update --init +make serve +``` + +## Edit + +To ease maintenance, markdown files in [`content`](./content/) are often sourced from other parts of the repository, thanks to [RISS](https://cj.rs/riss). RISS allows to change the files slightly, see the [transformation reference](https://cj.rs/readme-in-static-site/#transformations-reference) for the syntax. + +For instance, `content/_index.md` is sourced from the [`README`](/README.md). Thus to make changes to `content/_index.md`, edit the [`README`](/README.md) and run: +``` +make md_update +``` diff --git a/website/config.toml b/website/config.toml new file mode 100644 index 0000000..2b3ffdf --- /dev/null +++ b/website/config.toml @@ -0,0 +1,23 @@ +# The URL the site will be built for +base_url = "https://neovide.github.io/neovide" +theme = "juice" + +# Whether to automatically compile all Sass files in the sass directory +compile_sass = true + +# Whether to build a search index to be used later on by a JavaScript library +build_search_index = false + +[markdown] +# Whether to do syntax highlighting +# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola +highlight_code = true + +[extra] +# Put all your custom variables here +juice_logo_name = "Neovide" +juice_logo_path = "assets/neovide.svg" +juice_extra_menu = [ + { title = "Github", link = "https://github.com/neovide/neovide"} +] +repository_url = "https://github.com/neovide/neovide" diff --git a/website/content/.gitkeep b/website/content/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/website/riss.awk b/website/riss.awk new file mode 100644 index 0000000..956a9bb --- /dev/null +++ b/website/riss.awk @@ -0,0 +1,41 @@ +#!/usr/bin/awk -f +# +# Copyright 2021 Clément Joly +# https://cj.rs/riss +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Divide the input file into these types of sections: +# * inserting: the current line is copied to the output, verbatim +# * removing: the line is not copied to the output +# To distinguish between these sections, the script interprets special +# comments. These comments are removed from the output. +BEGIN { + # Section identifier + removing = 0 +} + +/^