-
-
Notifications
You must be signed in to change notification settings - Fork 118
docs: Update for available languageIds #8367
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 6 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
bbadb57
docs: availasble languages update
mrksbnc d709d8a
new docu page createdfor prog lang dictionaries
mrksbnc c346121
Merge branch 'main' into feat/8202-docs-lang-list-update
mrksbnc 10f798c
feat: new table component
mrksbnc faaaf3d
[autofix.ci] apply automated fixes
autofix-ci[bot] 7cd84c3
Merge branch 'main' into feat/8202-docs-lang-list-update
mrksbnc 7ba27b3
chore: PR comment update
mrksbnc 51853f5
chore: PR comment update
mrksbnc c3364ea
chore: PR comment update
mrksbnc a2f365a
chore: pnpm version update & available languages
mrksbnc 71b3838
[autofix.ci] apply automated fixes
autofix-ci[bot] f7ae7fe
Merge branch 'main' into feat/8202-docs-lang-list-update
mrksbnc c82e7e2
component and doc rework
mrksbnc b1cfc88
[autofix.ci] apply automated fixes
autofix-ci[bot] e0a10af
chore: typo update
mrksbnc c1b84a7
Update package.json
Jason3S 79566a4
Add tabbed cofnig
Jason3S 5ca6c1c
Make sure the site will build when deployed
Jason3S 160505c
Rename to file-types
Jason3S 32aa7b2
Merge branch 'main' into feat/8202-docs-lang-list-update
Jason3S 8b5e692
Update file-types.mdx
Jason3S 431c7c8
Re-order the sidebar under configuration
Jason3S 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
Some comments aren't visible on the classic Files Changed page.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,23 @@ | ||
| --- | ||
| title: 'Available Languages' | ||
|
mrksbnc marked this conversation as resolved.
Outdated
|
||
| categories: docs | ||
| # parent: Docs | ||
| sidebar_position: 4 | ||
| sidebar_label: Available Languages | ||
|
mrksbnc marked this conversation as resolved.
Outdated
|
||
| --- | ||
|
|
||
| import { LanguagesTable } from '@site/src/components/LanguagesTable'; | ||
|
mrksbnc marked this conversation as resolved.
Outdated
|
||
|
|
||
| # Available Languages & Triggers | ||
|
mrksbnc marked this conversation as resolved.
Outdated
|
||
|
|
||
| This page lists all supported programming languages and file types with their corresponding file extensions that triggers | ||
| the given language check in CSpell. | ||
|
mrksbnc marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Overview | ||
|
|
||
| CSpell automatically detects the programming language based on file extensions and applies the appropriate spell checking rules. The table below shows all supported languages and their associated file patterns. | ||
|
mrksbnc marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Supported Languages | ||
|
mrksbnc marked this conversation as resolved.
Outdated
|
||
|
|
||
| <LanguagesTable /> | ||
|
|
||
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,65 @@ | ||
| import React, { useState, useMemo } from 'react'; | ||
| import { programmingLangDefinitions } from '@cspell/filetypes'; | ||
| import './languages-table.scss'; | ||
|
|
||
| export const LanguagesTable: React.FC = () => { | ||
| const [searchTerm, setSearchTerm] = useState(''); | ||
|
|
||
| const filteredLanguages = useMemo(() => { | ||
| if (!searchTerm) return programmingLangDefinitions; | ||
|
|
||
| const term = searchTerm.toLowerCase(); | ||
| return programmingLangDefinitions.filter((lang) => { | ||
| const extensions = [...lang.extensions, ...(lang.filenames || [])].join(' ').toLowerCase(); | ||
| return ( | ||
| lang.id.toLowerCase().includes(term) || | ||
| (lang.description && lang.description.toLowerCase().includes(term)) || | ||
| extensions.includes(term) | ||
| ); | ||
| }); | ||
| }, [searchTerm]); | ||
|
|
||
| return ( | ||
| <div className="languages-table-container"> | ||
| <div className="search-box"> | ||
| <input | ||
| type="text" | ||
| placeholder="Search languages or extensions..." | ||
| value={searchTerm} | ||
| onChange={(e) => setSearchTerm(e.target.value)} | ||
| className="search-input" | ||
| /> | ||
| </div> | ||
|
|
||
| <div className="table-wrapper"> | ||
| <div className="table-header"> | ||
| <div className="table-cell">Language ID</div> | ||
| <div className="table-cell">Description</div> | ||
| <div className="table-cell">File Extensions & Filenames</div> | ||
| </div> | ||
|
|
||
| <div className="table-body"> | ||
| {filteredLanguages.map((lang, index) => ( | ||
| <div key={lang.id} className={`table-row ${index % 2 === 0 ? 'striped' : ''}`}> | ||
| <div className="table-cell"> | ||
| <code>{lang.id}</code> | ||
| </div> | ||
| <div className="table-cell">{lang.description || '-'}</div> | ||
| <div className="table-cell"> | ||
| <code className="extensions"> | ||
| {[...lang.extensions, ...(lang.filenames || [])].join(', ') || 'No specific extensions'} | ||
|
mrksbnc marked this conversation as resolved.
Outdated
|
||
| </code> | ||
| </div> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
|
|
||
| {filteredLanguages.length === 0 && <p className="no-results">No languages found matching "{searchTerm}"</p>} | ||
|
|
||
| <p className="total-count"> | ||
| Total: {filteredLanguages.length} language{filteredLanguages.length !== 1 ? 's' : ''} | ||
| </p> | ||
| </div> | ||
| ); | ||
| }; | ||
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,130 @@ | ||
| .languages-table-container { | ||
| width: 100%; | ||
|
|
||
| .search-box { | ||
| margin-bottom: 1.5rem; | ||
|
|
||
| .search-input { | ||
| width: 100%; | ||
| padding: 0.75rem; | ||
| font-size: 1rem; | ||
| border: 1px solid var(--ifm-color-emphasis-300); | ||
| border-radius: 0.5rem; | ||
| background-color: var(--ifm-background-color); | ||
| color: var(--ifm-font-color-base); | ||
| transition: border-color 0.2s ease; | ||
|
|
||
| &:focus { | ||
| outline: none; | ||
| border-color: var(--ifm-color-primary); | ||
| } | ||
|
|
||
| &::placeholder { | ||
| color: var(--ifm-color-emphasis-600); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .table-wrapper { | ||
| width: 100%; | ||
| border: 1px solid var(--ifm-color-emphasis-500); | ||
| border-radius: 0.5rem; | ||
| overflow: hidden; | ||
| } | ||
|
|
||
| .table-header { | ||
| display: grid; | ||
| grid-template-columns: 200px 1fr 2fr; | ||
| background-color: var(--ifm-table-head-background); | ||
| font-weight: bold; | ||
|
|
||
| .table-cell { | ||
| padding: 0.75rem 1rem; | ||
| border-right: 1px solid var(--ifm-color-emphasis-500); | ||
|
|
||
| &:last-child { | ||
| border-right: none; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .table-body { | ||
| .table-row { | ||
| display: grid; | ||
| grid-template-columns: 200px 1fr 2fr; | ||
| border-top: 1px solid var(--ifm-color-emphasis-500); | ||
|
|
||
| &.striped { | ||
| background-color: var(--ifm-table-stripe-background); | ||
| } | ||
|
|
||
| .table-cell { | ||
| padding: 0.75rem 1rem; | ||
| border-right: 1px solid var(--ifm-color-emphasis-500); | ||
|
|
||
| &:last-child { | ||
| border-right: none; | ||
| } | ||
|
|
||
| code { | ||
| &.extensions { | ||
| white-space: pre-wrap; | ||
| word-break: break-word; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .no-results { | ||
| text-align: center; | ||
| padding: 2rem; | ||
| color: var(--ifm-color-emphasis-600); | ||
| } | ||
|
|
||
| .total-count { | ||
| margin-top: 1.5rem; | ||
| font-size: 0.9rem; | ||
| color: var(--ifm-color-emphasis-600); | ||
| } | ||
| } | ||
|
|
||
| @media (max-width: 768px) { | ||
| .languages-table-container { | ||
| .table-header, | ||
| .table-body .table-row { | ||
| grid-template-columns: 150px 1fr 1.5fr; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @media (max-width: 576px) { | ||
| .languages-table-container { | ||
| .table-header, | ||
| .table-body .table-row { | ||
| grid-template-columns: 1fr; | ||
|
|
||
| .table-cell { | ||
| border-right: none; | ||
| border-bottom: 1px solid var(--ifm-color-emphasis-400); | ||
|
|
||
| &:last-child { | ||
| border-bottom: none; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .table-body .table-row { | ||
| padding: 0.5rem 0; | ||
|
|
||
| .table-cell { | ||
| &:before { | ||
| content: attr(data-label); | ||
| font-weight: bold; | ||
| display: block; | ||
| margin-bottom: 0.25rem; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
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.