Skip to content

Commit aaf7a2a

Browse files
committed
fix seo for dev docs
1 parent 0b99981 commit aaf7a2a

20 files changed

+481
-25
lines changed

cli/dist/prebuild.mjs

+5-1
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,17 @@ const creatTableOfContents = (pages) => {
6161
const removePreviousDocs = () => {
6262
fs.rmdirSync(DOCS_PUBLISH_PATH, { recursive: true });
6363
};
64+
const kabobToSentenceCase = (name) => {
65+
return name.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
66+
};
6467
const copyDocsFiles = (files) => {
6568
const docsTemplateContents = fs.readFileSync(DOCS_TEMPLATE_PATH).toString();
6669
files.forEach((file) => {
70+
var _a;
6771
const contents = fs.readFileSync(file).toString().replace(/`/gu, "\\`").replace(/</gu, "&lt;").replace(/>/gu, "&gt;");
6872
const fileName = file.replace(DOCS_FOLDER, "").replace(".md", ".svelte");
6973
const outputPath = path.join(DOCS_PUBLISH_PATH, fileName).replace(/_/gu, "-");
70-
const outputContents = docsTemplateContents.replace("MARKDOWN_PLACEHOLDER", contents);
74+
const outputContents = docsTemplateContents.replace("MARKDOWN_PLACEHOLDER", contents).replace("TITLE_PLACEHOLDER", kabobToSentenceCase(((_a = fileName.split("/").pop()) != null ? _a : "").replace(".svelte", "").replace("_", "-")));
7175
fs.ensureFileSync(outputPath);
7276
fs.writeFileSync(outputPath, outputContents);
7377
});

cli/src/prebuild.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ const removePreviousDocs = () => {
8686
fs.rmdirSync(DOCS_PUBLISH_PATH, { recursive: true })
8787
}
8888

89+
const kabobToSentenceCase = (name: string) => {
90+
return name
91+
.split('-')
92+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
93+
.join(' ')
94+
}
95+
8996
const copyDocsFiles = (files: string[]) => {
9097
const docsTemplateContents = fs.readFileSync(DOCS_TEMPLATE_PATH).toString()
9198
files.forEach((file) => {
@@ -99,7 +106,14 @@ const copyDocsFiles = (files: string[]) => {
99106
const fileName = file.replace(DOCS_FOLDER, '').replace('.md', '.svelte')
100107
const outputPath = path.join(DOCS_PUBLISH_PATH, fileName).replace(/_/gu, '-')
101108

102-
const outputContents = docsTemplateContents.replace('MARKDOWN_PLACEHOLDER', contents)
109+
const outputContents = docsTemplateContents
110+
.replace('MARKDOWN_PLACEHOLDER', contents)
111+
.replace(
112+
'TITLE_PLACEHOLDER',
113+
kabobToSentenceCase(
114+
(fileName.split('/').pop() ?? '').replace('.svelte', '').replace('_', '-')
115+
)
116+
)
103117

104118
fs.ensureFileSync(outputPath)
105119

cli/src/templates/docs-page.svelte

+19
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
<script lang="ts">
2+
import { page } from '$app/stores'
3+
24
import Markdown from '@nick-mazuk/ui-svelte/src/typography/markdown/markdown.svelte'
5+
import Seo from '@nick-mazuk/ui-svelte/src/utilities/seo/seo.svelte'
6+
7+
import luaLogo from '$lib/assets/images/lua-logo.png'
38
49
const content = `MARKDOWN_PLACEHOLDER`
510
</script>
611

12+
<Seo
13+
title="TITLE_PLACEHOLDER"
14+
siteName="JW Lua Scripts Docs"
15+
description="Use Finale faster than the blink of an eye. Simplify workflows to just one click. All for free, forever."
16+
canonicalUrl="{`https://jw-lua-scripts-docs.vercel.app/${$page.path}`}"
17+
openGraph="{{
18+
image: {
19+
src: `https://jw-lua-scripts-docs.vercel.app${luaLogo}`,
20+
width: 630,
21+
height: 630,
22+
},
23+
}}"
24+
/>
25+
726
<Markdown content="{content}" headerIds />

config.toml

+2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ base_directory = "."
33
files = [
44
{path = "docs/getting-started.md", url = "/docs/getting-started", title = "Getting Started"},
55
{path = "docs/getting-started/adding-scripts.md", url = "/docs/getting-started/adding-scripts", title = "Adding Scripts"},
6+
{path = "docs/getting-started/getting-help.md", url = "/docs/getting-started/getting-help", title = "Getting Help"},
67
{path = "docs/getting-started/resources.md", url = "/docs/getting-started/resources", title = "Resources"},
8+
{path = "docs/getting-started/script-checklist.md", url = "/docs/getting-started/script-checklist", title = "Script Checklist"},
79
{path = "docs/getting-started/style-guide.md", url = "/docs/getting-started/style-guide", title = "Style Guide"},
810
{path = "docs/library.md", url = "/docs/library", title = "Library"},
911
{path = "docs/library/articulation.md", url = "/docs/library/articulation", title = "Articulation"},

src/lib/lib/library-pages.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const libraryPages: any[] = [{"text":"Getting Started","href":"/docs/getting-started","children":[{"text":"Adding Scripts","href":"/docs/getting-started/adding-scripts"},{"text":"Resources","href":"/docs/getting-started/resources"},{"text":"Style Guide","href":"/docs/getting-started/style-guide"}]},{"text":"Library","href":"/docs/library","children":[{"text":"Articulation","href":"/docs/library/articulation"},{"text":"Configuration","href":"/docs/library/configuration"},{"text":"Enigma String","href":"/docs/library/enigma-string"},{"text":"Expression","href":"/docs/library/expression"},{"text":"General Library","href":"/docs/library/general-library"},{"text":"Note Entry","href":"/docs/library/note-entry"},{"text":"Transposition","href":"/docs/library/transposition"}]}]
1+
export const libraryPages: any[] = [{"text":"Getting Started","href":"/docs/getting-started","children":[{"text":"Adding Scripts","href":"/docs/getting-started/adding-scripts"},{"text":"Getting Help","href":"/docs/getting-started/getting-help"},{"text":"Resources","href":"/docs/getting-started/resources"},{"text":"Script Checklist","href":"/docs/getting-started/script-checklist"},{"text":"Style Guide","href":"/docs/getting-started/style-guide"}]},{"text":"Library","href":"/docs/library","children":[{"text":"Articulation","href":"/docs/library/articulation"},{"text":"Configuration","href":"/docs/library/configuration"},{"text":"Enigma String","href":"/docs/library/enigma-string"},{"text":"Expression","href":"/docs/library/expression"},{"text":"General Library","href":"/docs/library/general-library"},{"text":"Note Entry","href":"/docs/library/note-entry"},{"text":"Transposition","href":"/docs/library/transposition"}]}]

src/routes/docs/__layout.svelte

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
{#if githubUrl}
2929
<Spacer />
3030
<div class="flex justify-end">
31-
<Button variant="secondary" prefix="{Github}" href="{githubUrl}"
32-
>Edit page on GitHub</Button
33-
>
31+
<Button variant="secondary" prefix="{Github}" href="{githubUrl}">
32+
Edit page on GitHub
33+
</Button>
3434
</div>
3535
{/if}
3636
</div>
+34-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,45 @@
11
<script lang="ts">
2+
import { page } from '$app/stores'
3+
24
import Markdown from '@nick-mazuk/ui-svelte/src/typography/markdown/markdown.svelte'
5+
import Seo from '@nick-mazuk/ui-svelte/src/utilities/seo/seo.svelte'
6+
7+
import luaLogo from '$lib/assets/images/lua-logo.png'
38
49
const content = `# Getting started
510
611
These guides will help you create JW Lua scripts to use with Finale. More specifically, they'll help you create great scripts for the JW Lua Scripts repository. That way, you can build scripts faster, and help other Finale users find them.
712
8-
These docs are a work in progress, but right now, you can still explore the function library as well as a few tips to help you get up and running.
13+
There are several benefits for contributing to this project:
14+
15+
1. **No need to reinvent the wheel**. We have an extensive and growing [standard library](/docs/library) that includes many of the most common functions you'll need, such as transposition, position calculation, SMuFL font decoding, and much more.
16+
2. **Easy sharing and distribution**. Just by adding your scripts to the repository, they'll automatically be shared with the rest of the community. Other Finale users will be able to search and download your scripts from this website. You won't need to setup anything.
17+
3. **See plenty of examples**. There aren't a ton of example scripts out in the wild, but this is the largest open-source collection of JW Lua scripts. You can easily learn how to do almost anything by looking through other's scripts.
18+
19+
As you start contributing, just remember that you can always [get help](/docs/getting-started/getting-help).
20+
21+
To contribute, you'll need a GitHub account. We use GitHub to collaborate on the code. Think of Google Drive or Dropbox but for code. If you don't have a GitHub account, you can [sign up here](https://github.com/signup).
22+
23+
If you've never used Git or GitHub before, that's ok. These docs will walk you through most of the process of using them with this repository. However, there are some great resources for learning [Git](https://youtu.be/USjZcfj8yxE) and [GitHub](https://youtu.be/nhNq2kIvi9s) out there.
24+
25+
Next, learn how to [add scripts to this repository](/docs/getting-started/adding-scripts).
26+
27+
&gt; Note: All scripts added to the repo will have a CC0 license. See [LICENSE](https://github.com/Nick-Mazuk/jw-lua-scripts/blob/master/LICENSE) for specific terms. This is to encourage widespread use and encourage other JW Lua coders to build off your scripts.
928
`
1029
</script>
1130

31+
<Seo
32+
title="Getting Started"
33+
siteName="JW Lua Scripts Docs"
34+
description="Use Finale faster than the blink of an eye. Simplify workflows to just one click. All for free, forever."
35+
canonicalUrl="{`https://jw-lua-scripts-docs.vercel.app/${$page.path}`}"
36+
openGraph="{{
37+
image: {
38+
src: `https://jw-lua-scripts-docs.vercel.app${luaLogo}`,
39+
width: 630,
40+
height: 630,
41+
},
42+
}}"
43+
/>
44+
1245
<Markdown content="{content}" headerIds />
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,113 @@
11
<script lang="ts">
2+
import { page } from '$app/stores'
3+
24
import Markdown from '@nick-mazuk/ui-svelte/src/typography/markdown/markdown.svelte'
5+
import Seo from '@nick-mazuk/ui-svelte/src/utilities/seo/seo.svelte'
6+
7+
import luaLogo from '$lib/assets/images/lua-logo.png'
38
49
const content = `# Adding Scripts
510
6-
Just create a pull request. All scripts must have in their [PluginDef](http://jwmusic.nu/jwplugins/wiki/doku.php?id=jwlua:development#connect_to_finale_jw_lua):
11+
&gt; To add scripts, you'll need a GitHub account. If you don't have one, you can [sign up here](https://github.com/signup).
12+
13+
Once you've written your script, you'll be able to add it to the repository.
14+
15+
This guide assumes that you're not familiar with Git or GitHub (which is totally ok). However, if you are familiar with them, feel free to skip down to [Adding your script](#adding-your-script).
16+
17+
## Background on Git and GitHub
18+
19+
Git is a version control system that developers use to keep track of changes to their code. It's a very popular system, and it's used by a lot of companies. GitHub is a website that lets you host your code and make it available to others, and it uses Git to track the changes in the code.
20+
21+
Overall, you can think of it kind of like Google Docs. You can write code, and others can read it, and you can make changes to it. And everything is synced up so everyone knows what the "correct" version of the code is. And the way in which this is done is through forks, commits, and pull requests.
22+
23+
Here's what those terms mean.
24+
25+
### Forks
26+
27+
A fork is a copy of this repository that you can make changes to. In this guide, you're going to fork this repository (which is literally creating a line-by-line clone) and saving that fork onto your computer. That way, you can make changes to the code and then push those changes back to the original repository.
28+
29+
Forking a repository is a lot like just copying a Google Docs file.
30+
31+
### Commits
32+
33+
Commits are snapshots in time. They are save points. Once you edit, add, or delete several files, you "commit" them to group those changes together. Note that this is different than saving an individual file. You can save changes as many times as you want, but you only "commit" them once to—well—commit the changes.
34+
35+
### Pull requests
736
8-
- finaleplugin.Author
9-
- finaleplugin.Version (beta versions OK)
10-
- finaleplugin.RevisionNotes (if there are revisions and/or bug fixes)
11-
- Name, undo text, and description (in the \`return\` statement)
37+
By now you may have realized that you've made changes to a copy of this repository, not the original one. Pull requests allow you to merge those changes back into the original repository.
1238
13-
Note: All scripts added to the repo will have a CC1 license. See [LICENSE](https://github.com/Nick-Mazuk/jw-lua-scripts/blob/master/LICENSE) for specific terms. This is to encourage widespread use and encourage other JW Lua coders to build off your scripts.
39+
As part of the pull request process, other collaborators can review your code. This isn't a test to pass, but rather it's just a constructive step to help improve the quality of your contributions. Once your pull request is merged, you've contributed!
1440
15-
## Naming scripts
41+
---
1642
17-
Let's follow a unified syntax to help organize everything. Use snake case:
43+
In addition to this guide, there great resources for learning [Git](https://youtu.be/USjZcfj8yxE) and [GitHub](https://youtu.be/nhNq2kIvi9s) out there in case you'd like to learn more.
1844
19-
\`\`\`
20-
✓ articulation_delete_from_rests.lua
45+
## Adding your script
2146
22-
✖ articulationDeleteFromRests.lua
47+
&gt; In short, you'll create a pull request to add your script to the \`/src\` directory. This section will walk you through that process.
2348
24-
✖ articulationdeletefromrests.lua
49+
When using Git and GitHub, you can either use the terminal or GitHub Desktop, which is a desktop application that provides a nice interface for Git. In thie guide, we'll be using GitHub Desktop. You can download it at [https://desktop.github.com](https://desktop.github.com/).
2550
26-
✖ articulation-delete-from-rests.lua
51+
Make sure you download GitHub Desktop and sign in to your GitHub account. You only need to do this once.
2752
28-
✖ articulation_Delete_From_Rests.lua
29-
\`\`\`
53+
Checkout [GitHub's documentation](https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/overview/getting-started-with-github-desktop#part-1-installing-and-authenticating) for this for more detail.
3054
31-
Each word should take things from general to specific. So anything dealing with articulations should start with "articulations". Anything with page layout should start with "layout". See the [JW Lua docs for Category Tags](http://jwmusic.nu/jwplugins/wiki/doku.php?id=jwlua:finaleplugin_properties#categorytags_string) to find an good starting place.`
55+
And if you get stuck, you can always [get help](/docs/getting-started/getting-help).
56+
57+
### 1. Clone the repository
58+
59+
You will only need to clone the repository once. If you've already cloned it (e.g., you already contributed a script), you can skip this step.
60+
61+
1. Once you've signed into GitHub Desktop, go to the repository on GitHub. [https://github.com/Nick-Mazuk/jw-lua-scripts](https://github.com/Nick-Mazuk/jw-lua-scripts)
62+
2. You should see a bright green button that says "Fork". Click it! Then click "Open with GitHub Desktop."
63+
3. This will bring up a dialog in GitHub Desktop. Note the folder where it says "Local Path." This is the location GitHub desktop saves your fork of the repository on your computer. You will need this later.
64+
4. Click "Clone" to fork the repository. This will save a copy of the repository on your computer.
65+
5. Success! You've now cloned the repository.
66+
67+
### 2. Add your script
68+
69+
Once you've written your script, you'll now be able to add it to the repository.
70+
71+
You may wish to double-check your script with the [script checklist](/docs/getting-started/script-checklist) before adding it. Don't worry, though. If there's something you missed, we'll help you out.
72+
73+
1. Find the cloned repository on your computer. This is the "Local Path" you noted earlier.
74+
2. Inside the repository folder, you should see another folder named \`src\`. This is where all the scripts are stored. Add your script file (e.g., \`note_resize.lua\`) to this \`src\` folder.
75+
3. Go back to GitHub Desktop. You should now see that one file was added.
76+
4. Next, let's name the commit. In the lower left corner of GitHub Desktop, you should see a text field that either says "Summary (required)" or "Add [script name]". This is is the name of your commit. Go ahead and make sure it says "Add [script name]" (e.g., "Add note_resize.lua").
77+
5. Finally, let's commit the change. Again, in the lower left corner of GitHub Desktop, you should see a blue button that says "Commit to master". Click it!
78+
6. Success! You've now committed your change to the repository.
79+
80+
### 3. Create a pull request
81+
82+
Creating a pull request is the final step in adding your script to the repository. A pull request will merge your changes into the original repository.
83+
84+
If you've already contributed, skip the first three items and move to item #4: click "Push origin".
85+
86+
1. Go back to GitHub Desktop. At the top, you should see a button that says "Push origin". Click it!
87+
2. You'll receive a prompt to fork the repository. Select "Fork This Repository."
88+
3. Next, GitHub Desktop will ask you how you plan to use the fork. Select "To contribute to the parent project" because you want to contribute to the main repository for these scripts.
89+
4. Click the same "Push origin" button. This will sync your changes with GitHub's servers.
90+
5. Go to Branch &gt; Create Pull Request in the menu bar. This will take you to github.com to create the pull request.
91+
6. On GitHub.com, click "Create Pull Request"
92+
7. Add a descriptive title and description, then press "Create Pull Request"
93+
8. Success! You've now created a pull request!
94+
95+
We will now review your script and merge it into the main repository. We may ask for some changes before it is merged, but we'll help you through that process if needed.
96+
`
3297
</script>
3398

99+
<Seo
100+
title="Adding Scripts"
101+
siteName="JW Lua Scripts Docs"
102+
description="Use Finale faster than the blink of an eye. Simplify workflows to just one click. All for free, forever."
103+
canonicalUrl="{`https://jw-lua-scripts-docs.vercel.app/${$page.path}`}"
104+
openGraph="{{
105+
image: {
106+
src: `https://jw-lua-scripts-docs.vercel.app${luaLogo}`,
107+
width: 630,
108+
height: 630,
109+
},
110+
}}"
111+
/>
112+
34113
<Markdown content="{content}" headerIds />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<script lang="ts">
2+
import { page } from '$app/stores'
3+
4+
import Markdown from '@nick-mazuk/ui-svelte/src/typography/markdown/markdown.svelte'
5+
import Seo from '@nick-mazuk/ui-svelte/src/utilities/seo/seo.svelte'
6+
7+
import luaLogo from '$lib/assets/images/lua-logo.png'
8+
9+
const content = `# Getting help
10+
11+
There are a few great resources for getting help with JW Lua development:
12+
13+
- [The JW Lua Facebook group](https://www.facebook.com/groups/742277119576336/)
14+
- [Ask a question in the GitHub repo](https://github.com/Nick-Mazuk/jw-lua-scripts/issues/new?assignees=&labels=help&template=help.md&title=)
15+
16+
If you're having trouble with JW Lua in particular, you should ask a question in the Facebook group first. If you're having trouble with contributing to this project, ask a question in the GitHub repository.
17+
`
18+
</script>
19+
20+
<Seo
21+
title="Getting Help"
22+
siteName="JW Lua Scripts Docs"
23+
description="Use Finale faster than the blink of an eye. Simplify workflows to just one click. All for free, forever."
24+
canonicalUrl="{`https://jw-lua-scripts-docs.vercel.app/${$page.path}`}"
25+
openGraph="{{
26+
image: {
27+
src: `https://jw-lua-scripts-docs.vercel.app${luaLogo}`,
28+
width: 630,
29+
height: 630,
30+
},
31+
}}"
32+
/>
33+
34+
<Markdown content="{content}" headerIds />

0 commit comments

Comments
 (0)