Skip to content

Commit

Permalink
chore: restructure files
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Dec 20, 2023
1 parent 3aa8328 commit dd6a8ce
Show file tree
Hide file tree
Showing 180 changed files with 25 additions and 5 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,27 @@ Collection of TextMate [grammars](./packages/tm-grammars/) and [themes](./packag

Packages are automatically updated daily and published to npm whenever there are changes.

Originally ported from [Shiki](https://github.com/shikijs/shiki).
Originally extracted from [Shiki](https://github.com/shikijs/shiki).

## Contribute

### Add a new grammar

1. Fork this repository
2. Add grammar source and metadata to [`sources-grammars.ts`](./sources-grammars.ts)
3. Add a code sample file `<id>.sample` for your language under [`./samples`](./samples). A sample should include a variety of language syntaxes and succinctly capture the idiosyncrasy of a language. Format requirements:
- Space for indentation
- Less than 100 columns if possible
- Link to source in the last line, for example `# From https://poignant.guide/book/chapter-5.html`
4. Run `pnpm run fetch` to download the grammar and verify it works
5. 🚀 Send in the PR!

### Add a new theme

1. Fork this repository
2. Add theme source and metadata to [`sources-themes.ts`](./sources-themes.ts)
3. Run `pnpm run fetch` to download the theme and verify it works
4. 🚀 Send in the PR!

## License

Expand Down
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
2 changes: 1 addition & 1 deletion scripts/grammars/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { downloadFromMarketplace } from '../shared/marketplace'
import { parseGitHubUrl, resolveSourceGitHub } from '../shared/github'
import { generateLicense } from '../shared/license'
import { parseFile } from '../shared/parse'
import { sources } from './sources'
import { sources } from '../../sources-grammars'

import type { GrammarSource } from './types'
import { cleanupGrammar } from './cleanup'
Expand Down
2 changes: 1 addition & 1 deletion scripts/themes/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { downloadFromMarketplace } from '../shared/marketplace'
import { parseFile } from '../shared/parse'
import type { ThemeInfo } from '../../packages/tm-themes/index'
import { generateLicense } from '../shared/license'
import { sources } from './sources'
import { sources } from '../../sources-themes'
import type { ThemeSource } from './types'
import { cleanupTheme } from './cleanup'

Expand Down
2 changes: 1 addition & 1 deletion scripts/grammars/sources.ts → sources-grammars.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { GrammarSource } from './types'
import type { GrammarSource } from './scripts/grammars/types'

export const sourcesVSCode: GrammarSource[] = [
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/themes/sources.ts → sources-themes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ThemeSource } from './types'
import type { ThemeSource } from './scripts/themes/types'

export const sourcesVSCode: ThemeSource[] = [
{
Expand Down

0 comments on commit dd6a8ce

Please sign in to comment.