Skip to content

Commit 06d2413

Browse files
committed
docs(en): merging all conflicts
2 parents 95812c5 + ee683ae commit 06d2413

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

custom/config-parser.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212

1313
## Επεκτάσεις Preparser
1414

15+
<<<<<<< HEAD
1516
> Διαθέσιμο από v0.37.0
17+
=======
18+
> Available since v0.37.0.
19+
>>>>>>> ee683ae81a2021c44b278d720a418ee0c6ddb537
1620
1721
:::warning
1822
Σημαντικό: όταν τροποποιείτε τη ρύθμιση παραμέτρων του preparser, πρέπει να σταματήσετε και να εκκινήσετε ξανά το slidev (η επανεκκίνηση μπορεί να μην είναι αρκετή).
@@ -25,7 +29,7 @@
2529
```ts
2630
import { definePreparserSetup } from '@slidev/types'
2731

28-
export default definePreparserSetup(({ filepath, headmatter }) => {
32+
export default definePreparserSetup(({ filepath, headmatter, mode }) => {
2933
return [
3034
{
3135
transformRawLines(lines) {
@@ -39,6 +43,7 @@ export default definePreparserSetup(({ filepath, headmatter }) => {
3943
})
4044
```
4145

46+
<<<<<<< HEAD
4247
Αυτό το παράδειγμα αντικαθιστά συστηματικά κάθε σειρά με την ένδειξη `@@@` με μια σειρά με την ένδειξη `γεια`. Παρουσιάζει τη δομή ενός αρχείου ρυθμίσεων του preparser και μερικές από τις κύριες έννοιες που περιλαμβάνει ο preparser:
4348
- Το `definePreparserSetup` πρέπει να κληθεί με μια συνάρτηση ως παράμετρο.
4449
- Η συνάρτηση λαμβάνει το path του αρχείου (του κεντρικού αρχείου παρουσίασης) και το headmatter (από το αρχείο md). Αυτή μπορεί να χρησιμοποιήσει αυτές τις πληροφορίες (π.χ. για να ενεργοποιήσει επεκτάσεις με βάση το αρχείο παρουσίασης).
@@ -47,6 +52,16 @@ export default definePreparserSetup(({ filepath, headmatter }) => {
4752
- μια συνάρτηση `transformRawLines(lines)` που εκτελείται αμέσως μετά το parsing του frontmatter του αρχείου md και λαμβάνει μια λίστα όλων των σειρών (από το αρχείο md). Η συνάρτηση μπορεί να μεταλλάσσει τη λίστα αυθαίρετα.
4853
- μια συνάρτηση `transformSlide(content, frontmatter)` που καλείται για κάθε διαφάνεια, αμέσως μετά τη διάσπαση του αρχείου, και λαμβάνει το περιεχόμενο της διαφάνειας ως συμβολοσειρά και το frontmatter της διαφάνειας ως αντικείμενο. Η συνάρτηση μπορεί να μεταβάλλει το frontmatter και πρέπει να επιστρέφει τη συμβολοσειρά του περιεχομένου (ενδεχομένως τροποποιημένη, ενδεχομένως `undefined` αν δεν έχουν γίνει τροποποιήσεις).
4954
- ένα `name`
55+
=======
56+
This example systematically replaces any `@@@` line by a line with `hello`. It illustrates the structure of a preparser configuration file and some of the main concepts the preparser involves:
57+
- `definePreparserSetup` must be called with a function as parameter.
58+
- The function receives the file path (of the root presentation file), the headmatter (from the md file) and, since v0.48.0, a mode (dev, build or export). It could use this information (e.g., enable extensions based on the presentation file or whether we are exporting a PDF).
59+
- The function must return a list of preparser extensions.
60+
- An extension can contain:
61+
- a `transformRawLines(lines)` function that runs just after parsing the headmatter of the md file and receives a list of all lines (from the md file). The function can mutate the list arbitrarily.
62+
- a `transformSlide(content, frontmatter)` function that is called for each slide, just after splitting the file, and receives the slide content as a string and the frontmatter of the slide as an object. The function can mutate the frontmatter and must return the content string (possibly modified, possibly `undefined` if no modifications have been done).
63+
- a `name`
64+
>>>>>>> ee683ae81a2021c44b278d720a418ee0c6ddb537
5065
5166
## Παράδειγμα επεκτάσεων Preparser
5267

0 commit comments

Comments
 (0)