Skip to content

Commit 323d70c

Browse files
committed
feat: created capsule for pascal dialect indicator
1 parent b2f9358 commit 323d70c

File tree

5 files changed

+59
-41
lines changed

5 files changed

+59
-41
lines changed

content/about/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Wirth believed that a programming language should provide a clear conceptual fra
1818
### Readability Above All
1919
Pascal's English-like syntax makes code self-documenting. When you read Pascal code, you understand not just *what* the program does, but *why* it does it. This clarity reduces bugs, simplifies maintenance, and makes collaboration natural.
2020

21-
```objectpascal
21+
```objectpascal {class="highlight capsule-fpc"}
2222
program CalculateAverage;
2323
var
2424
numbers: array[1..10] of real;

content/docs/_index.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Comprehensive guides and references for Pascal programming.
1414

1515
Pascal uses a clear, structured syntax that emphasizes readability:
1616

17-
```objectpascal
17+
```objectpascal {class="highlight capsule-fpc"}
1818
program ExampleProgram;
1919
2020
const
@@ -63,7 +63,7 @@ end.
6363

6464
**Structured Types:**
6565

66-
```objectpascal
66+
```objectpascal {class="highlight capsule-fpc"}
6767
{ Arrays }
6868
type
6969
TScores = array[1..10] of integer;
@@ -87,7 +87,7 @@ type
8787

8888
### File Operations
8989

90-
```objectpascal
90+
```objectpascal {class="highlight capsule-fpc"}
9191
program FileExample;
9292
var
9393
inputFile, outputFile: text;
@@ -114,7 +114,7 @@ end.
114114

115115
### Dynamic Arrays
116116

117-
```objectpascal
117+
```objectpascal {class="highlight capsule-fpc"}
118118
program DynamicArrayExample;
119119
type
120120
TIntArray = array of integer;
@@ -146,7 +146,7 @@ end.
146146

147147
### Object-Oriented Programming
148148

149-
```objectpascal
149+
```objectpascal {class="highlight capsule-fpc"}
150150
program OOPExample;
151151
152152
type
@@ -214,14 +214,14 @@ end.
214214
### Code Style
215215

216216
1. **Use meaningful names:**
217-
```objectpascal
217+
```objectpascal {class="highlight capsule-fpc"}
218218
var
219219
studentCount: integer; // Good
220220
sc: integer; // Avoid
221221
```
222222

223223
2. **Consistent indentation:**
224-
```objectpascal
224+
```objectpascal {class="highlight capsule-fpc"}
225225
if condition then
226226
begin
227227
statement1;
@@ -230,7 +230,7 @@ end.
230230
```
231231

232232
3. **Comment your code:**
233-
```objectpascal
233+
```objectpascal {class="highlight capsule-fpc"}
234234
{ Calculate compound interest }
235235
function CompoundInterest(principal, rate: real; years: integer): real;
236236
begin
@@ -240,7 +240,7 @@ end.
240240

241241
### Error Handling
242242

243-
```objectpascal
243+
```objectpascal {class="highlight capsule-fpc"}
244244
program ErrorHandlingExample;
245245
var
246246
number, divisor: integer;
@@ -298,7 +298,7 @@ end.
298298
The System unit is automatically included and provides core functionality:
299299

