Skip to content

Commit

Permalink
Update projects.md template
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Castaño Arteaga <[email protected]>
  • Loading branch information
tegioz committed Aug 14, 2023
1 parent 588b322 commit 6971621
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions src/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl From<&LandscapeData> for Vec<Project> {
// Helper closure to format dates
let fmt_date = |date: &Option<NaiveDate>| {
let Some(date) = date else {
return "-".to_string();
return String::new();
};
date.format(DATE_FORMAT).to_string()
};
Expand Down Expand Up @@ -57,7 +57,7 @@ impl From<&LandscapeData> for Vec<Project> {

// Create project instance and return it
let project = Project {
accepted_at: fmt_date(&item.incubating_at),
accepted_at: fmt_date(&item.accepted_at),
archived_at: fmt_date(&item.archived_at),
graduated_at: fmt_date(&item.graduated_at),
homepage_url: item.homepage_url,
Expand Down Expand Up @@ -90,15 +90,15 @@ pub(crate) struct ProjectsMd<'a> {
pub(crate) fn generate_projects_csv(mut w: csv::Writer<File>, projects: &[Project]) -> Result<()> {
// Write headers
w.write_record([
"Project",
"Maturity",
"Accepted",
"Sandbox",
"Incubating",
"Graduated",
"Archived",
"Number of security audits",
"Last security audit",
"project_name",
"maturity",
"accepted_date",
"sandbox_date",
"incubating_date",
"graduated_date",
"archived_date",
"num_security_audits",
"last_security_audit_date",
])?;

// Write one record for each project
Expand Down
6 changes: 3 additions & 3 deletions templates/projects.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Projects
## Projects

| **Project** | **Maturity** | **Accepted** | **Sandbox** | **Incubating** | **Graduated** | **Archived** | **Number of security audits** | **Last security audit** |
| ----- | ----- | ----- | ----- | ----- | ----- | ----- | -----: | ----- |
| **project_name** | **maturity** | **accepted_date** | **sandbox_date** | **incubating_date** | **graduated_date** | **archived_date** | **num_security_audits** | **last_security_audit_date** |
| :--------------- | :----------: | :---------------: | :--------------: | :-----------------: | :----------------: | :---------------: | :---------------------: | :--------------------------: |
{%- for p in projects ~%}
[{{ p.name }}]({{ p.homepage_url }}) | {{ p.maturity }} | {{ p.accepted_at }} | {{ p.sandbox_at }} | {{ p.incubating_at }} | {{ p.graduated_at }} | {{ p.archived_at }} | {{ p.num_security_audits }} | {{ p.last_security_audit }} {{ "|" -}}
{% endfor %}

0 comments on commit 6971621

Please sign in to comment.