diff --git a/data/crates.json b/data/crates.json index d60b48b..e4d828a 100644 --- a/data/crates.json +++ b/data/crates.json @@ -203,8 +203,7 @@ { "name": "Safe type casts", "crates": [{ - "name": "bytemuck", - "notes": "" + "name": "bytemuck" }] }, { @@ -259,33 +258,33 @@ "name": "Password Hashing", "notes": "For more algorithms, see Rust Crypto Password Hashes.", "crates": [ - { "name": "argon2", "notes": "" }, - { "name": "scrypt", "notes": "" }, - { "name": "bcrypt", "notes": "" } + { "name": "argon2" }, + { "name": "scrypt" }, + { "name": "bcrypt" } ] }, { "name": "General Purpose Hashing", "notes": "For more algorithms, see Rust Crypto Hashes.", "crates": [ - { "name": "sha2", "notes": "" }, - { "name": "sha1", "notes": "" }, - { "name": "md-5", "notes": "" } + { "name": "sha2" }, + { "name": "sha1" }, + { "name": "md-5" } ] }, { "name": "AEAD Encryption", "notes": "For more algorithms, see Rust Crypto AEADs.", "crates": [ - { "name": "aes-gcm-siv", "notes": "" }, - { "name": "aes-gcm", "notes": "" }, - { "name": "chacha20poly1305", "notes": "" } + { "name": "aes-gcm-siv" }, + { "name": "aes-gcm" }, + { "name": "chacha20poly1305" } ] }, { "name": "RSA", "crates": [ - { "name": "rsa", "notes": "" } + { "name": "rsa" } ] }, { @@ -293,18 +292,18 @@ "notes": "For more algorithms, see Rust Crypto Signatures.", "crates": [ { "name": "ed25519", "notes": "Use in conjunction with the ed25519-dalek crate." }, - { "name": "ecdsa", "notes": "" }, - { "name": "dsa", "notes": "" } + { "name": "ecdsa" }, + { "name": "dsa" } ] }, { "name": "Certificate Formats", "notes": "For more formats, see Rust Crypto Formats.", "crates": [ - { "name": "der", "notes": "" }, - { "name": "pem‑rfc7468 ", "notes": "" }, - { "name": "pkcs8", "notes": "" }, - { "name": "x509-cert", "notes": "" } + { "name": "der" }, + { "name": "pem‑rfc7468" }, + { "name": "pkcs8" }, + { "name": "x509-cert" } ] }, { @@ -456,7 +455,6 @@ { "slug": "grpc", "name": "gRPC", - "description": "", "purposes": [ { "name": "General Purpose", @@ -472,12 +470,10 @@ { "slug": "databases", "name": "Databases", - "description": "", "subgroups": [ { "slug": "sql-databases", "name": "SQL Databases", - "description": "", "purposes": [ { "name": "Multi Database", @@ -499,8 +495,7 @@ { "name": "Postgres", "crates": [{ - "name": "sqlx", - "notes": "" + "name": "sqlx" }, { "name": "tokio-postgres", "notes": "Postgres-specific library. Performs better than SQLx" @@ -509,8 +504,7 @@ { "name": "MySQL", "crates": [{ - "name": "sqlx", - "notes": "" + "name": "sqlx" }, { "name": "mysql_async", "notes": "Has a poorly designed API. Prefer SQLx for MySQL" @@ -519,8 +513,7 @@ { "name": "SQLite", "crates": [{ - "name": "sqlx", - "notes": "" + "name": "sqlx" }, { "name": "rustqlite", "notes": "Provides a sync API to SQLite + provides access to advanced sqlite features." @@ -529,8 +522,7 @@ { "name": "MS SQL", "crates": [{ - "name": "sqlx", - "notes": "" + "name": "sqlx" }, { "name": "tiberius", "notes": "MS SQL specific library. Has better support for advanced column types than SQLx." @@ -548,20 +540,17 @@ { "slug": "other-databases", "name": "Other Databases", - "description": "", "purposes": [ { "name": "Redis", "crates": [{ - "name": "redis", - "notes": "" + "name": "redis" }] }, { "name": "MongoDB", "crates": [{ - "name": "mongodb", - "notes": "" + "name": "mongodb" }] } ] @@ -571,7 +560,6 @@ { "slug": "cli-tools", "name": "CLIs", - "description": "", "subgroups": [ { "slug": "argument-parsing", @@ -668,12 +656,10 @@ { "slug": "concurrency", "name": "Concurrency", - "description": "", "subgroups": [ { "slug": "data-structures", "name": "Data Structures", - "description": "", "purposes": [ { "name": "Mutex", diff --git a/src/routes/crates/list.rs b/src/routes/crates/list.rs index 237a282..137ab29 100644 --- a/src/routes/crates/list.rs +++ b/src/routes/crates/list.rs @@ -52,7 +52,7 @@ pub(crate) async fn run() -> impl IntoResponse { #[derive(Debug, Clone, Serialize, Deserialize)] struct Crate { name: String, - notes: String, + notes: Option, link: Option, } @@ -67,7 +67,7 @@ struct Purpose { struct CrateSubGroup { slug: String, name: String, - description: String, + description: Option, purposes: Vec, } @@ -75,7 +75,7 @@ struct CrateSubGroup { struct CrateGroup { slug: String, name: String, - description: String, + description: Option, subgroups: Vec, purposes: Option>, } diff --git a/templates/macros/crate_table.html b/templates/macros/crate_table.html index 45d1233..0d7a130 100644 --- a/templates/macros/crate_table.html +++ b/templates/macros/crate_table.html @@ -32,7 +32,7 @@ [docs] {% endif %}
- {{ crate.notes | safe }} + {% if crate.notes %}{{ crate.notes | safe }}{% endif %}

{% endfor %} diff --git a/templates/routes/crates/crates-list.html b/templates/routes/crates/crates-list.html index c00208b..7f722ce 100644 --- a/templates/routes/crates/crates-list.html +++ b/templates/routes/crates/crates-list.html @@ -37,7 +37,7 @@ {% for group in crate_groups %}

{{ group.name }}

-

{{ group.description | safe }}

+

{% if group.description %}{{ group.description | safe }}{% endif %}

{% if group.purposes %} {{ crate_table::crate_table(purposes=group.purposes) }} @@ -46,7 +46,7 @@ {% for subgroup in group.subgroups %}

{{ subgroup.name }}

-

{{ subgroup.description | safe }}

+

{% if subgroup.description %}{{ subgroup.description | safe }}{% endif %}

{{ crate_table::crate_table(purposes=subgroup.purposes) }}
{% endfor %}