300300
**Memory Management:**
301-
```objectpascal
301+
```objectpascal {class="highlight capsule-fpc"}
302302
{ Dynamic memory allocation }
303303
var
304304
ptr: ^integer;
@@ -311,7 +311,7 @@ end;
311311
```
312312

313313
**String Functions:**
314-
```objectpascal
314+
```objectpascal {class="highlight capsule-fpc"}
315315
program StringFunctions;
316316
var
317317
text: string;
@@ -334,7 +334,7 @@ end.
334334

335335
Provides extended system utilities:
336336

337-
```objectpascal
337+
```objectpascal {class="highlight capsule-fpc"}
338338
uses SysUtils;
339339
340340
program SysUtilsExample;
@@ -364,7 +364,7 @@ end.
364364

365365
Mathematical functions and constants:
366366

367-
```objectpascal
367+
```objectpascal {class="highlight capsule-fpc"}
368368
uses Math;
369369
370370
program MathExample;
@@ -391,7 +391,7 @@ end.
391391

392392
### Generic Programming
393393

394-
```objectpascal
394+
```objectpascal {class="highlight capsule-fpc"}
395395
program GenericExample;
396396
397397
{$mode objfpc}
@@ -462,7 +462,7 @@ end.
462462

463463
### Interface Programming
464464

465-
```objectpascal
465+
```objectpascal {class="highlight capsule-fpc"}
466466
program InterfaceExample;
467467
468468
{$mode objfpc}
@@ -551,7 +551,7 @@ end.
551551

552552
### Multi-threading
553553

554-
```objectpascal
554+
```objectpascal {class="highlight capsule-fpc"}
555555
program ThreadExample;
556556
557557
{$mode objfpc}
@@ -613,7 +613,7 @@ end.
613613

614614
### SQLite Integration
615615

616-
```objectpascal
616+
```objectpascal {class="highlight capsule-fpc"}
617617
program DatabaseExample;
618618
619619
{$mode objfpc}
@@ -684,7 +684,7 @@ end.
684684

685685
### Basic Form Application
686686

687-
```objectpascal
687+
```objectpascal {class="highlight capsule-fpc"}
688688
unit MainForm;
689689
690690
{$mode objfpc}{$H+}
@@ -738,7 +738,7 @@ end.
738738

739739
### Memory Management Tips
740740

741-
```objectpascal
741+
```objectpascal {class="highlight capsule-fpc"}
742742
program PerformanceExample;
743743
744744
type
@@ -778,7 +778,7 @@ end.
778778

779779
### Compiler Directives
780780

781-
```objectpascal
781+
```objectpascal {class="highlight capsule-fpc"}
782782
program CompilerDirectives;
783783
784784
{$mode objfpc} // Object Pascal mode
@@ -814,7 +814,7 @@ end.
814814

815815
### Unit Testing Framework
816816

817-
```objectpascal
817+
```objectpascal {class="highlight capsule-fpc"}
818818
program TestExample;
819819
820820
{$mode objfpc}

content/learn/_index.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Choose your Pascal development environment:
2323

2424
Create a new file called `hello.pas`:
2525

26-
```objectpascal
26+
```objectpascal {class="highlight capsule-fpc"}
2727
program HelloWorld;
2828
begin
2929
writeln('Hello, Pascal!');
@@ -44,7 +44,7 @@ fpc hello.pas
4444

4545
Every Pascal program follows this basic structure:
4646

47-
```objectpascal
47+
```objectpascal {class="highlight capsule-fpc"} {wrapper="highlight capsule-fpc"}
4848
program ProgramName;
4949
5050
{ Constant declarations }
@@ -87,7 +87,7 @@ end.
8787

8888
Pascal has strong typing with these fundamental and practical types:
8989

90-
```objectpascal
90+
```objectpascal {class="highlight capsule-fpc"}
9191
var
9292
// Integer types
9393
age: integer; // -2,147,483,648 to 2,147,483,647
@@ -134,7 +134,7 @@ var
134134

135135
**Conditional Statements:**
136136

137-
```objectpascal
137+
```objectpascal {class="highlight capsule-fpc"}
138138
if age >= 18 then
139139
writeln('You are an adult')
140140
else
@@ -150,7 +150,7 @@ end;
150150

151151
**Loops:**
152152

153-
```objectpascal
153+
```objectpascal {class="highlight capsule-fpc"}
154154
{ For loop - counting up }
155155
for i := 1 to 10 do
156156
writeln('Number: ', i);
@@ -230,7 +230,7 @@ end;
230230

231231
### Procedures
232232

233-
```objectpascal
233+
```objectpascal {class="highlight capsule-fpc"}
234234
procedure greetUser(name: string);
235235
begin
236236
writeln('Hello, ', name, '!');
@@ -245,7 +245,7 @@ end.
245245

246246
### Functions
247247

248-
```objectpascal
248+
```objectpascal {class="highlight capsule-fpc"}
249249
function calculateArea(radius: real): real;
250250
begin
251251
calculateArea := 3.14159 * radius * radius;
@@ -280,7 +280,7 @@ end.
280280
### Arrays and Data Structures
281281

282282
**Static Arrays:**
283-
```objectpascal
283+
```objectpascal {class="highlight capsule-fpc"}
284284
program ArrayExample;
285285
var
286286
scores: array[1..5] of integer;
@@ -303,7 +303,7 @@ end.
303303
```
304304

305305
**Records (Structures):**
306-
```objectpascal
306+
```objectpascal {class="highlight capsule-fpc"}
307307
program RecordExample;
308308
type
309309
TStudent = record
@@ -333,7 +333,7 @@ end.
333333
### File Input/Output
334334

