Skip to content

Commit f57c300

Browse files
committed
probably fixed
1 parent 2afc8ae commit f57c300

9 files changed

Lines changed: 75 additions & 41 deletions

File tree

.gitattributes

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# default for csharp files.
1111
# Note: This is only used by command line
1212
###############################################################################
13-
#*.cs diff=csharp
13+
*.cs diff=csharp
1414

1515
###############################################################################
1616
# Set the merge driver for project and solution files
@@ -77,7 +77,9 @@
7777
# This should fix it.
7878
*.cs linguist-language=C#
7979

80+
# Documentation
8081
*.md linguist-documentation
81-
*.st linguist-vendored
82+
*.html linguist-documentation
8283

83-
site/** linguist-vendored
84+
# Throwback to when github thought this repo contained 74% smalltalk
85+
*.st linguist-vendored

.github/workflows/deploy_docs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@ jobs:
2424
restore-keys: |
2525
mkdocs-material-
2626
- run: pip install -r requirements-docs.txt
27-
- run: mkdocs gh-deploy --force
27+
# This is commented out because I don't think
28+
# we have to force push but just in case...
29+
#- run: mkdocs gh-deploy --force
30+
- run: mkdocs gh-deploy
31+
# ^ comment this if we end up force pushing

docs/api/csharp/index.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,40 @@ RSML can be installed in 2 ways: **package reference** (via NuGet) or **project
88
Installing RSML via its NuGet package is the recommended way to install RSML, as it guarantees stability.
99

1010
=== ".NET CLI"
11-
Simply run the following line in the terminal.
12-
1311
```bash
14-
dotnet add package RSML --version 1.0.5
12+
dotnet add package OceanApocalypseStudios.RSML --version 2.0.0
1513
```
1614

1715
=== "Project File"
18-
To install RSML via your project file, simply ass the following line to an `#!xml <ItemGroup>`.
19-
20-
```xml
21-
<PackageReference Include="RSML" Version="1.0.5" />
16+
```xml title="ItemGroup"
17+
<PackageReference Include="OceanApocalypseStudios.RSML" Version="2.0.0" />
2218
```
2319

2420
=== "Visual Studio (PMC)"
25-
If you use Visual Studio, you can instead run the following line in the builtin **Package Manager Console**.
21+
```powershell title="VS Package Manager Console"
22+
NuGet\Install-Package OceanApocalypseStudios.RSML -Version 2.0.0
23+
```
24+
25+
=== "Central Package Management (CPM)"
26+
```xml title="Directory.Packages.props"
27+
<PackageVersion Include="OceanApocalypseStudios.RSML" Version="2.0.0" />
28+
```
2629

27-
```powershell
28-
NuGet\Install-Package RSML -Version 1.0.5
30+
```xml title="Project File"
31+
<PackageReference Include="OceanApocalypseStudios.RSML" />
2932
```
3033

3134
### Project Reference _(Not recommended)_
3235
If, for whatever reason, you need the latest nightly updates, you may also add the RSML project to your solution.
3336

34-
Please keep in mind that not all nightly updates are guaranteed to be bug-free or stable. Nightly updates are also not documented, only stable versions are.
37+
!!! warning
38+
Please keep in mind that not all nightly updates are guaranteed to be bug-free or stable. Nightly updates are also not documented, only stable versions are.
3539

3640
```bash
37-
cd YourSolution/YourProject/
38-
# Assuming you've got the RSML project at YourSolution/RSML/
39-
dotnet add reference ../RSML/RSML.csproj
41+
# Adapt this to your solution structure
42+
cd src/MyAwesomeProject/
43+
dotnet add reference ../../include/RSML/
4044
```
4145

42-
1. If your solution is included in a `git` repository already, consider using [Git Submodules](https://git-scm.com/docs/git-submodule) instead.
46+
???+ tip "Git Submodules"
47+
If your solution is included in a `git` repository already, consider using [Git Submodules](https://git-scm.com/docs/git-submodule) instead.

docs/api/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!-- or any later version published by the Free Software Foundation; -->
55
<!-- with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. -->
66

7-
# RSML as an API
7+
# RSML's API
88
!!! tip
99
It's recommended to know the actual [language](../language/index.md) itself before learning how to use RSML programmatically.
1010

docs/cli/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# RSML directly in your Terminal
2-
Red Sea's CLI (`RSML.CLI`) was made with the intention of serving as a quick, easy-to-use and simple way to evaluate RSML files using the [`official-25`](../language/standards/official-25.md) and [`roadlike`](../language/standards/roadlike.md) [language standards](../language/standards/index.md).
1+
# RSML's CLI
2+
Red Sea Markup Language's CLI (`RSML.CLI`) was made with the intention of serving as a quick, easy-to-use and simple way to evaluate RSML files using the [`official-25`](../language/standards/official-25.md) and [`roadlike`](../language/standards/roadlike.md) [language standards](../language/standards/index.md).
33

44
It is used by [RSML for Python](../api/python/index.md) to simulate using the actual RSML DLL, even though that's not what actually happens. At least, not directly via Python.
55

docs/language/implementations.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ Anyone can implement their own RSML parser and evaluator, but one should do thei
33

44
Furthermore, it's highly recommended to inform the implementation's users about the level of compliance with the RSML specification, including any known limitations or deviations.
55

6+
## Compliance
7+
For an implementation to be 100% compliant with RSML's specification, it must define: all special actions defined in the specification and no more than those; comments exactly as specified; logic paths with the same syntax, structure and overloads; arguments with the same meaning and functionality; same semantics.
8+

docs/language/index.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. -->
66

77

8-
# RSML as a Language
8+
# RSML, the Language
99

1010
## Abstract
1111
**Red Sea Markup Language** (RSML) is a simple declarative markup language created for the purpose of following logic paths based on the host's operating system and CPU architecture.
@@ -345,7 +345,9 @@ These are built into the language and cannot be changed whatsoever _(unless you
345345

346346
RSML is evaluated from **start to finish** _([see Advanced Representation of the Process Flow](#advanced-representation))_, meaning that the **very first** logic path **with a return operator in it** that matches will be used and the evaluation ends there. All the logic beyond that point is ignored completely, including comments and special actions.
347347

348-
### Simplified Representation <!-- md:version 2.0.0-prerelease8 -->
348+
### Simplified Representation
349+
Valid as of <!-- md:version 2.0.0-prerelease8 -->.
350+
349351
``` mermaid
350352
---
351353
title: Simplified Representation of the Evaluation Process Flow
@@ -360,7 +362,9 @@ flowchart LR
360362
E -->B;
361363
```
362364

363-
### Advanced Representation <!-- md:version 2.0.0-prerelease8 -->
365+
### Advanced Representation
366+
Valid as of <!-- md:version 2.0.0-prerelease8 -->.
367+
364368
``` mermaid
365369
---
366370
title: Advanced Representation of the Evaluation Process Flow
@@ -415,7 +419,7 @@ The recommended file extension for RSML files is `.rsea`, but other extensions m
415419
## Syntax Reference
416420
This is a quick reference sheet on RSML's syntax.
417421

418-
???+ example "Quick syntax reference"
422+
!!! example "Quick syntax reference"
419423
```rsea
420424
# This is a comment
421425

@@ -445,7 +449,7 @@ This is a quick reference sheet on RSML's syntax.
445449
## What might be coming soon?
446450
Well, you haven't heard this from me, but there are plans to add more features to RSML in future versions, such as:
447451

448-
- **Logical INBETWEEN operator** in logic paths, to allow for more complex matching conditions.
452+
- **Logical `INBETWEEN` operator** in logic paths, to allow for more complex matching conditions.
449453
- **Line-NOT and Argument-NOT operators** to negate matches.
450454
- **Support for more operating systems and CPU architectures** as they become relevant.
451455
- **Enhanced error handling and reporting** for better debugging.

material/overrides/hooks/shortcodes.py

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def replace(match: re.Match):
6161
# Otherwise, raise an error
6262
raise RuntimeError(f"Unknown shortcode: {type}")
6363

64+
print(f"DEBUG: path sep is {os.sep}")
65+
6466
# Find and replace all external asset URLs in current page
6567
return re.sub(
6668
r"<!-- md:(\w+)(.*?) -->",
@@ -93,21 +95,35 @@ def get_linkable_setting(type: str) -> str:
9395

9496

9597
def _resolve_path(path: str, page: Page, files: Files):
96-
path, anchor, *_ = f"{path}#".split("#")
97-
98-
print(f"DEBUG: {path} ({anchor})")
99-
100-
path = _resolve(files.get_file_from_path(path), page)
101-
return "#".join([path, anchor]) if anchor else path
98+
path_part, sep, anchor = path.partition("#")
99+
anchor = anchor if sep else None
100+
101+
print(f"DEBUG: {path_part} ({anchor})")
102+
103+
resolved = _resolve(files.get_file_from_path(path_part), page)
104+
105+
print(f"DEBUG [new]: {resolved}")
106+
107+
return f"{resolved}#{anchor}" if anchor is not None else resolved
102108

103109

104110
def _resolve(file: File, page: Page):
105-
path = os.path.relpath(file.src_uri, page.file.src_uri)
111+
print(f"DEBUG file.src_uri ==> {file.src_uri}")
112+
print(f"DEBUG page.file.src_uri ==> {page.file.src_uri}")
113+
114+
src = os.path.abspath(file.src_uri)
115+
page_src = os.path.abspath(page.file.src_uri)
116+
rel = os.path.relpath(src, start=os.path.dirname(page_src))
117+
118+
print(f"DEBUG: {file.src_uri} & {page.file.src_uri} || {src} & {page_src}")
119+
print(f"DEBUG: path sep is {os.pathsep}")
120+
print(f"DEBUG: relpath ==> {rel}")
121+
print(f"DEBUG: ext ==> {os.path.extsep}")
106122

107-
print(f'DEBUG: {file.src_uri} & {page.file.src_uri}')
108-
print(f'DEBUG: path sep is {os.pathsep}; {os.sep}')
123+
norm = os.path.normpath(rel)
124+
print(f"DEBUG: norm ==> {norm}")
109125

110-
return os.sep.join(path.split(os.sep)[1:])
126+
return os.path.extsep.join(norm.split(os.path.extsep)[:-1]) if os.path.extsep in norm else norm
111127

112128

113129
class Badges:

mkdocs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,13 @@ markdown_extensions:
229229
nav:
230230
- Home: index.md
231231
- Why use RSML?:
232-
- Why RSML?: why/index.md
232+
- _: why/index.md
233233
- Alternatives to RSML: why/alternatives.md
234234
- Language:
235-
- RSML as a Language: language/index.md
235+
- _: language/index.md
236236
- RSML Implementations: language/implementations.md
237237
- API:
238-
- RSML as an API: api/index.md
238+
- _: api/index.md
239239
- Guides:
240240
- About our Guides: api/guides/index.md
241241
- Easy:
@@ -268,7 +268,7 @@ nav:
268268
#- Getting Started: api/cpp/index.md
269269
#- Reference: api/cpp/reference.md
270270
- CLI:
271-
- RSML as a CLI: cli/index.md
271+
- _: cli/index.md
272272
- Commands: cli/commands.md
273273
- Real-world usage: cli/examples.md
274274
- Contributing: contributing.md

0 commit comments

Comments
 (0)