diff --git a/.github/workflows/verify-readme.yml b/.github/workflows/verify-readme.yml index 92a1cd5..f2d379c 100644 --- a/.github/workflows/verify-readme.yml +++ b/.github/workflows/verify-readme.yml @@ -31,7 +31,7 @@ jobs: crate: cargo-readme version: latest use-tool-cache: true - - run: cargo readme --output README.md + - run: cargo readme --no-indent-headings --output README.md # This will verify that cargo readme did not do anything # If it did, the CI should fail, because the README is outdated - run: git diff --exit-code diff --git a/README.md b/README.md index c5732a6..1d67c60 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +mensa CLI logo + [![tests](https://github.com/MalteT/mensa/actions/workflows/rust.yml/badge.svg)](https://github.com/MalteT/mensa/actions/workflows/rust.yml) # mensa diff --git a/README.tpl b/README.tpl index 477e57c..03ba3b9 100644 --- a/README.tpl +++ b/README.tpl @@ -1,7 +1,3 @@ -[![tests](https://github.com/MalteT/mensa/actions/workflows/rust.yml/badge.svg)](https://github.com/MalteT/mensa/actions/workflows/rust.yml) - -# {{crate}} - {{readme}} License: {{license}} diff --git a/flake.lock b/flake.lock index b039575..b7f9ced 100644 --- a/flake.lock +++ b/flake.lock @@ -86,10 +86,27 @@ "type": "github" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1633422745, + "narHash": "sha256-gA6Ok64nPbkjHk3Oanq4641EeYkjcKhisDF9wBjLxEk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8e1eab9eae4278c9bb1dcae426848a581943db5a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "fenix": "fenix", - "nixCargoIntegration": "nixCargoIntegration" + "nixCargoIntegration": "nixCargoIntegration", + "nixpkgs": "nixpkgs_3" } }, "rust-analyzer-src": { diff --git a/flake.nix b/flake.nix index fc25b45..0d154ba 100644 --- a/flake.nix +++ b/flake.nix @@ -1,10 +1,20 @@ { inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixCargoIntegration.url = "github:yusdacra/nix-cargo-integration"; fenix.url = "github:nix-community/fenix"; }; - outputs = inputs: inputs.nixCargoIntegration.lib.makeOutputs { - root = ./.; - }; + outputs = inputs: + let pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; + in inputs.nixCargoIntegration.lib.makeOutputs { + root = ./.; + overrides.shell = common: prev: { + packages = prev.packages ++ [ + (pkgs.writeScriptBin "update-readme" '' + cargo readme --no-indent-headings -o README.md + '') + ]; + }; + }; } diff --git a/src/main.rs b/src/main.rs index e9bfb25..bf62c6a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,15 @@ +//! mensa CLI logo +//! +//! [![tests](https://github.com/MalteT/mensa/actions/workflows/rust.yml/badge.svg)](https://github.com/MalteT/mensa/actions/workflows/rust.yml) +//! +//! # mensa +//! //! CLI tool to query the menu of canteens contained in the //! [OpenMensa](https://openmensa.org) database. //! //! ![example](https://user-images.githubusercontent.com/11077981/137278085-75ec877a-dba0-44bb-a8dc-6c802e24178c.png) //! -//! # Features +//! ## Features //! //! - [X] Runs on Linux, macOS and Windows. //! - [X] Custom filters and favourites using CLI flags or the @@ -15,15 +21,15 @@ //! - [ ] List your favourite meals in canteens close to your location. //! //! -//! # Installation +//! ## Installation //! -//! ## Cargo +//! ### Cargo //! //! ```console //! $ cargo install --git https://github.com/MalteT/mensa //! ``` //! -//! ## Nix +//! ### Nix //! //! This is a [Nix Flake](https://nixos.wiki/wiki/Flakes), add it //! to your configuration or just test the application with: @@ -33,7 +39,7 @@ //! ``` //! //! -//! # Usage +//! ## Usage //! //! See `mensa --help`. //! @@ -47,7 +53,7 @@ //! - `mensa tomorrow` shortcut for `mensa meals -d tomorrow [...]` //! //! -//! # Configuration +//! ## Configuration //! //! See [config.toml](config.toml) for an example. Copy the file to: //! - `$XDG_CONFIG_DIR/mensa/config.toml` on **Linux**, diff --git a/src/meal/mod.rs b/src/meal/mod.rs index 0e85885..a490da3 100644 --- a/src/meal/mod.rs +++ b/src/meal/mod.rs @@ -72,7 +72,7 @@ enum Note { } impl RawMeal { - /// Parse notes and return them split into [`Tags`] and descriptions. + /// Parse notes and return them split into [`Tag`]s and descriptions. fn parse_and_split_notes(&self) -> (HashSet, HashSet) { self.notes .iter()