Skip to content

Commit 9952320

Browse files
authored
Merge pull request #289 from noah-severyn/shortcode-improvements
Shortcode Improvements
2 parents c255c40 + e85bf9b commit 9952320

23 files changed

Lines changed: 591 additions & 471 deletions

README.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ Using the above example, you can see that a German language version of `index.md
7878

7979
Please note that if you need to add a new language to the list, you will also need to edit `/config/_default/languages.toml` (pay attention to indentation!). 2 letter ISO codes are used, for a list you can [refer to this document](https://www.iban.com/country-codes). Use the lower-case versions otherwise our documentation engine freaks out.
8080

81+
Lastly, create a copy of `/i18n/en.yaml` and name it with the newly added country code. This file contains the translations used by shortcodes throughout the site.
82+
8183
When you add content in other languages, note that you do not need to update the links to point to the language-specific version of the documentation - the documentation engine will sort this out for you.
8284

8385
### Convenience Functions
@@ -126,24 +128,33 @@ This is an example multi-line alert.
126128
{{< /alert >}}
127129
```
128130

131+
#### Carousel
132+
A carousel is a slideshow for cycling through a series of images. List the images you would like to include inside the carousel element. Each picture will automatically be sequentially numbered. To add a caption to an image, follow the image path with a pipe (`|`) and then the caption text:
133+
``` hugo
134+
{{< carousel >}}
135+
images/image-1.jpg
136+
images/image-2.jpg | Caption for image 2
137+
images/image-3.jpg
138+
images/image-4.jpg | Caption for image 4
139+
{{< /carousel >}}
140+
```
141+
129142
#### Details
130-
Shortcode:
143+
This shortcode is simply a wrapper for the HTML [details element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/details). Specify the summary text and optionally choose whether to have the element open by default instead of closed.
144+
131145
```
132-
{{< details <summary> [state] >}}
133-
<content>
146+
{{< details "Summary text" >}}
147+
Content goes here. This will be hidden until the user clicks to expand.
148+
{{< /details >}}
149+
150+
{{< details "Summary text" "open" >}}
151+
This content will be visible by default because state is set to "open".
134152
{{< /details >}}
135153
```
136154

137155
#### Document Status
138156

139-
This is a variation of the Alert shortcode however it has different statuses depending on what's required.
140-
141-
Shortcode:
142-
```
143-
{{< docstatus status="STATUS" >}}
144-
```
145-
146-
The following statuses are supported:
157+
This is a variation of the Alert shortcode with certain predefined statuses. The following statuses are supported:
147158

148159
* (blank) - Defaults to "not yet written"
149160
* `workinprogress` - Documentation is in progress and subject to change.
@@ -154,6 +165,10 @@ The following statuses are supported:
154165
* `obsolete` - States that no further development will occur on this component, but it is retained for compatibility reasons.
155166
* `untranslated` - Documentation has not been translated into your native language yet. This will gradually disappear as more efforts are put into translation for various locales.
156167

168+
```
169+
{{< docstatus status="STATUS" >}}
170+
```
171+
157172
#### Simple image
158173

159174
This will allow you to create quick, simple images that can be inserted into the body of documentation, with additional CSS classes.

assets/js/darkmode-init.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@ if (globalDark && (localMode === null)) {
55

66
localStorage.setItem('theme', 'dark');
77
document.documentElement.setAttribute('data-dark-mode', '');
8+
document.documentElement.setAttribute('data-bs-theme', 'dark');
89

910
}
1011

1112
if (globalDark && (localMode === 'dark')) {
1213

1314
document.documentElement.setAttribute('data-dark-mode', '');
15+
document.documentElement.setAttribute('data-bs-theme', 'dark');
1416

1517
}
1618

1719
if (localMode === 'dark') {
1820

1921
document.documentElement.setAttribute('data-dark-mode', '');
22+
document.documentElement.setAttribute('data-bs-theme', 'dark');
2023

2124
}

assets/js/darkmode.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ if (mode !== null) {
88

99
localStorage.setItem('theme', 'dark');
1010
document.documentElement.setAttribute('data-dark-mode', '');
11+
document.documentElement.setAttribute('data-bs-theme', 'dark');
1112

1213
} else {
1314

1415
localStorage.setItem('theme', 'light');
1516
document.documentElement.removeAttribute('data-dark-mode');
17+
document.documentElement.setAttribute('data-bs-theme', 'light');
1618

1719
}
1820

@@ -22,6 +24,7 @@ if (mode !== null) {
2224

2325
document.documentElement.toggleAttribute('data-dark-mode');
2426
localStorage.setItem('theme', document.documentElement.hasAttribute('data-dark-mode') ? 'dark' : 'light');
27+
document.documentElement.hasAttribute('data-dark-mode') ? document.documentElement.setAttribute('data-bs-theme', 'dark') : document.documentElement.setAttribute('data-bs-theme', 'light');
2528

2629
});
2730

