|
2 | 2 | import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
|
3 | 3 | import { getCollection } from 'astro:content';
|
4 | 4 | import { getFunctionInfo, parseFunctionSyntaxes, getFixedStaticOOPClass } from '@src/utils/functions';
|
5 |
| -import { renderInlineMarkdown, getSeeAlsoLinksForItem, extractVersion, isVersionLE } from '@src/utils/general'; |
| 5 | +import { renderInlineMarkdown, getSeeAlsoLinksForItem, extractVersion, isVersionLE, renderRevisionLink } from '@src/utils/general'; |
6 | 6 | import fs from "fs";
|
7 | 7 | import path from "path";
|
8 | 8 | import { Code } from '@astrojs/starlight/components';
|
@@ -59,6 +59,7 @@ if (func.data.server && func.data.server.examples) {
|
59 | 59 | ...func.data.server.examples.map((ex: any) => ({ ...ex, side: 'server' })),
|
60 | 60 | ];
|
61 | 61 | }
|
| 62 | +
|
62 | 63 | funcExamples = funcExamples.map((example: any) => {
|
63 | 64 | try {
|
64 | 65 | const luaCode = fs.readFileSync(path.resolve(`${funcPath}`, example.path), "utf8");
|
@@ -134,19 +135,23 @@ let funcSyntaxes = parseFunctionSyntaxes(func.id, func.data);
|
134 | 135 | <div class="added-updated-description-box-header">
|
135 | 136 | <p>
|
136 | 137 | {showRemoved ? (
|
137 |
| - <> |
138 |
| - <strong>Before</strong> {removedVersionRaw} |
139 |
| - </> |
| 138 | + <> |
| 139 | + <strong>Before</strong> <span set:html={renderRevisionLink(removedVersionRaw)} /> |
| 140 | + </> |
140 | 141 | ) : (
|
141 |
| - <> |
142 |
| - {showUpdated && ( |
143 |
| - <strong>Updated in {updatedVersionRaw}</strong> |
144 |
| - )} |
145 |
| - {showUpdated && showAdded && ' | '} |
146 |
| - {showAdded && ( |
147 |
| - <strong>Added in {addedVersionRaw}</strong> |
148 |
| - )} |
149 |
| - </> |
| 142 | + <> |
| 143 | + {showUpdated && ( |
| 144 | + <strong> |
| 145 | + Updated in <span set:html={renderRevisionLink(updatedVersionRaw)} /> |
| 146 | + </strong> |
| 147 | + )} |
| 148 | + {showUpdated && showAdded && ' | '} |
| 149 | + {showAdded && ( |
| 150 | + <strong> |
| 151 | + Added in <span set:html={renderRevisionLink(addedVersionRaw)} /> |
| 152 | + </strong> |
| 153 | + )} |
| 154 | + </> |
150 | 155 | )}
|
151 | 156 | </p>
|
152 | 157 | </div>
|
|
0 commit comments