Skip to content

Commit

Permalink
Remove docs url
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Dec 15, 2024
1 parent eb94512 commit c252ff8
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 24 deletions.
4 changes: 4 additions & 0 deletions packages/amf0.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = "amf0"
description = "Amf0 (de)serialisation for Gleam"
repo_url = "https://github.com/jamesbirtles/gleam-amf0"
category = ""
4 changes: 4 additions & 0 deletions packages/fp2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = "fp2"
description = "A porting of some parts of fp-ts to Gleam"
repo_url = "https://github.com/lucasavila00/fp2"
category = ""
4 changes: 4 additions & 0 deletions packages/fp2_gleam.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = "fp2_gleam"
description = "A porting of some parts of fp-ts to Gleam"
repo_url = "https://github.com/lucasavila00/fp2"
category = ""
4 changes: 4 additions & 0 deletions packages/gleam_tailwind.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = "gleam_tailwind"
description = "Gleam modules and functions for installing and invoking TailwindCSS"
repo_url = "https://github.com/okkdev/gleam_tailwind"
category = ""
4 changes: 4 additions & 0 deletions packages/glesha2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = "glesha2"
description = "SHA-2 for Gleam"
repo_url = "https://github.com/bunopnu/glesha2"
category = ""
31 changes: 7 additions & 24 deletions src/awesome.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const packages_query = "
select
name
, description
, docs_url
, json_extract(links, '$.Repository') as repo_url
from packages
"
Expand Down Expand Up @@ -183,9 +182,9 @@ fn package_entry(package: ConfigPackage) -> String {
<> package.name
<> "]("
<> package.repo_url
<> ") - [📚]("
<> package.docs_url
<> ") - "
<> ") - [📚](https://hexdocs.pm/"
<> package.name
<> "/) - "
<> package.description
}

Expand All @@ -201,14 +200,12 @@ fn read_config(entry: String) -> ConfigPackage {

let assert Ok(name) = tom.get_string(doc, ["name"])
let assert Ok(description) = tom.get_string(doc, ["description"])
let assert Ok(docs_url) = tom.get_string(doc, ["docs_url"])
let assert Ok(repo_url) = tom.get_string(doc, ["repo_url"])
let assert Ok(category) = tom.get_string(doc, ["category"])

ConfigPackage(
name: name,
description: description,
docs_url: docs_url,
repo_url: repo_url,
category: category,
)
Expand All @@ -223,26 +220,19 @@ fn write_config(package: DatabasePackage) -> Nil {
DatabasePackage(
name: name,
description: description,
docs_url: Some(docs_url),
repo_url: Some(repo_url),
) -> {
let toml = new_toml(name, description, docs_url, repo_url)
let toml = new_toml(name, description, repo_url)
let assert Ok(_) = simplifile.write("packages/" <> name <> ".toml", toml)
Nil
}
_ -> Nil
}
}

fn new_toml(
name: String,
description: String,
docs_url: String,
repo_url: String,
) -> String {
fn new_toml(name: String, description: String, repo_url: String) -> String {
"name = \"" <> name <> "\"
description = \"" <> description <> "\"
docs_url = \"" <> docs_url <> "\"
repo_url = \"" <> repo_url <> "\"
category = \"\"
"
Expand All @@ -252,31 +242,24 @@ pub type ConfigPackage {
ConfigPackage(
name: String,
description: String,
docs_url: String,
repo_url: String,
category: String,
)
}

pub type DatabasePackage {
DatabasePackage(
name: String,
description: String,
docs_url: Option(String),
repo_url: Option(String),
)
DatabasePackage(name: String, description: String, repo_url: Option(String))
}

fn database_package_decoder(
data: Dynamic,
) -> Result(DatabasePackage, dynamic.DecodeErrors) {
let decoder =
dynamic.decode4(
dynamic.decode3(
DatabasePackage,
dynamic.element(0, dynamic.string),
dynamic.element(1, dynamic.string),
dynamic.element(2, dynamic.optional(dynamic.string)),
dynamic.element(3, dynamic.optional(dynamic.string)),
)
decoder(data)
}

0 comments on commit c252ff8

Please sign in to comment.