Skip to content

Commit 0f3934e

Browse files
committed
Make link to wiki consistent with how LuaLS links to Lua docs
1 parent 75fa2bc commit 0f3934e

File tree

12 files changed

+21
-21
lines changed

12 files changed

+21
-21
lines changed

__tests__/api-writer/glua-api-writer.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ describe('GLua API Writer', () => {
123123
],
124124
});
125125

126-
expect(api).toEqual(`---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Explodes with an optional intensity.\n---\n---[(View on wiki)](na)\n---@param intensity? number The intensity of the explosion.\n---@return number # The amount of damage done.\nfunction _G.Explode(intensity) end\n\n`);
126+
expect(api).toEqual(`---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Explodes with an optional intensity.\n---\n---[View wiki](na)\n---@param intensity? number The intensity of the explosion.\n---@return number # The amount of damage done.\nfunction _G.Explode(intensity) end\n\n`);
127127
});
128128

129129
it('should allow overriding specific page addresses', () => {
@@ -246,7 +246,7 @@ describe('GLua API Writer', () => {
246246
],
247247
});
248248

249-
expect(api).toEqual(`---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Returns a table of all bots on the server.\n---\n---[(View on wiki)](na)\n---@return Player[] # A table only containing bots ( AI / non human players )\nfunction player.GetBots() end\n\n`);
249+
expect(api).toEqual(`---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Returns a table of all bots on the server.\n---\n---[View wiki](na)\n---@return Player[] # A table only containing bots ( AI / non human players )\nfunction player.GetBots() end\n\n`);
250250
});
251251

252252
it('should not convert table<type,otherType> to type,otherType[]', () => {
@@ -268,7 +268,7 @@ describe('GLua API Writer', () => {
268268
],
269269
});
270270

271-
expect(api).toEqual(`---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Returns a table of all bots on the server.\n---\n---[(View on wiki)](na)\n---@return table<number,Player> # A table only containing bots ( AI / non human players )\nfunction player.GetBots() end\n\n`);
271+
expect(api).toEqual(`---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Returns a table of all bots on the server.\n---\n---[View wiki](na)\n---@return table<number,Player> # A table only containing bots ( AI / non human players )\nfunction player.GetBots() end\n\n`);
272272
});
273273

274274
const testFuncPart = {
@@ -298,7 +298,7 @@ describe('GLua API Writer', () => {
298298
}
299299
],
300300
},
301-
output: `---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Just for testing.\n---\n---[(View on wiki)](na)\n---@param value string|number The value to fake.\nfunction test.Fake(value) end\n\n`,
301+
output: `---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Just for testing.\n---\n---[View wiki](na)\n---@param value string|number The value to fake.\nfunction test.Fake(value) end\n\n`,
302302
},
303303
// Case with pipes in the type (prefered in wiki)
304304
{
@@ -314,7 +314,7 @@ describe('GLua API Writer', () => {
314314
}
315315
],
316316
},
317-
output: `---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Just for testing.\n---\n---[(View on wiki)](na)\n---@param value string|number The value to fake.\nfunction test.Fake(value) end\n\n`,
317+
output: `---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Just for testing.\n---\n---[View wiki](na)\n---@param value string|number The value to fake.\nfunction test.Fake(value) end\n\n`,
318318
},
319319
// Case with pipes and table<x> conversion
320320
{
@@ -330,7 +330,7 @@ describe('GLua API Writer', () => {
330330
}
331331
],
332332
},
333-
output: `---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Just for testing.\n---\n---[(View on wiki)](na)\n---@param value string|table<number,Player> The value to fake.\nfunction test.Fake(value) end\n\n`,
333+
output: `---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Just for testing.\n---\n---[View wiki](na)\n---@param value string|table<number,Player> The value to fake.\nfunction test.Fake(value) end\n\n`,
334334
},
335335
// Case with table<x> conversion in both altType and type
336336
{
@@ -347,7 +347,7 @@ describe('GLua API Writer', () => {
347347
}
348348
],
349349
},
350-
output: `---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Just for testing.\n---\n---[(View on wiki)](na)\n---@param value table<number,Player>|table<Entity,number> The value to fake.\nfunction test.Fake(value) end\n\n`,
350+
output: `---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Just for testing.\n---\n---[View wiki](na)\n---@param value table<number,Player>|table<Entity,number> The value to fake.\nfunction test.Fake(value) end\n\n`,
351351
},
352352
])('should handle alternate types correctly', async ({ api, output }) => {
353353
const writer = new GluaApiWriter();
@@ -372,7 +372,7 @@ describe('GLua API Writer', () => {
372372
],
373373
});
374374

375-
expect(api).toEqual(`---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Just for testing.\n---\n---[(View on wiki)](na)\n---@param value table<string|number>|string The value to fake.\nfunction test.Fake(value) end\n\n`);
375+
expect(api).toEqual(`---![(Shared)](https://github.com/user-attachments/assets/a356f942-57d7-4915-a8cc-559870a980fc) Just for testing.\n---\n---[View wiki](na)\n---@param value table<string|number>|string The value to fake.\nfunction test.Fake(value) end\n\n`);
376376
});
377377

