Skip to content

Commit

Permalink
Various Improvements
Browse files Browse the repository at this point in the history
- Updated Contribute page
- Made all external links open in seperate tab
- Updated Bug Report & Wish List scripts to match fcp.cafe
  • Loading branch information
latenitefilms committed Jun 1, 2023
1 parent 2c759d8 commit 39af524
Show file tree
Hide file tree
Showing 35 changed files with 310 additions and 111 deletions.
43 changes: 31 additions & 12 deletions .github/scripts/issues_to_md.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,49 @@ const getIssues = async () => {
},
params: {
state: "open",
per_page: 30
per_page: 100
}
});

return response.data.filter(issue => !issue.labels.some(label => label.name === "Feature Request"));
return response.data;
};

const generateMarkdown = (issues) => {
// read the existing content
let oldContent = fs.readFileSync('docs/bugtracker.md', 'utf-8');
const generateMarkdown = (issues, path, sortFunc) => {
let content = '';

// split it at the marker line and keep only the part before it
let marker = 'Here\'s a list of the **30 most recently reported** DaVinci Resolve bugs on our GitHub issues site:';
oldContent = oldContent.split(marker)[0];
// sort issues according to provided sort function
issues.sort(sortFunc);

let newContent = `${oldContent}${marker}\n\n`;
// select top 30
issues = issues.slice(0, 30);

// build the new list
for (const issue of issues) {
const date = new Date(issue.created_at).toLocaleDateString("en-US", { day: 'numeric', month: 'long', year: 'numeric' });
newContent += `- [${issue.title} (${date})](${issue.html_url})\n`;
content += `- [${issue.title} (${date})](${issue.html_url}){target="_blank"}\n`;
}

fs.writeFileSync('docs/bugtracker.md', newContent);
fs.writeFileSync(path, content);
};

getIssues().then(generateMarkdown);
const sumReactions = issue => {
let total = 0;
total += issue.reactions['+1'] || 0;
total += issue.reactions['-1'] || 0;
total += issue.reactions['laugh'] || 0;
total += issue.reactions['hooray'] || 0;
total += issue.reactions['confused'] || 0;
total += issue.reactions['heart'] || 0;
total += issue.reactions['rocket'] || 0;
total += issue.reactions['eyes'] || 0;
return total;
}

getIssues().then(issues => {
const issuesFilteredByRecent = issues.filter(issue => issue.labels.length > 0 && !issue.labels.some(label => label.name === "Feature Request"));
const issuesFilteredByLatest = issuesFilteredByRecent.filter(issue => issue.labels.some(label => label.name === "DaVinci Resolve 18.5"));

generateMarkdown(issuesFilteredByRecent, 'docs/_includes/bugtracker-recent.md', (a, b) => new Date(b.created_at) - new Date(a.created_at));
generateMarkdown(issuesFilteredByLatest, 'docs/_includes/bugtracker-latest.md', (a, b) => new Date(b.created_at) - new Date(a.created_at));
generateMarkdown(issuesFilteredByRecent, 'docs/_includes/bugtracker-reactions.md', (a, b) => sumReactions(b) - sumReactions(a));
});
37 changes: 26 additions & 11 deletions .github/scripts/issues_to_wishlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,45 @@ const getIssues = async () => {
},
params: {
state: "open",
per_page: 30
per_page: 100
}
});

return response.data.filter(issue => issue.labels.some(label => label.name === "Feature Request"));
};

