Make description and notes fields optional

This commit is contained in:
Nico Burns 2022-11-08 12:42:07 +00:00
parent aea07eac67
commit 4ca4ed0a88
4 changed files with 29 additions and 43 deletions

View file

@ -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 <a href=\"https://github.com/RustCrypto/password-hashes#rustcrypto-password-hashes\">Rust Crypto Password Hashes</a>.",
"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 <a href=\"https://github.com/RustCrypto/hashes#rustcrypto-hashes\">Rust Crypto Hashes</a>.",
"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 <a href=\"https://github.com/RustCrypto/AEADs#rustcrypto-authenticated-encryption-with-associated-data-aead-algorithms\">Rust Crypto AEADs</a>.",
"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 <a href=\"https://github.com/RustCrypto/signatures#rustcrypto-signatures--\">Rust Crypto Signatures</a>.",
"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 <a href=\"https://github.com/RustCrypto/formats#rustcrypto-formats--\">Rust Crypto Formats</a>.",
"crates": [
{ "name": "der", "notes": "" },
{ "name": "pemrfc7468 ", "notes": "" },
{ "name": "pkcs8", "notes": "" },
{ "name": "x509-cert", "notes": "" }
{ "name": "der" },
{ "name": "pemrfc7468" },
{ "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",

View file

@ -52,7 +52,7 @@ pub(crate) async fn run() -> impl IntoResponse {
#[derive(Debug, Clone, Serialize, Deserialize)]
struct Crate {
name: String,
notes: String,
notes: Option<String>,
link: Option<String>,
}
@ -67,7 +67,7 @@ struct Purpose {
struct CrateSubGroup {
slug: String,
name: String,
description: String,
description: Option<String>,
purposes: Vec<Purpose>,
}
@ -75,7 +75,7 @@ struct CrateSubGroup {
struct CrateGroup {
slug: String,
name: String,
description: String,
description: Option<String>,
subgroups: Vec<CrateSubGroup>,
purposes: Option<Vec<Purpose>>,
}

View file

@ -32,7 +32,7 @@
<a style="margin-left: 3px;opacity: 0.7;color: #333;text-decoration: none" href="https://docs.rs/{{ crate.name }}"> [docs]</a>
{% endif %}
<br />
{{ crate.notes | safe }}
{% if crate.notes %}{{ crate.notes | safe }}{% endif %}
</p>
{% endfor %}
<!-- </ul> -->

View file

@ -37,7 +37,7 @@
{% for group in crate_groups %}
<section data-toc-section id="section-{{ group.slug }}">
<h3>{{ group.name }}</h3>
<p class="group-description">{{ group.description | safe }}</p>
<p class="group-description">{% if group.description %}{{ group.description | safe }}{% endif %}</p>
{% if group.purposes %}
{{ crate_table::crate_table(purposes=group.purposes) }}
@ -46,7 +46,7 @@
{% for subgroup in group.subgroups %}
<section data-toc-section id="section-{{ group.slug }}-subsection-{{ subgroup.slug }}">
<h4>{{ subgroup.name }}</h4>
<p class="group-description">{{ subgroup.description | safe }}</p>
<p class="group-description">{% if subgroup.description %}{{ subgroup.description | safe }}{% endif %}</p>
{{ crate_table::crate_table(purposes=subgroup.purposes) }}
</section>
{% endfor %}