378378
it('should support structure table type', () => {
@@ -394,7 +394,7 @@ describe('GLua API Writer', () => {
394394
],
395395
});
396396

397-
expect(api).toEqual(`---![(Client)](https://github.com/user-attachments/assets/a5f6ba64-374d-42f0-b2f4-50e5c964e808) Returns where on the screen the specified position vector would appear.\n---\n---[(View on wiki)](na)\n---@return ToScreenData # The created Structures/ToScreenData.\nfunction Vector.ToScreen() end\n\n`);
397+
expect(api).toEqual(`---![(Client)](https://github.com/user-attachments/assets/a5f6ba64-374d-42f0-b2f4-50e5c964e808) Returns where on the screen the specified position vector would appear.\n---\n---[View wiki](na)\n---@return ToScreenData # The created Structures/ToScreenData.\nfunction Vector.ToScreen() end\n\n`);
398398
});
399399

400400
// number{ENUM_NAME} -> ENUM_NAME
@@ -420,7 +420,7 @@ describe('GLua API Writer', () => {
420420
],
421421
});
422422

423-
expect(api).toEqual(`---![(Client)](https://github.com/user-attachments/assets/a5f6ba64-374d-42f0-b2f4-50e5c964e808) Sets the fog mode.\n---\n---[(View on wiki)](na)\n---@param mode MATERIAL_FOG The fog mode.\nfunction render.FogMode(mode) end\n\n`);
423+
expect(api).toEqual(`---![(Client)](https://github.com/user-attachments/assets/a5f6ba64-374d-42f0-b2f4-50e5c964e808) Sets the fog mode.\n---\n---[View wiki](na)\n---@param mode MATERIAL_FOG The fog mode.\nfunction render.FogMode(mode) end\n\n`);
424424
});
425425

426426
// it('should be able to write Annotated API files directly from wiki pages', async () => {

__tests__/test-data/offline-sites/gmod-wiki/hook-player-initial-spawn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ GM = {}
192192
--- end )
193193
--- \`\`\`
194194
---
195-
---[(View on wiki)](https://wiki.facepunch.com/gmod/GM:PlayerInitialSpawn)
195+
---[View wiki](https://wiki.facepunch.com/gmod/GM:PlayerInitialSpawn)
196196
---@param player Player The player who spawned.
197197
---@param transition boolean If \`true\`, the player just spawned from a map transition.
198198
function GM:PlayerInitialSpawn(player, transition) end\n\n`;

