Skip to content

Commit

Permalink
Added Developer FAQ
Browse files Browse the repository at this point in the history
- Attempting to simplify RSS generation code.
- Attempting to make the FAQ generation code more generic.
  • Loading branch information
latenitefilms committed Aug 2, 2023
1 parent e2a8a0e commit 5b5d0b7
Show file tree
Hide file tree
Showing 11 changed files with 167 additions and 511 deletions.
3 changes: 2 additions & 1 deletion .github/scripts/generate-faq.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const fs = require('fs');
const path = require('path');
const { PAGE_NAME } = process.env;

const pageName = 'faq';
const pageName = '${PAGE_NAME}';
const directoryPath = path.join(process.env.GITHUB_WORKSPACE, `docs/_includes/${pageName}`);
const outputFile = path.join(process.env.GITHUB_WORKSPACE, `docs/_includes/generated-${pageName}.md`);

Expand Down
7 changes: 5 additions & 2 deletions .github/scripts/generate-rss.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ const RSS = require('rss');
const MarkdownIt = require('markdown-it');
const cheerio = require('cheerio');

const siteTitle = 'FCP Cafe';
const siteUrl = 'https://fcp.cafe';
const { SITE_TITLE } = process.env;
const { SITE_URL } = process.env;

const siteTitle = '${SITE_TITLE}';
const siteUrl = '${SITE_URL}';

const md = new MarkdownIt({html: true});

Expand Down
70 changes: 20 additions & 50 deletions .github/workflows/retype-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ jobs:

- name: Generate FAQ Markdown
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_NAME: ${{ github.repository }}
PAGE_NAME: "faq"
run: node .github/scripts/generate-faq.js

- name: Generate Developer FAQ Markdown
env:
PAGE_NAME: "developer-faq"
run: node .github/scripts/generate-faq.js

- name: Generate Latest News Markdown
Expand Down Expand Up @@ -113,7 +117,6 @@ jobs:

generate_rss:
runs-on: ubuntu-latest
needs: generate_markdown
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -127,22 +130,26 @@ jobs:
run: npm install rss markdown-it feedparser-promised deep-equal glob cheerio

- name: Generate RSS Feed
env:
SITE_TITLE: "FCP Cafe"
SITE_URL: "https://fcp.cafe"
run: node .github/scripts/generate-rss.js || echo "An error occurred. See the stack trace above for more details."

- name: Commit and push if it's necessary
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git stash
git pull --rebase origin main
git stash pop
if git diff --exit-code --quiet docs/rss.xml; then
echo "No changes to commit"
else
git add docs/rss.xml
git commit -m "Update rss.xml"
git push
fi
echo "Checking for changes to commit..."
git status
echo "Adding changes..."
git add -A docs/rss.xml
git status
echo "Committing changes..."
git commit -m "Update RSS Feed" || echo "No changes to commit"
git status
echo "Pushing changes..."
git push
echo "Completed commit step."
publish:
name: Publish to retype branch
Expand All @@ -156,16 +163,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: docs
path: docs/

- name: Copy rss.xml to a temporary location
run: |
cp docs/rss.xml /tmp/rss.xml
- name: Build and publish using Retype
uses: retypeapp/action-build@latest
with:
Expand All @@ -176,33 +173,6 @@ jobs:
with:
update-branch: true

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

- name: Pull latest changes from retype branch
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git pull origin retype
- name: Copy rss.xml from the temporary location to retype branch
run: |
cp /tmp/rss.xml ./rss.xml
- name: Commit and push if it's necessary
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add rss.xml
if git diff --exit-code --staged; then
echo "No changes to commit"
else
git commit -m "Update rss.xml"
git push
fi
- name: Purge CloudFlare cache
run: |
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/purge_cache" \
Expand Down
13 changes: 13 additions & 0 deletions docs/_includes/developer-faq/console-spam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### Console spam from FxPlug4

When you create an FxPlug4 plugin, you'll see a lot of these messages in Console:

![](/static/fcpx-console-spam.png)

Unfortunately, there's no way to stop it. It’s harmless, though.

I think what it’s trying to tell us is that the FxPlug4 process doesn’t have some files related to the UI that Apple display in Motion and Final Cut Pro.

The reason it cares about this is because they use `ViewBridge` to show `NSView`'s from your process in their process. But because of the way they show them, it ends up not mattering.

I wish there were a way to turn off the spew, but it’s in macOS itself.
9 changes: 9 additions & 0 deletions docs/_includes/developer-faq/disable-drt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### What is disableDRT in a FCPXML?

**DRT** is **dynamic range tracking**.

It’s an internal name the Final Cut Pro team use for the new automatic HDR settings.

The **disableDRT** setting in the FCPXML tells the app not to enable the automatic HDR settings on older projects created before the setting existed.

If you have existing projects and want to ensure they render the same as they did in previous versions, you don’t want to touch that value.
Empty file.
21 changes: 21 additions & 0 deletions docs/developers/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Frequently Asked Questions

This page is dedicated to answering the most common developer questions about FxPlug4, Workflow Extensions, etc.

You can use the Search Tool at the top right of this page to search the FAQ.

---

!!!
Something missing or have a question? [Learn more here!](/contribute/)
!!!

---

{{ include "generated-developer-faq" }}

---

!!!
Something missing or have a question? [Learn more here!](/contribute/)
!!!
3 changes: 3 additions & 0 deletions docs/developers/faq.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
label: FAQ
icon: book
image: /static/thumbnail.jpg
5 changes: 4 additions & 1 deletion docs/retype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ data:

outbound:
exclude:
- github.com/CommandPost/FCPCafe/
- github.com/CommandPost/FCPCafe/

include:
- "rss.xml"
Loading

0 comments on commit 5b5d0b7

Please sign in to comment.