const generateMarkdown = (issues) => {
// read the existing content
let oldContent = fs.readFileSync('docs/wishlist.md', 'utf-8');
const generateMarkdown = (issues, path, sortFunc) => {
let content = '';

// split it at the marker line and keep only the part before it
let marker = 'Here\'s a list of the **30 most recently added** DaVinci Resolve feature requests:';
oldContent = oldContent.split(marker)[0];
// sort issues according to provided sort function
issues.sort(sortFunc);

let newContent = `${oldContent}${marker}\n\n`;
// select top 30
issues = issues.slice(0, 30);

// build the new list
for (const issue of issues) {
const date = new Date(issue.created_at).toLocaleDateString("en-US", { day: 'numeric', month: 'long', year: 'numeric' });
newContent += `- [${issue.title} (${date})](${issue.html_url})\n`;
content += `- [${issue.title} (${date})](${issue.html_url}){target="_blank"}\n`;
}

fs.writeFileSync('docs/wishlist.md', newContent);
fs.writeFileSync(path, content);
};

getIssues().then(generateMarkdown);
const sumReactions = issue => {
let total = 0;
total += issue.reactions['+1'] || 0;
total += issue.reactions['-1'] || 0;
total += issue.reactions['laugh'] || 0;
total += issue.reactions['hooray'] || 0;
total += issue.reactions['confused'] || 0;
total += issue.reactions['heart'] || 0;
total += issue.reactions['rocket'] || 0;
total += issue.reactions['eyes'] || 0;
return total;
}

getIssues().then(issues => {
generateMarkdown(issues, 'docs/_includes/wishlist-recent.md', (a, b) => new Date(b.created_at) - new Date(a.created_at));
generateMarkdown(issues, 'docs/_includes/wishlist-reactions.md', (a, b) => sumReactions(b) - sumReactions(a));
});
20 changes: 10 additions & 10 deletions .github/workflows/retype-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
branches:
- main
issues:
types: [opened, closed]
types: [opened, closed, labeled, unlabeled]

jobs:
issues_to_markdown:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v2
Expand All @@ -38,10 +38,10 @@ jobs:
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git diff --quiet && git diff --staged --quiet || (git add docs/bugtracker.md docs/wishlist.md; git commit -m "Update bugtracker.md and wishlist.md"; git push)
git diff --quiet && git diff --staged --quiet || (git add docs/_includes/*; git commit -m "Update wishlists"; git push)
- name: Archive production artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: docs
path: docs/
Expand All @@ -51,12 +51,12 @@ jobs:
needs: issues_to_markdown
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16
node-version: 16

- name: Install dependencies
run: npm install rss markdown-it
Expand All @@ -81,7 +81,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v2
Expand All @@ -97,14 +97,14 @@ jobs:
uses: retypeapp/action-build@latest
with:
license: ${{ secrets.RETYPE_SECRET }}

- name: Push to retype branch
uses: retypeapp/action-github-pages@latest
with:
update-branch: true

- name: Checkout retype branch
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: retype

Expand All @@ -115,4 +115,4 @@ jobs:
git config --local user.name "GitHub Action"
git add rss.xml
git commit -m "Update rss.xml"
git push
git push
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
---

!!!
Want to contribute or advertise? [Learn more here!](https://resolve.cafe/contribute/)
Want to contribute or advertise? [Learn more here!](https://resolve.cafe/contribute/){target="_blank"}
!!!

---
Expand Down Expand Up @@ -84,7 +84,7 @@ This is still very much a work-in-progress, and we'll be adding content graduall
---

!!!
Want to contribute or advertise? [Learn more here!](https://resolve.cafe/contribute/)
Want to contribute or advertise? [Learn more here!](https://resolve.cafe/contribute/){target="_blank"}
!!!

---
Expand Down
Empty file.
Empty file.
Empty file.
7 changes: 7 additions & 0 deletions docs/_includes/five-stars.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<span class="review-rating">
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
<span class="fa fa-star checked"></span>
</span>
60 changes: 43 additions & 17 deletions docs/_includes/head.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,45 @@
<style>
.videocontainer {
position: relative;
width: 100%;
padding-bottom: 56.25%;
}
.video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
}
.giscus, .giscus-frame {
width: 100%;
min-height: 500px;
}
.videocontainer {
position: relative;
width: 100%;
padding-bottom: 56.25%;
}
.video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
}
.giscus, .giscus-frame {
width: 100%;
min-height: 500px;
}
.review {
text-align: left;
color: #1956AF;
border-radius: 10px;
background-color: #E1EDFF;
border: 1px solid #1956AF;
margin-bottom: 20px;
padding-top: 15px;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 0px;
}
.review p {
font-size: 11px;
}
.review-rating {
margin-bottom: 5px;
}
</style>

<!-- Font Awesome Icon Library -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
.checked {
color: orange;
}
</style>
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion docs/articles.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This section of the site is dedicated to linking to great external articles, as
---

!!!
Want to contribute? [Learn more here!](https://resolve.cafe/contribute/)
Want to contribute? [Learn more here!](https://resolve.cafe/contribute/){target="_blank"}
!!!

---
Expand Down
39 changes: 36 additions & 3 deletions docs/bugtracker.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,44 @@

This page is dedicated to keeping track of the latest DaVinci Resolve bugs and issues.

We keep track of these bugs via our [GitHub issues site](https://github.com/CommandPost/ResolveCafe/issues).
We keep track of these bugs via our [GitHub issues site](https://github.com/CommandPost/ResolveCafe/issues){target="_blank"}.

To submit a new bug report, simply sign up for a free GitHub account and post an issue [here](https://github.com/CommandPost/ResolveCafe/issues){target="_blank"}.

In general, whenever posting a new bug/issue to GitHub, we also submit feedback to the [Blackmagic Design Forums](https://forum.blackmagicdesign.com/viewforum.php?f=21&sid=f22b8d91290f36eb3cd987459d49f572){target="_blank"}.

---

### DaVinci Resolve 18.5

Here's a list of the **30 most recently added** DaVinci Resolve 18.5 bug reports:

{{ include "bugtracker-latest.md" }}

The above list is pulled from our [GitHub issues site](https://github.com/CommandPost/ResolveCafe/issues){target="_blank"}.

---

### Most Popular

Here's a list of the **30 most popular** DaVinci Resolve bug reports:

{{ include "bugtracker-reactions.md" }}

The above list is pulled from our [GitHub issues site](https://github.com/CommandPost/ResolveCafe/issues){target="_blank"}.

---

### Recently Reported
### Recently Added

Here's a list of the **30 most recently reported** DaVinci Resolve bugs on our GitHub issues site:
Here's a list of the **30 most recently added** DaVinci Resolve bug reports:

{{ include "bugtracker-recent.md" }}

The above list is pulled from our [GitHub issues site](https://github.com/CommandPost/ResolveCafe/issues){target="_blank"}.

---

!!!
Want to contribute? [Learn more here!](https://resolve.cafe/contribute/){target="_blank"}
!!!

0 comments on commit 39af524

Please sign in to comment.