Skip to content

Commit

Permalink
feat!: deprecate rust plugin & update sass files (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgoudham authored Sep 22, 2024
1 parent d5edace commit f705cb5
Showing 18 changed files with 897 additions and 2,280 deletions.
801 changes: 96 additions & 705 deletions Cargo.lock

Large diffs are not rendered by default.

13 changes: 2 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
name = "mdbook-catppuccin"
authors = ["Goudham Suresh <sgoudham@gmail.com>", "winston <hey@winston.sh>"]
description = "🎊 Soothing pastel theme for mdBook"
version = "2.2.0"
version = "3.0.0"
edition = "2021"
license = "MIT"
readme = "README.md"
@@ -12,22 +12,13 @@ include = ["/src", "/assets", "/README.md", "/LICENSE"]

[[bin]]
name = "mdbook-catppuccin"
path = "src/bin/mdbook-catppuccin.rs"

[lib]
name = "mdbook_catppuccin"
path = "src/lib.rs"
path = "src/main.rs"

[dependencies]
clap = { version = "4.4.7", features = ["cargo"] }
clap_complete = "4.4.4"
mdbook = { version = "0.4.35", default_features = false }
env_logger = "0.10.0"
log = "0.4.20"
serde_json = "1.0.108"
semver = "1.0.20"
toml_edit = "0.20.7"
version-compare = "0.1.1"

[profile.release]
lto = true
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -37,6 +37,13 @@

## Usage

> [!IMPORTANT]
> The `mdbook-catppuccin` rust package has been deprecated. For further information
> on why this decision was made, please refer to
> [catppuccin/mdBook#107](https://github.com/catppuccin/mdBook/issues/107)
>
> Please follow the instructions below to install the Catppuccin theme for mdBook.
1. Initialise your mdBook with the theme files:

```shell
@@ -55,8 +62,8 @@

3. Download the following CSS assets from this repository to the `theme` directory:

- [catppuccin.css](src/bin/assets/catppuccin.css)
- [catppuccin-admonish.css](src/bin/assets/catppuccin-admonish.css) (**Only
- [catppuccin.css](palette/dist/catppuccin.css)
- [catppuccin-admonish.css](palette/dist/catppuccin-admonish.css) (**Only
required if you are using
[mdbook-admonish](https://github.com/tommilligan/mdbook-admonish)**)

7 changes: 1 addition & 6 deletions example/book.toml
Original file line number Diff line number Diff line change
@@ -5,14 +5,9 @@ multilingual = false
src = "src"
title = "Catppuccin's mdBook"

[preprocessor]

[preprocessor.catppuccin]
assets_version = "2.1.0" # DO NOT EDIT: Managed by `mdbook-catppuccin install`

[preprocessor.admonish]
command = "mdbook-admonish"
assets_version = "3.0.0" # do not edit: managed by `mdbook-admonish install`
assets_version = "3.0.0" # do not edit: managed by `mdbook-admonish install`

[output.html]
default-theme = "mocha"
2 changes: 1 addition & 1 deletion example/theme/catppuccin-admonish.css
2 changes: 1 addition & 1 deletion example/theme/catppuccin.css
6 changes: 4 additions & 2 deletions example/theme/index.hbs
Original file line number Diff line number Diff line change
@@ -112,7 +112,9 @@
<div class="sidebar-scrollbox">
{{#toc}}{{/toc}}
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>

<!-- Track and set sidebar scroll position -->
@@ -345,4 +347,4 @@

</div>
</body>
</html>
</html>
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -16,19 +16,11 @@
});

packages = forAllSystems (pkgs: rec {
mdbook-catppuccin = pkgs.rustPlatform.buildRustPackage rec {
mdbook-catppuccin = pkgs.rustPlatform.buildRustPackage {
pname = "mdbook-catppuccin";
inherit version;
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
cargoLock.lockFile = ./Cargo.lock;

nativeBuildInputs = with pkgs; [installShellFiles];
postInstall = ''
installShellCompletion --cmd ${pname} \
--bash <($out/bin/${pname} completion bash) \
--fish <($out/bin/${pname} completion fish) \
--zsh <($out/bin/${pname} completion zsh)
'';
};
default = mdbook-catppuccin;
});

Large diffs are not rendered by default.

984 changes: 492 additions & 492 deletions src/bin/assets/catppuccin.css → palette/dist/catppuccin.css

Large diffs are not rendered by default.

29 changes: 17 additions & 12 deletions palette/package-lock.json
10 changes: 5 additions & 5 deletions palette/package.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"version": "2.2.0",
"description": "Soothing pastel theme for mdBook",
"scripts": {
"build": "sass -I node_modules --no-charset --no-source-map catppuccin.scss:../src/bin/assets/catppuccin.css catppuccin-admonish.scss:../src/bin/assets/catppuccin-admonish.css"
"build": "sass -I node_modules --no-charset --no-source-map catppuccin.scss:dist/catppuccin.css catppuccin-admonish.scss:dist/catppuccin-admonish.css"
},
"repository": {
"type": "git",
@@ -16,8 +16,8 @@
},
"homepage": "https://github.com/catppuccin/mdBook#readme",
"devDependencies": {
"@catppuccin/highlightjs": "^0.1.3",
"@catppuccin/palette": "^0.1.6",
"sass": "^1.58.3"
"@catppuccin/highlightjs": "^1.0.0",
"@catppuccin/palette": "^1.4.0",
"sass": "^1.79.3"
}
}
}
348 changes: 0 additions & 348 deletions src/bin/assets/index.hbs

This file was deleted.

292 changes: 0 additions & 292 deletions src/bin/mdbook-catppuccin.rs

This file was deleted.

91 changes: 0 additions & 91 deletions src/lib.rs

This file was deleted.

54 changes: 54 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
use std::process;

use clap::{
command, crate_authors, crate_description, crate_version, Arg, ArgAction, Command,
};
use log::error;

fn main() {
env_logger::init_from_env(env_logger::Env::default().default_filter_or("info"));

error!(
r#"
This preprocessor is no longer supported and no new versions will be released.
Instructions on how to apply Catppuccin to your mdBook can be found at https://github.com/catppuccin/mdBook.
Please uninstall this preprocessor by running 'cargo uninstall mdbook-catppuccin' and remove '[preprocessor.catppuccin]' from your 'book.toml' file.
For further information on why this package no longer works, please refer to https://github.com/catppuccin/mdBook/issues/107.
Exiting..."#
);

make_app().get_matches();

process::exit(1);
}

pub fn make_app() -> Command {
command!()
.name("mdbook-catppuccin")
.about(crate_description!())
.author(crate_authors!())
.version(crate_version!())
.subcommand(
command!("supports")
.arg(Arg::new("renderer").required(true))
.about("Check whether a renderer is supported by this preprocessor"),
)
.subcommand(
command!("install")
.arg(
Arg::new("dir")
.default_value(".")
.help("Root directory for the book, this should contain the configuration file `book.toml`")
)
.arg(
Arg::new("force")
.long("force")
.short('f')
.action(ArgAction::SetTrue)
.help("Forcefully overwrite the existing 'index.hbs' file")
)
.about("Install the necessary files needed and update the config to include them"),
)
}
89 changes: 0 additions & 89 deletions src/toml.rs

This file was deleted.

0 comments on commit f705cb5

Please sign in to comment.