Skip to content

Commit 437e947

Browse files
committed
Filepath page - fix syntax & note
1 parent 24b76a3 commit 437e947

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

web/src/pages/reference/Filepath.astro

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
3+
import { Code } from '@astrojs/starlight/components';
4+
import NoteBox from '@src/components/NoteBox.astro';
35
---
46

57
<StarlightPage frontmatter={{
@@ -14,22 +16,20 @@ import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
1416
<div>It is also possible to use special filepaths in order to reference files from other resources. This can be done with the following syntax:
1517
<pre><code>:&lt;resourceName&gt;/file.ext</code></pre>
1618
<p>So, for example:</p>
17-
<pre><code>xmlLoadFile ( ":helpmanager/help.xml" )</code></pre>
19+
<Code code='xmlLoadFile ( ":helpmanager/help.xml" )' lang="lua"/>
1820
</div>
1921

20-
<div class="note">
21-
<strong>Note:</strong> Server-side filepaths which refer to resources will work correctly even if the other resource is not running. However, client-side filepaths require the target resource to be running.
22-
</div>
22+
<NoteBox type='info'>Server side filepaths which refer to resources will work correctly even if the other resource is not running. However client side filepaths require the target resource to be running.</NoteBox>
2323

2424
<h3>Client file security</h3>
2525

2626
<div>
2727
<p>To protect a client file from being read by another server, prepend the filepath with <code>@</code> when the file is created:</p>
28-
<pre><code>xmlCreateFile ( "@:myresource/someinfo.xml" )</code></pre>
29-
<pre><code>fileCreate ( "@listofthings.txt" )</code></pre>
28+
<Code code='xmlCreateFile ( "@:myresource/someinfo.xml" )' lang="lua"/>
29+
<Code code='fileCreate ( "@listofthings.txt" )' lang="lua"/>
3030
<p>To read a private file, <code>@</code> must also be prepended when the file is reopened:</p>
31-
<pre><code>xmlLoadFile ( "@:myresource/someinfo.xml" )</code></pre>
32-
<pre><code>fileOpen ( "@listofthings.txt" )</code></pre>
31+
<Code code='xmlLoadFile ( "@:myresource/someinfo.xml" )' lang="lua"/>
32+
<Code code='fileOpen ( "@listofthings.txt" )' lang="lua"/>
3333
<p>Notes:</p>
3434
<ul>
3535
<li>The filepath without <code>@</code> is read/writeable by all servers.</li>

0 commit comments

Comments
 (0)