335335
**Reading from Files:**
336-
```objectpascal
336+
```objectpascal {class="highlight capsule-fpc"}
337337
program ReadFile;
338338
339339
uses
@@ -379,7 +379,7 @@ end.
379379
```
380380

381381
**Writing to Files:**
382-
```objectpascal
382+
```objectpascal {class="highlight capsule-fpc"}
383383
program NewTextFile;
384384
385385
uses
@@ -451,7 +451,7 @@ end.
451451

452452
## Debugging Tips
453453

454-
```objectpascal
454+
```objectpascal {class="highlight capsule-fpc"}
455455
{ Add debug output }
456456
writeln('Debug: Variable x = ', x);
457457
writeln('Debug: Entering function Calculate');

layouts/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h1>Pascal</h1>
4848

4949
Application.Run;
5050
end.` }}
51-
{{ highlight $webserverCode "objectpascal" "linenos=false" }}
51+
<div class="highlight capsule-fpc">{{ highlight $webserverCode "objectpascal" "linenos=false"}}</div>
5252
</div>
5353

5454
<div class="code-example" id="example-sorting">
@@ -78,7 +78,7 @@ <h1>Pascal</h1>
7878
Numbers.Free;
7979
end;
8080
end.` }}
81-
{{ highlight $sortingCode "objectpascal" "linenos=false" }}
81+
<div class="highlight capsule-fpc">{{ highlight $sortingCode "objectpascal" "linenos=false"}}</div>
8282
</div>
8383

8484
<div class="code-example" id="example-json">
@@ -99,7 +99,7 @@ <h1>Pascal</h1>
9999
JSON.Free;
100100
end;
101101
end.` }}
102-
{{ highlight $jsonCode "objectpascal" "linenos=false" }}
102+
<div class="highlight capsule-fpc">{{ highlight $jsonCode "objectpascal" "linenos=false"}}</div>
103103
</div>
104104

105105
<div class="code-example" id="example-filestream">
@@ -135,7 +135,7 @@ <h1>Pascal</h1>
135135
FileStream.Free;
136136
end;
137137
end.` }}
138-
{{ highlight $filestreamCode "objectpascal" "linenos=false" }}
138+
<div class="highlight capsule-fpc">{{ highlight $filestreamCode "objectpascal" "linenos=false"}}</div>
139139
</div>
140140

141141
<div class="code-example" id="example-sqlite">
@@ -180,7 +180,7 @@ <h1>Pascal</h1>
180180
Conn.Free;
181181
end;
182182
end.` }}
183-
{{ highlight $sqliteCode "objectpascal" "linenos=false" }}
183+
<div class="highlight capsule-fpc">{{ highlight $sqliteCode "objectpascal" "linenos=false"}}</div>
184184
</div>
185185

186186
<div class="code-example" id="example-csv">
@@ -217,7 +217,7 @@ <h1>Pascal</h1>
217217
CSV.Free;
218218
end;
219219
end.` }}
220-
{{ highlight $csvCode "objectpascal" "linenos=false" }}
220+
<div class="highlight capsule-fpc">{{ highlight $csvCode "objectpascal" "linenos=false"}}</div>
221221
</div>
222222

223223
<div class="code-example" id="example-concurrent">
@@ -276,7 +276,7 @@ <h1>Pascal</h1>
276276
end.
277277

278278
` }}
279-
{{ highlight $concurrentCode "objectpascal" "linenos=false" }}
279+
<div class="highlight capsule-fpc">{{ highlight $concurrentCode "objectpascal" "linenos=false"}}</div>
280280
</div>
281281
</div>
282282
</div>

static/css/main.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,24 @@ a:hover {
424424
overflow: hidden;
425425
border: 1px solid var(--border-color);
426426
box-shadow: 0 2px 4px var(--shadow);
427+
position: relative;
428+
}
429+
430+
/* Pascal compatibility capsule */
431+
.highlight.capsule-fpc::before {
432+
content: 'FPC';
433+
position: absolute;
434+
top: var(--spacing-sm);
435+
right: var(--spacing-sm);
436+
background-color: var(--accent-primary);
437+
color: white;
438+
padding: 0.25rem 0.5rem;
439+
border-radius: 12px;
440+
font-size: 0.75rem;
441+
font-weight: 600;
442+
text-transform: uppercase;
443+
letter-spacing: 0.5px;
444+
z-index: 10;
427445
}
428446

429447
pre {

0 commit comments

Comments
 (0)