Skip to content

Commit 534fd92

Browse files
Rename mta-keyword_linker.js
1 parent cee7130 commit 534fd92

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

web/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ pnpm-debug.log*
2121
.DS_Store
2222

2323
# tmLanguage file
24-
src/grammars/
24+
src/grammars/
25+
public/grammars/

web/mta_highlighting/generate-lua-tmlanguage.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const __dirname = path.dirname(__filename);
1010
const functionsDir = path.resolve(__dirname, '../../functions');
1111
const basePath = path.resolve(__dirname, './lua-base.tmLanguage.json');
1212
const outputPath = path.resolve(__dirname, '../src/grammars/lua-mta.tmLanguage.json');
13-
const publicPath = path.resolve(__dirname, '../public/lua-mta.tmLanguage.json');
13+
const publicPath = path.resolve(__dirname, '../public/grammars/lua-mta.tmLanguage.json');
1414

1515
const mtaKeywords = ['string','bool','boolean','number','int','float','element','player','vehicle','ped','object','building'];
1616

@@ -57,11 +57,14 @@ async function generateTmLanguage() {
5757
const baseGrammar = JSON.parse(fs.readFileSync(basePath, 'utf-8'));
5858
baseGrammar.patterns = [...patterns, ...(baseGrammar.patterns || [])];
5959

60-
// Ensure the directory exists
60+
// Ensure the directoroes exist
6161
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
62+
fs.mkdirSync(path.dirname(publicPath), { recursive: true });
63+
64+
// Write the updated grammar to the output file
6265
fs.writeFileSync(outputPath, JSON.stringify(baseGrammar, null, 2));
6366

64-
// Create file also in public directory for clickable keywords (public/mta-keywords_linker.js)
67+
// Create file also in public directory for clickable keywords
6568
fs.copyFileSync(outputPath, publicPath);
6669

6770
console.log(`Done!`);

web/public/mta-keywords_linker.js renamed to web/public/mta-keyword_linker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function initKeywordLinker() {
3131
});
3232
}
3333

34-
fetch('/lua-mta.tmLanguage.json')
34+
fetch('/grammars/lua-mta.tmLanguage.json')
3535
.then(res => res.json())
3636
.then(json => {
3737
allFunctions = new Set(extractFunctions(json));

web/src/components/CodeExamplesSection.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ const { codeExamples } = Astro.props;
2828
</div>
2929
)}
3030

31-
<script type="module" src="/mta-keywords_linker.js"></script>
31+
<script type="module" src="/mta-keyword_linker.js"></script>

0 commit comments

Comments
 (0)