-
Notifications
You must be signed in to change notification settings - Fork 0
docs: update documentation slugs #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
81f2992
chore: remove old docusaurus images
EscapedGibbon f0822d5
Merge remote-tracking branch 'origin/main' into 143-review-documentat…
EscapedGibbon f610577
docs: update filenames for proper link format
EscapedGibbon 207f8e3
docs: linter fix and update glossary
EscapedGibbon 858c913
docs: update basics and tutorials
EscapedGibbon 615e6b9
docs: minor fixes
EscapedGibbon 52efb48
docs: refactor image file structure and add filename check
EscapedGibbon fcf1d0a
fix: resolve conversations
EscapedGibbon e7f607f
refactor: rename check
EscapedGibbon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
EscapedGibbon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
function getAllFiles(dirPath) { | ||
let nonKebabElements = []; | ||
const entries = fs.readdirSync(dirPath, { withFileTypes: true }); | ||
|
||
const kebabCaseRegex = /^[a-z0-9]+(?:-[a-z0-9]+)*$/; | ||
|
||
for (const entry of entries) { | ||
// Skip certain files/folders | ||
if ( | ||
entry.name === '.DS_Store' || | ||
entry.name === 'images' || | ||
entry.name === 'demos' || | ||
entry.name === '_category_.json' | ||
) { | ||
continue; | ||
} | ||
|
||
// Get the name without extension for files, or full name for directories | ||
const nameToTest = entry.isFile() | ||
? path.parse(entry.name).name | ||
: entry.name; | ||
|
||
if (!kebabCaseRegex.test(nameToTest)) { | ||
nonKebabElements.push(path.join(dirPath, entry.name)); | ||
} | ||
|
||
// Recursively check subdirectories | ||
if (entry.isDirectory()) { | ||
const subDirResults = getAllFiles(path.join(dirPath, entry.name)); | ||
nonKebabElements = nonKebabElements.concat(subDirResults); | ||
} | ||
} | ||
|
||
return nonKebabElements; | ||
} | ||
|
||
const folders = ['docs', 'blog']; | ||
|
||
for (const folder of folders) { | ||
const folderPath = path.join(__dirname, folder); | ||
const nonKebabFiles = getAllFiles(folderPath); | ||
if (nonKebabFiles.length !== 0) { | ||
throw new Error(`Non-kebab-case files found:\n${nonKebabFiles.join('\n')}`); | ||
} | ||
} | ||
console.log('All files have passed the check.'); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import DocCardList from '@theme/DocCardList'; | ||
|
||
# Basics | ||
|
||
<DocCardList /> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.