__tests__/test-data/offline-sites/gmod-wiki/library-function-concommand-gettable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concommand = {}
1515
1616
---![(Shared and Menu)](https://github.com/user-attachments/assets/8f5230ff-38f7-493b-b9fc-cc70ffd5b3f4) Returns the tables of all console command callbacks, and autocomplete functions, that were added to the game with [concommand.Add](https://wiki.facepunch.com/gmod/concommand.Add).
1717
---
18-
---[(View on wiki)](https://wiki.facepunch.com/gmod/concommand.GetTable)
18+
---[View wiki](https://wiki.facepunch.com/gmod/concommand.GetTable)
1919
---@return table # Table of command callback functions.
2020
---@return table # Table of command autocomplete functions.
2121
function concommand.GetTable() end\n\n`;

__tests__/test-data/offline-sites/gmod-wiki/library-function-coroutine-resume.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ coroutine = {}
1717
1818
---![(Shared and Menu)](https://github.com/user-attachments/assets/8f5230ff-38f7-493b-b9fc-cc70ffd5b3f4) Resumes the given coroutine and passes the given vararg to either the function arguments or the [coroutine.yield](https://wiki.facepunch.com/gmod/coroutine.yield) that is inside that function and returns whatever yield is called with the next time or by the final return in the function.
1919
---
20-
---[(View on wiki)](https://wiki.facepunch.com/gmod/coroutine.resume)
20+
---[View wiki](https://wiki.facepunch.com/gmod/coroutine.resume)
2121
---@param coroutine thread Coroutine to resume.
2222
---@param ... any Arguments to be returned by coroutine.yield.
2323
---@return boolean # If the executed thread code had no errors occur within it.

custom/DMenu.AddOption.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---![(Client)](https://github.com/user-attachments/assets/a5f6ba64-374d-42f0-b2f4-50e5c964e808) Add an option to the DMenu
22
---
3-
---[(View on wiki)](https://wiki.facepunch.com/gmod/DMenu:AddOption)
3+
---[View wiki](https://wiki.facepunch.com/gmod/DMenu:AddOption)
44
---@param name string Name of the option.
55
---@param func? function Function to execute when this option is clicked.
66
---@return DMenuOption #Returns the created DMenuOption panel.

custom/DMenu.AddPanel.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
---
33
--- This invokes DScrollPanel:AddItem and will not create a new panel if a class name is passed, unlike Panel:Add.
44
---
5-
---[(View on wiki)](https://wiki.facepunch.com/gmod/DMenu:AddPanel)
5+
---[View wiki](https://wiki.facepunch.com/gmod/DMenu:AddPanel)
66
---@generic T : Panel
77
---@param pnl `T` The panel that you want to add.
88
function DMenu:AddPanel(pnl) end

custom/DMenu.AddSubMenu.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---![(Client)](https://github.com/user-attachments/assets/a5f6ba64-374d-42f0-b2f4-50e5c964e808) Add a sub menu to the DMenu
22
---
3-
---[(View on wiki)](https://wiki.facepunch.com/gmod/DMenu:AddSubMenu)
3+
---[View wiki](https://wiki.facepunch.com/gmod/DMenu:AddSubMenu)
44
---@param Name string Name of the sub menu.
55
---@param func? function Function to execute when this sub menu is clicked.
66
---@return DMenu, DMenuOption #DMenu - The created sub DMenu

custom/Global.DermaMenu.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---![(Client and menu)](https://github.com/user-attachments/assets/25d1a1c8-4288-4a51-9867-5e3bb51b9981) Creates a DMenu and closes any current menus.
22
---
3-
---[(View on wiki)](https://wiki.facepunch.com/gmod/Global.DermaMenu)
3+
---[View wiki](https://wiki.facepunch.com/gmod/Global.DermaMenu)
44
---@param keepOpen? boolean If we should keep other DMenus open (`true`) or not (`false`).
55
---@param parent? Panel The panel to parent the created menu to.
66
---@return DMenu #The created DMenu.

custom/Panel.Add.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---![(Client and menu)](https://github.com/user-attachments/assets/25d1a1c8-4288-4a51-9867-5e3bb51b9981) Adds the specified object to the panel.
22
---
3-
---[(View on wiki)](https://wiki.facepunch.com/gmod/Panel:Add)
3+
---[View wiki](https://wiki.facepunch.com/gmod/Panel:Add)
44
---@generic T : Panel
55
---@param object `T` The panel to be added (parented). Can also be:
66
--- * string Class Name - creates panel with the specified name and adds it to the panel.

custom/spawnmenu.AddCreationTab.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---![(Client)](https://github.com/user-attachments/assets/a5f6ba64-374d-42f0-b2f4-50e5c964e808) Inserts a new tab into the CreationMenus table, which will be used by the creation menu to generate its tabs (Spawnlists, Weapons, Entities, etc.)
22
---
3-
---[(View on wiki)](https://wiki.facepunch.com/gmod/spawnmenu.AddCreationTab)
3+
---[View wiki](https://wiki.facepunch.com/gmod/spawnmenu.AddCreationTab)
44
---@generic T : Panel
55
---@param name string What text will appear on the tab (I.E Spawnlists).
66
---@param _function fun(): T The function called to generate the content of the tab.

0 commit comments

Comments
 (0)