assets/scss/components/_alerts.scss

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.alert {
2-
font-family: $font-family-monospace;
3-
font-size: $font-size-sm;
2+
font-size: $font-size-base;
43
}
54

65
.alert-icon {
@@ -61,73 +60,73 @@
6160
*/
6261

6362
.alert-secondary {
64-
color: #41464b;
65-
background-color: #e2e3e5;
66-
border-color: #d3d6d8;
63+
color: var(--bs-secondary-text);
64+
background-color: var(--bs-secondary-bg-subtle);
65+
border-color: var(--bs-secondary-border-subtle);
6766
}
6867

6968
.alert-secondary .alert-link {
70-
color: #34383c;
69+
color: var(--bs-secondary-text);
7170
}
7271

7372
.alert-success {
74-
color: #0f5132;
75-
background-color: #d1e7dd;
76-
border-color: #badbcc;
73+
color: var(--bs-success-text);
74+
background-color: var(--bs-success-bg-subtle);
75+
border-color: var(--bs-success-border-subtle);
7776
}
7877

7978
.alert-success .alert-link {
80-
color: #0c4128;
79+
color: var(--bs-success-text);
8180
}
8281

8382
.alert-info {
84-
color: #055160;
85-
background-color: #cff4fc;
86-
border-color: #b6effb;
83+
color: var(--bs-info-text);
84+
background-color: var(--bs-info-bg-subtle);
85+
border-color: var(--bs-info-border-subtle);
8786
}
8887

8988
.alert-info .alert-link {
90-
color: #04414d;
89+
color: var(--bs-info-text);
9190
}
9291

9392
.alert-warning {
94-
color: #664d03;
95-
background-color: #fff3cd;
96-
border-color: #ffecb5;
93+
color: var(--bs-warning-text);
94+
background-color: var(--bs-warning-bg-subtle);
95+
border-color: var(--bs-warning-border-subtle);
9796
}
9897

9998
.alert-warning .alert-link {
100-
color: #523e02;
99+
color: var(--bs-warning-text);
101100
}
102101

103102
.alert-danger {
104-
color: #842029;
105-
background-color: #f8d7da;
106-
border-color: #f5c2c7;
103+
color: var(--bs-danger-text);
104+
background-color: var(--bs-danger-bg-subtle);
105+
border-color: var(--bs-danger-border-subtle);
107106
}
108107

109108
.alert-danger .alert-link {
110-
color: #6a1a21;
109+
color: var(--bs-danger-text);
111110
}
112111

113112
.alert-light {
114-
color: #636464;
115-
background-color: #fefefe;
116-
border-color: #fdfdfe;
113+
color: var(--bs-light-text);
114+
background-color: var(--bs-light-bg-subtle);
115+
border-color: var(--bs-light-border-subtle);
117116
}
118117

119118
.alert-light .alert-link {
120-
color: #4f5050;
119+
color: var(--bs-light-text);
121120
}
122121

123122
.alert-dark {
124-
color: #141619;
125-
background-color: #d3d3d4;
126-
border-color: #bcbebf;
123+
color: var(--bs-dark-text);
124+
background-color: var(--bs-dark-bg-subtle);
125+
border-color: var(--bs-dark-border-subtle);
127126
}
128127

129128
.alert-dark .alert-link {
130-
color: #101214;
129+
color: var(--bs-dark-text);
131130
}
132131

133132
.alert .alert-link:hover,

content/docs/feature-guides/canals/index.md

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,64 +9,65 @@ images: []
99
url: "docs/feature-guides/canals"
1010
---
1111

12+
{{< docstatus status="legacy" >}}
13+
1214
## Overview
1315

1416
The CAN-AM is designed to work with either the **CAL SG Canals** by callagrafx (recommended) or the original **SG Canals** by SimGoober.
15-
Both of these are available in the [SC4D LEX Legacy - BSC Canals Collection](https://www.sc4evermore.com/index.php/downloads/download/14-park/277-sc4d-lex-legacy-bsc-canals-collection). This package also includes additional passenger and freight stations, as NAM CAN-AM only includes a single passenger station.
17+
Both of these are available in the [SC4D LEX Legacy - BSC Canals Collection](https://www.sc4evermore.com/index.php/downloads/download/14-park/277-sc4d-lex-legacy-bsc-canals-collection). This package also includes additional passenger and freight stations. Additional ferry skins may be found in the [SC4D LEX Legacy - BSC VDK Mods Ferries](https://www.sc4evermore.com/index.php/downloads/download/41-automata-mods/298-sc4d-lex-legacy-vdk-mods-ferries) package, among others.
1618

1719
The CAN-AM is available under **2 Network Features****Water Transport****Canal Addon Mod**. It is installed by default.
1820

19-
## Building CAN-AM Canals
20-
21-
The canal pieces are located under the Misc. Transit menu.
21+
Note that CAN-AM is an older feature that has not seen much new development in the past decade. As such, it is reliant on a limited array of semi-deprecated/legacy features, especially in terms of crosslinks with newer and more modern NAM features.
2222

23-
{{< img-simple src="images/can-am-menu-button.jpg" >}}
23+
## Building Canals
2424

25-
To build a functional canal with CAN-AM, start by building the outer walls of the canal with your canal set (in this case, the CAL SG Canals). In between the walls, place the CAN-AM pieces, which provide the actual transportation functionality. CAN-AM canals must be _at least 3 tiles wide:_ 2 tiles for the walls on each side, and at least 1 tile for the CAN-AM pieces.
25+
To build a functional canal with CAN-AM, start by building the outer walls of the canal with your chosen canal set (in this case, the CAL SG Canals). Use the CAN-AM pieces, located in the Misc. Transit menu, in between the outer walls. These pieces provide the actual transportation functionality. Note that CAN-AM canals must be at least 3 tiles wide: 2 tiles for the walls on each side, and at least 1 tile for the CAN-AM pieces.
2626

27-
{{< gallery col-xl="2" col-lg="2" clickable="true" >}}
27+
{{< carousel >}}
2828
images/can-am-building-1.jpg
29-
images/can-am-building-2.jpg
30-
images/can-am-building-3.jpg
31-
images/can-am-building-4.jpg
32-
{{< /gallery >}}
29+
images/can-am-building-2.jpg | Place the outer walls of the canal
30+
images/can-am-menu-button.jpg | Use the functional canal pieces
31+
images/can-am-building-3.jpg | Place functional canal pieces in between the walls
32+
images/can-am-building-4.jpg | The finished canal must be minimum 3 tiles wide
33+
{{< /carousel >}}
3334

34-
Crossings with CAN-AM are currently puzzle piece-based. There are two versions of each crossing piece for the supported network crossings--one for the wall, and one for the open water. The open water tiles allow for canal traffic to pass underneath.
35+
### Crossings
3536

36-
The crossing can be assembled as follows:
37+
Crossings with CAN-AM are currently puzzle piece-based. There are two versions of each crossing piece for the supported network crossings: one for the wall, and one for the center canal traffic, allowing canal traffic to pass underneath. The crossing can be assembled as follows:
3738

38-
{{< gallery col-xl="2" col-lg="2" clickable="true" >}}
39-
images/can-am-building-5.jpg
40-
images/can-am-building-6.jpg
39+
{{< carousel >}}
40+
images/can-am-building-5.jpg | Place the center piece allowing traffic
41+
images/can-am-building-6.jpg | Place the edge pieces
4142
images/can-am-building-7.jpg
42-
{{< /gallery >}}
43+
{{< /carousel >}}
4344

44-
Neighbor Connections with CAN-AM are possible as well. Build a standard Road-based Neighbor Connection, and plop the CAN-AM pieces over top of the Road.
45+
### Neighbor Connections
4546

46-
{{< gallery col-xl="2" col-lg="2" clickable="true" >}}
47-
images/can-am-nc-1.jpg
48-
images/can-am-nc-2.jpg
49-
images/can-am-nc-3.jpg
50-
{{< /gallery >}}
47+
Neighbor Connections with CAN-AM are possible as well. Start by building a standard Road-based Neighbor Connection, and then plop the CAN-AM pieces over top of the Road.
5148

52-
Note that CAN-AM is an older feature that has not seen much new development in the past decade. As such, it is reliant on a limited array of semi-deprecated/legacy features, especially in terms of crosslinks with newer/more modern NAM features.
49+
{{< carousel >}}
50+
images/can-am-nc-1.jpg | Start with a road neighbor connection
51+
images/can-am-nc-2.jpg | Plop canal transit pieces over the road
52+
images/can-am-nc-3.jpg | Plop canal transit pieces over the road
53+
{{< /carousel >}}
5354

54-
## CAN-AM Stations
5555

56-
The CAN-AM canals function as a mass transit network and is technically based on the Bus vehicle type, meaning they need stations to properly function. The CAS 1x1 Ferry Terminal (included in the mod) is one option. Place it aligned with a canal wall, with the arrow pointing toward the water in the canal. The stations require Power in order to function.
56+
### Stations
5757

58-
{{< gallery col-xl="2" col-lg="2" clickable="true" >}}
58+
The CAN-AM canals function as a mass transit network based on the Bus vehicle type, meaning they need stations to properly function. The NAM includes one passenger ferry terminal - additional passenger and freight stations are available in the BSC Canals Collection linked above. Place the station aligned with a canal wall, with the arrow pointing toward the water in the canal. The stations require power in order to function.
59+
60+
{{< carousel >}}
5961
images/can-am-building-8.jpg
6062
images/can-am-building-9.jpg
6163
images/can-am-building-10.jpg
62-
{{< /gallery >}}
63-
64-
Note that in order for canal boat automata to appear on the canals, one of the "magic pieces" must be placed as part of the build process, preferrably in the open water next to the station. These include the + and T-intersections, as well as the 90° L-bend. (Thanks to <strong>CorinaMarie</strong> for this discovery!)
64+
images/can-am-building-10a.jpg | Place one of the "magic pieces"
65+
{{< /carousel >}}
6566

66-
{{< img-simple src="images/can-am-building-10a.jpg" >}}
67+
Note that in order for canal boat automata to appear on the canals, one of the "magic pieces" must be placed as part of the build process, preferably in the open water next to the station. These include the + and T-intersections, as well as the 90° L-bend. (Thanks to <strong>CorinaMarie</strong> for this discovery!)
6768

6869
{{< img-simple src="images/can-am-magic-pieces.jpg" >}}
6970

70-
If everything is done properly (at least two stations of the same type are needed for full functionality), traffic should begin to use the canal.
71+
If everything is done properly, traffic should begin to use the canal. Like any other mass transit network, at least two stations of the same type are needed for full functionality.
7172

7273
{{< img-simple src="images/can-am-building-11.jpg" >}}

content/docs/tech-specs/hybrid-railway.it.md

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,13 @@ images: []
99
url: "docs/tech-specs/hybrid-railway"
1010
---
1111
<!-- markdownlint-disable MD001 -->
12-
{{< feature-guide link="docs/feature-guides/hybrid-railway" mod="Hybrid Railway feature guide" >}}
12+
{{< feature-guide link="/docs/feature-guides/hybrid-railway" >}}
1313

14-
## Capacità della rete e del pezzo FLEX
15-
16-
### Chiave
17-
18-
<table class="table-bordered nam-compat-status processed">
19-
<tr>
20-
<td data-compat="yes"> SI </td>
21-
<td>Questa particolare caratteristica può essere costruita, con limitazioni minime (se non addirittura nulle).</td>
22-
</tr>
23-
<tr>
24-
<td data-compat="partial"> Supporto parziale </td>
25-
<td>Questa particolare caratteristica può essere costruita, ma non in tutti i casi. Verranno forniti dettagli su ciò che è/non è possibile. Il supporto parziale può essere dovuto a ragioni di progettazione intenzionali (come il realismo o la non fattibilità generale), o semplicemente perché la caratteristica non è stata completamente sviluppata.</td>
26-
</tr>
27-
<tr>
28-
<td data-compat="limited"> Supporto limitato </td>
29-
<td>Questa particolare caratteristica può essere costruita, ma solo in circostanze estremamente limitate. I casi possibili possono essere elencati, nella misura in cui è possibile. L'uso è a proprio rischio e pericolo.</td>
30-
</tr>
31-
<tr>
32-
<td data-compat="no"> Nessun supporto </td>
33-
<td>Questa particolare caratteristica non può essere costruita. Questa restrizione può essere dovuta a ragioni di progettazione intenzionali (come il realismo, la non fattibilità generale o le limitazioni del gioco) o semplicemente perché non è ancora stata sviluppata.</td>
34-
</tr>
35-
</table>
36-
37-
### Additional Notes
14+
## Chiave
3815

39-
**OxO**: OxO sta per "ortogonale x ortogonale" e si riferisce a una situazione in cui entrambe le reti sono ortogonali (in linea retta) lungo la griglia di gioco, intersecandosi perpendicolarmente (con angoli di 90° in tutti gli angoli).
16+
{{< compatibility-key >}}
4017

41-
**OxD**: OxD sta per "ortogonale x diagonale" e si riferisce a una situazione in cui la rete data è ortogonale (in linea retta) lungo la griglia di gioco e la rete trasversale è diagonale (con un angolo di 45°).
42-
43-
**DxO**: DxO sta per "diagonale x ortogonale" e si riferisce a una situazione in cui la rete di base è diagonale (con un angolo di 45°) e la rete trasversale è ortogonale (in linea retta) lungo la griglia di gioco.
44-
45-
**DxD**: DxD sta per "diagonale x diagonale" e si riferisce a una situazione in cui entrambe le reti sono diagonali (con un angolo di 45°) lungo la griglia di gioco e si intersecano perpendicolarmente (con angoli di 90° in tutti gli angoli).
18+
## Capacità della rete e del pezzo FLEX
4619

4720
### Available Height Levels
4821

0 commit comments

Comments
 (0)