diff --git a/docs/i18n/chinese-traditional/how-to-work-on-practice-projects.md b/docs/i18n/chinese-traditional/how-to-work-on-practice-projects.md index 9dc283fb5a..a2fd04d456 100644 --- a/docs/i18n/chinese-traditional/how-to-work-on-practice-projects.md +++ b/docs/i18n/chinese-traditional/how-to-work-on-practice-projects.md @@ -10,9 +10,7 @@ If you want to create new steps, the following tools simplify that process. ## create-next-step -A one-off script that will automatically add the next step based on the last step numbered as `step-xxx.md` where `xxx` represents the 3-digit step number of the last step. The challenge seed code will use the previous step's challenge seed code with the editable region markers (ERMs) removed. - -**Note:** This script also runs [reorder-steps](#reorder-steps). +A one-off script that will automatically add the next step based on the last step in the project. The challenge seed code will use the previous step's challenge seed code. ### How to run script: @@ -25,9 +23,9 @@ npm run create-next-step ## create-empty-steps -A one-off script that automatically adds a specified number of steps at a specific starting step number. The challenge seed code for all steps created will be empty. +A one-off script that automatically adds a specified number of steps. The challenge seed code for all steps created will be empty. -**Note:** This script also runs [reorder-steps](#reorder-steps). +**Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script: @@ -35,14 +33,14 @@ A one-off script that automatically adds a specified number of steps at a specif 2. Run the following npm command: ```bash -npm run create-empty-steps start=X num=Y # where X is the starting step number and Y is the number of steps to create. +npm run create-empty-steps X # where X is the number of steps to create. ``` -## create-step-between +## insert-step -A one-off script that automatically adds a new step between two existing consecutive steps. The challenge seed code will use the existing starting step's challenge seed code with the editable region markers (ERMs) removed. +A one-off script that automatically adds a new step at a specified position, incrementing all subsequent steps (both their titles and in their meta.json). The challenge seed code will use the previous step's challenge seed code with the editable region markers (ERMs) removed. -**Note:** This script also runs [reorder-steps](#reorder-steps). +**Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script: @@ -50,12 +48,14 @@ A one-off script that automatically adds a new step between two existing consecu 2. Run the following npm command: ```bash -npm run create-step-between start=X # where X is the starting step number +npm run insert-step X # where X is the position to insert the new step. ``` ## delete-step -A one-off script that deletes an existing step and then reorders the remaining step files in the project's folder as well as updates the `challengeOrder` property array in the project's `meta.json` with the new order of the steps. +A one-off script that deletes an existing step, decrementing all subsequent steps (both their titles and in their meta.json) + +**Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script @@ -63,55 +63,12 @@ A one-off script that deletes an existing step and then reorders the remaining s 2. Run the following npm command: ```bash -npm run delete-step num=x # where x is the step number to be deleted. +npm run delete-step X # where X is the step number to be deleted. ``` -## reorder-steps +## update-step-titles -A one-off script that automatically reorders the step files in a project's markdown files based on the filename. It also updates the `challengeOrder` property array in the project's `meta.json` with the new order of the steps. - -### Working Example - -Let's say you start with the following project structure: - -```bash -step-001.md -step-002.md -step-003.md -step-004.md -step-005.md -step-006.md -``` - -At some point you decide you need to delete `step-002.md`, because that step is no longer needed. Also, you decide to break down `step-004.md` into three steps instead of just one. - -To accomplish this restructure, you would need to delete `step-002.md` and then add a `step-004a.md` and a `step-004b.md`. The new folder structure would look like the following: - -```bash -step-001.md -step-003.md -step-004.md -step-004a.md -step-004b.md -step-005.md -step-006.md -``` - -You now need the file names to be `step-001.md` through `step-007.md`, because you removed one but gained two more for a net difference of one file. Also, the frontmatter of each file below a deleted step or added step will need to be modified by making the `title` key value match the new step number. For example, after renaming `step-3.md` to `step-2.md`, you would need to change `step-2.md`'s title from `Step 03` to `Step 02`. - -See below for the actual project folder changes needed: - -```bash -step-001.md -step-003.md renamed to step-002.md and title changes to "Step 2" -step-004.md renames to step-003.md and title changes to "Step 3" -step-004a.md renames to step-004.md and title changes to "Step 4" -step-004b.md renames to step-005.md and title changes to "Step 5" -step-005.md renames to step-006.md and title changes to "Step 6" -step-006.md renames to step-007.md and title changes to "Step 7" -``` - -Along with the above changes, the `challengeOrder` key in the project's `meta.json` file needs to reflect the new step order. This is needed because each step below a step deletion and/or step addition changes the `title` associated with each of the affected step's challenge `id`. +A one-off script that automatically updates the frontmatter in a project's markdown files so that they are consistent with the project's meta.json. It ensures that each step's title (and dashedName) match the meta's challengeOrder. ### How to run script @@ -119,5 +76,5 @@ Along with the above changes, the `challengeOrder` key in the project's `meta.js 2. Run the following npm command: ```bash -npm run reorder-steps +npm run update-step-titles ``` diff --git a/docs/i18n/chinese/how-to-work-on-practice-projects.md b/docs/i18n/chinese/how-to-work-on-practice-projects.md index 9dc283fb5a..a2fd04d456 100644 --- a/docs/i18n/chinese/how-to-work-on-practice-projects.md +++ b/docs/i18n/chinese/how-to-work-on-practice-projects.md @@ -10,9 +10,7 @@ If you want to create new steps, the following tools simplify that process. ## create-next-step -A one-off script that will automatically add the next step based on the last step numbered as `step-xxx.md` where `xxx` represents the 3-digit step number of the last step. The challenge seed code will use the previous step's challenge seed code with the editable region markers (ERMs) removed. - -**Note:** This script also runs [reorder-steps](#reorder-steps). +A one-off script that will automatically add the next step based on the last step in the project. The challenge seed code will use the previous step's challenge seed code. ### How to run script: @@ -25,9 +23,9 @@ npm run create-next-step ## create-empty-steps -A one-off script that automatically adds a specified number of steps at a specific starting step number. The challenge seed code for all steps created will be empty. +A one-off script that automatically adds a specified number of steps. The challenge seed code for all steps created will be empty. -**Note:** This script also runs [reorder-steps](#reorder-steps). +**Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script: @@ -35,14 +33,14 @@ A one-off script that automatically adds a specified number of steps at a specif 2. Run the following npm command: ```bash -npm run create-empty-steps start=X num=Y # where X is the starting step number and Y is the number of steps to create. +npm run create-empty-steps X # where X is the number of steps to create. ``` -## create-step-between +## insert-step -A one-off script that automatically adds a new step between two existing consecutive steps. The challenge seed code will use the existing starting step's challenge seed code with the editable region markers (ERMs) removed. +A one-off script that automatically adds a new step at a specified position, incrementing all subsequent steps (both their titles and in their meta.json). The challenge seed code will use the previous step's challenge seed code with the editable region markers (ERMs) removed. -**Note:** This script also runs [reorder-steps](#reorder-steps). +**Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script: @@ -50,12 +48,14 @@ A one-off script that automatically adds a new step between two existing consecu 2. Run the following npm command: ```bash -npm run create-step-between start=X # where X is the starting step number +npm run insert-step X # where X is the position to insert the new step. ``` ## delete-step -A one-off script that deletes an existing step and then reorders the remaining step files in the project's folder as well as updates the `challengeOrder` property array in the project's `meta.json` with the new order of the steps. +A one-off script that deletes an existing step, decrementing all subsequent steps (both their titles and in their meta.json) + +**Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script @@ -63,55 +63,12 @@ A one-off script that deletes an existing step and then reorders the remaining s 2. Run the following npm command: ```bash -npm run delete-step num=x # where x is the step number to be deleted. +npm run delete-step X # where X is the step number to be deleted. ``` -## reorder-steps +## update-step-titles -A one-off script that automatically reorders the step files in a project's markdown files based on the filename. It also updates the `challengeOrder` property array in the project's `meta.json` with the new order of the steps. - -### Working Example - -Let's say you start with the following project structure: - -```bash -step-001.md -step-002.md -step-003.md -step-004.md -step-005.md -step-006.md -``` - -At some point you decide you need to delete `step-002.md`, because that step is no longer needed. Also, you decide to break down `step-004.md` into three steps instead of just one. - -To accomplish this restructure, you would need to delete `step-002.md` and then add a `step-004a.md` and a `step-004b.md`. The new folder structure would look like the following: - -```bash -step-001.md -step-003.md -step-004.md -step-004a.md -step-004b.md -step-005.md -step-006.md -``` - -You now need the file names to be `step-001.md` through `step-007.md`, because you removed one but gained two more for a net difference of one file. Also, the frontmatter of each file below a deleted step or added step will need to be modified by making the `title` key value match the new step number. For example, after renaming `step-3.md` to `step-2.md`, you would need to change `step-2.md`'s title from `Step 03` to `Step 02`. - -See below for the actual project folder changes needed: - -```bash -step-001.md -step-003.md renamed to step-002.md and title changes to "Step 2" -step-004.md renames to step-003.md and title changes to "Step 3" -step-004a.md renames to step-004.md and title changes to "Step 4" -step-004b.md renames to step-005.md and title changes to "Step 5" -step-005.md renames to step-006.md and title changes to "Step 6" -step-006.md renames to step-007.md and title changes to "Step 7" -``` - -Along with the above changes, the `challengeOrder` key in the project's `meta.json` file needs to reflect the new step order. This is needed because each step below a step deletion and/or step addition changes the `title` associated with each of the affected step's challenge `id`. +A one-off script that automatically updates the frontmatter in a project's markdown files so that they are consistent with the project's meta.json. It ensures that each step's title (and dashedName) match the meta's challengeOrder. ### How to run script @@ -119,5 +76,5 @@ Along with the above changes, the `challengeOrder` key in the project's `meta.js 2. Run the following npm command: ```bash -npm run reorder-steps +npm run update-step-titles ``` diff --git a/docs/i18n/espanol/how-to-work-on-practice-projects.md b/docs/i18n/espanol/how-to-work-on-practice-projects.md index 9dc283fb5a..a2fd04d456 100644 --- a/docs/i18n/espanol/how-to-work-on-practice-projects.md +++ b/docs/i18n/espanol/how-to-work-on-practice-projects.md @@ -10,9 +10,7 @@ If you want to create new steps, the following tools simplify that process. ## create-next-step -A one-off script that will automatically add the next step based on the last step numbered as `step-xxx.md` where `xxx` represents the 3-digit step number of the last step. The challenge seed code will use the previous step's challenge seed code with the editable region markers (ERMs) removed. - -**Note:** This script also runs [reorder-steps](#reorder-steps). +A one-off script that will automatically add the next step based on the last step in the project. The challenge seed code will use the previous step's challenge seed code. ### How to run script: @@ -25,9 +23,9 @@ npm run create-next-step ## create-empty-steps -A one-off script that automatically adds a specified number of steps at a specific starting step number. The challenge seed code for all steps created will be empty. +A one-off script that automatically adds a specified number of steps. The challenge seed code for all steps created will be empty. -**Note:** This script also runs [reorder-steps](#reorder-steps). +**Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script: @@ -35,14 +33,14 @@ A one-off script that automatically adds a specified number of steps at a specif 2. Run the following npm command: ```bash -npm run create-empty-steps start=X num=Y # where X is the starting step number and Y is the number of steps to create. +npm run create-empty-steps X # where X is the number of steps to create. ``` -## create-step-between +## insert-step -A one-off script that automatically adds a new step between two existing consecutive steps. The challenge seed code will use the existing starting step's challenge seed code with the editable region markers (ERMs) removed. +A one-off script that automatically adds a new step at a specified position, incrementing all subsequent steps (both their titles and in their meta.json). The challenge seed code will use the previous step's challenge seed code with the editable region markers (ERMs) removed. -**Note:** This script also runs [reorder-steps](#reorder-steps). +**Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script: @@ -50,12 +48,14 @@ A one-off script that automatically adds a new step between two existing consecu 2. Run the following npm command: ```bash -npm run create-step-between start=X # where X is the starting step number +npm run insert-step X # where X is the position to insert the new step. ``` ## delete-step -A one-off script that deletes an existing step and then reorders the remaining step files in the project's folder as well as updates the `challengeOrder` property array in the project's `meta.json` with the new order of the steps. +A one-off script that deletes an existing step, decrementing all subsequent steps (both their titles and in their meta.json) + +**Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script @@ -63,55 +63,12 @@ A one-off script that deletes an existing step and then reorders the remaining s 2. Run the following npm command: ```bash -npm run delete-step num=x # where x is the step number to be deleted. +npm run delete-step X # where X is the step number to be deleted. ``` -## reorder-steps +## update-step-titles -A one-off script that automatically reorders the step files in a project's markdown files based on the filename. It also updates the `challengeOrder` property array in the project's `meta.json` with the new order of the steps. - -### Working Example - -Let's say you start with the following project structure: - -```bash -step-001.md -step-002.md -step-003.md -step-004.md -step-005.md -step-006.md -``` - -At some point you decide you need to delete `step-002.md`, because that step is no longer needed. Also, you decide to break down `step-004.md` into three steps instead of just one. - -To accomplish this restructure, you would need to delete `step-002.md` and then add a `step-004a.md` and a `step-004b.md`. The new folder structure would look like the following: - -```bash -step-001.md -step-003.md -step-004.md -step-004a.md -step-004b.md -step-005.md -step-006.md -``` - -You now need the file names to be `step-001.md` through `step-007.md`, because you removed one but gained two more for a net difference of one file. Also, the frontmatter of each file below a deleted step or added step will need to be modified by making the `title` key value match the new step number. For example, after renaming `step-3.md` to `step-2.md`, you would need to change `step-2.md`'s title from `Step 03` to `Step 02`. - -See below for the actual project folder changes needed: - -```bash -step-001.md -step-003.md renamed to step-002.md and title changes to "Step 2" -step-004.md renames to step-003.md and title changes to "Step 3" -step-004a.md renames to step-004.md and title changes to "Step 4" -step-004b.md renames to step-005.md and title changes to "Step 5" -step-005.md renames to step-006.md and title changes to "Step 6" -step-006.md renames to step-007.md and title changes to "Step 7" -``` - -Along with the above changes, the `challengeOrder` key in the project's `meta.json` file needs to reflect the new step order. This is needed because each step below a step deletion and/or step addition changes the `title` associated with each of the affected step's challenge `id`. +A one-off script that automatically updates the frontmatter in a project's markdown files so that they are consistent with the project's meta.json. It ensures that each step's title (and dashedName) match the meta's challengeOrder. ### How to run script @@ -119,5 +76,5 @@ Along with the above changes, the `challengeOrder` key in the project's `meta.js 2. Run the following npm command: ```bash -npm run reorder-steps +npm run update-step-titles ``` diff --git a/docs/i18n/german/how-to-work-on-practice-projects.md b/docs/i18n/german/how-to-work-on-practice-projects.md index 76c571a249..80adcec6a0 100644 --- a/docs/i18n/german/how-to-work-on-practice-projects.md +++ b/docs/i18n/german/how-to-work-on-practice-projects.md @@ -10,9 +10,7 @@ Wenn du neue Schritte erstellen willst, vereinfachen die folgenden Tools diesen ## Nächsten Schritt erstellen -Ein einmaliges Skript, das automatisch den nächsten Schritt hinzufügt, basierend auf dem letzten Schritt, der als `step-xxx.md` nummeriert ist, wobei `xxx` die dreistellige Schrittnummer des letzten Schritts darstellt. Der Aufgaben-Seed-Code (initialer Startcode im Editor) verwendet den Aufgaben-Seed-Code des vorherigen Schritts, wobei die Editable Region Markers (ERMs) entfernt werden. - -**Hinweis:** Dieses Skript führt auch [reorder-steps](#reorder-steps) aus. +A one-off script that will automatically add the next step based on the last step in the project. The challenge seed code will use the previous step's challenge seed code. ### So führst du das Skript aus: @@ -25,9 +23,9 @@ npm run create-next-step ## leere Schritte erstellen -Ein einmaliges Skript, das automatisch eine bestimmte Anzahl von Schritten bei einer bestimmten Startschrittnummer hinzufügt. Der Aufgaben-Seed-Code für alle erstellten Schritte wird leer sein. +A one-off script that automatically adds a specified number of steps. The challenge seed code for all steps created will be empty. -**Hinweis:** Dieses Skript führt auch [reorder-steps](#reorder-steps) aus. +**Note:** This script also runs [update-step-titles](#update-step-titles). ### So führst du das Skript aus: @@ -35,14 +33,14 @@ Ein einmaliges Skript, das automatisch eine bestimmte Anzahl von Schritten bei e 2. Führe den folgenden npm-Befehl aus: ```bash -npm run create-empty-steps start=X num=Y # wobei X die Startschrittnummer und Y die Anzahl der zu erstellenden Schritte ist. +npm run create-empty-steps X # where X is the number of steps to create. ``` -## Zwischenschritt erstellen +## insert-step -Ein einmaliges Skript, das automatisch einen neuen Schritt zwischen zwei bestehenden, aufeinanderfolgenden Schritten einfügt. Der Aufgaben-Seed-Code verwendet den bestehenden Aufgaben-Seed-Code des Startschritts, wobei die ERMs (Editable Region Markers) entfernt werden. +A one-off script that automatically adds a new step at a specified position, incrementing all subsequent steps (both their titles and in their meta.json). The challenge seed code will use the previous step's challenge seed code with the editable region markers (ERMs) removed. -**Hinweis:** Dieses Skript führt auch [reorder-steps](#reorder-steps) aus. +**Note:** This script also runs [update-step-titles](#update-step-titles). ### So führst du das Skript aus: @@ -50,12 +48,14 @@ Ein einmaliges Skript, das automatisch einen neuen Schritt zwischen zwei bestehe 2. Führe den folgenden npm-Befehl aus: ```bash -npm run create-step-between start=X # wobei X die Nummer des Anfangsschritts ist +npm run insert-step X # where X is the position to insert the new step. ``` ## Lösche eine Schritt -Ein einmaliges Skript, das einen bestehenden Schritt löscht und dann die verbleibenden Schrittdateien im Projektordner neu anordnet sowie das Eigenschaftsarray `challengeOrder` in der `meta.json` des Projekts mit der neuen Reihenfolge der Schritte aktualisiert. +A one-off script that deletes an existing step, decrementing all subsequent steps (both their titles and in their meta.json) + +**Note:** This script also runs [update-step-titles](#update-step-titles). ### So führst du das Skript aus @@ -63,61 +63,18 @@ Ein einmaliges Skript, das einen bestehenden Schritt löscht und dann die verble 2. Führe den folgenden npm-Befehl aus: ```bash -npm run delete-step num=x # wobei x die Schrittnummer ist, die gelöscht werden soll. +npm run delete-step X # where X is the step number to be deleted. ``` -## Schritte neu ordnen +## update-step-titles -Ein einmaliges Skript, das die Schrittdateien in den Markdown-Dateien eines Projekts automatisch anhand des Dateinamens neu anordnet. Außerdem wird das `challengeOrder` Eigenschaftsarray in der `meta.json` des Projekts mit der neuen Reihenfolge der Schritte aktualisiert. +A one-off script that automatically updates the frontmatter in a project's markdown files so that they are consistent with the project's meta.json. It ensures that each step's title (and dashedName) match the meta's challengeOrder. -### Praxisbeispiel - -Nehmen wir an, du beginnst mit der folgenden Projektstruktur: - -```bash -step-001.md -step-002.md -step-003.md -step-004.md -step-005.md -step-006.md -``` - -Irgendwann entscheidest du, dass du `Schritt-002.md` löschen musst, weil du diesen Schritt nicht mehr brauchst. Außerdem entscheidest du dich, `Schritt-004.md` in drei Schritte aufzuteilen, statt nur in einen. - -Um diese Umstrukturierung zu erreichen, musst du `step-002.md` löschen und dann eine `step-004a.md` und eine `step-004b.md` hinzufügen. Die neue Ordnerstruktur würde wie folgt aussehen: - -```bash -step-001.md -step-003.md -step-004.md -step-004a.md -step-004b.md -step-005.md -step-006.md -``` - -Die Dateinamen müssen jetzt `step-001.md` bis `step-007.md` lauten, denn du hast eine Datei entfernt, aber zwei weitere hinzugefügt, so dass die Differenz nur eine Datei beträgt. Außerdem muss das Frontmatter jeder Datei unterhalb eines gelöschten oder hinzugefügten Schritts geändert werden, indem der Schlüsselwert `title` an die neue Schrittnummer angepasst wird. Wenn du zum Beispiel `step-3.md` in `step-2.md` umbenannt hast, musst du den Titel von `step-2.md` von `Step 03` in `Step 02` ändern. - -Weiter unten findest du die erforderlichen Änderungen am Projektordner: - -```bash -step-001.md -step-003.md renamed to step-002.md and title changes to "Step 2" -step-004.md renames to step-003.md and title changes to "Step 3" -step-004a.md renames to step-004.md and title changes to "Step 4" -step-004b.md renames to step-005.md and title changes to "Step 5" -step-005.md renames to step-006.md and title changes to "Step 6" -step-006.md renames to step-007.md and title changes to "Step 7" -``` - -Zusammen mit den oben genannten Änderungen muss der Schlüssel `challengeOrder` in der Datei `meta.json` des Projekts die neue Schrittreihenfolge widerspiegeln. Das ist notwendig, weil jeder Schritt, der gelöscht und/oder hinzugefügt wird, den `title` ändert, der mit jeder der betroffenen Schritt-Aufgabe `id` verbunden ist. - -### Wie man das Skript ausführt +### How to run script 1. Wechsle in das Verzeichnis des Projekts. 2. Führe den folgenden npm-Befehl aus: ```bash -npm run reorder-steps +npm run update-step-titles ``` diff --git a/docs/i18n/italian/how-to-work-on-practice-projects.md b/docs/i18n/italian/how-to-work-on-practice-projects.md index 337359f511..f6077442c1 100644 --- a/docs/i18n/italian/how-to-work-on-practice-projects.md +++ b/docs/i18n/italian/how-to-work-on-practice-projects.md @@ -10,9 +10,7 @@ Se vuoi creare nuovi passi, i seguenti strumenti semplificano quel processo. ## create-next-step -Uno script eseguito una sola volta che aggiungerà automaticamente il prossimo passo basandosi sull'ultimo numerato come `step-xxx.md`, dove `xxx` rappresenta il numero a 3 cifre dell'ultimo passo. Il codice seed della sfida userà il codice seed di quella precedente, rimuovendo i marcatori delle regioni editabili (MRE). - -**Nota:** Questo script esegue anche [reorder-steps](#reorder-steps). +A one-off script that will automatically add the next step based on the last step in the project. The challenge seed code will use the previous step's challenge seed code. ### Come eseguire lo script: @@ -25,9 +23,9 @@ npm run create-next-step ## create-empty-steps -Uno script eseguito una sola volta che aggiunge automaticamente un determinato numero di passi a partire da un passo specifico. Il codice seed della sfida per tutti i passi creati sarà vuoto. +A one-off script that automatically adds a specified number of steps. The challenge seed code for all steps created will be empty. -**Nota:** Questo script esegue anche [reorder-steps](#reorder-steps). +**Note:** This script also runs [update-step-titles](#update-step-titles). ### Come eseguire lo script: @@ -35,14 +33,14 @@ Uno script eseguito una sola volta che aggiunge automaticamente un determinato 2. Esegui il seguente comando npm: ```bash -npm run create-empty-steps start=X num=Y # dove X è il numero del passo da cui iniziare e Y è il numero di passi da creare. +npm run create-empty-steps X # where X is the number of steps to create. ``` -## create-step-between +## insert-step -Uno script eseguito una sola volta che aggiunge automaticamente un passo in mezzo a due passi consecutivi già esistenti. Il codice seed della sfida userà il codice seed della sfida al passo di partenza già esistente, rimuovendo i marcatori delle regioni editabili (MRE). +A one-off script that automatically adds a new step at a specified position, incrementing all subsequent steps (both their titles and in their meta.json). The challenge seed code will use the previous step's challenge seed code with the editable region markers (ERMs) removed. -**Nota:** Questo script esegue anche [reorder-steps](#reorder-steps). +**Note:** This script also runs [update-step-titles](#update-step-titles). ### Come eseguire lo script: @@ -50,12 +48,14 @@ Uno script eseguito una sola volta che aggiunge automaticamente un passo in mezz 2. Esegui il seguente comando npm: ```bash -npm run create-step-between start=X # dove X è il passo iniziale di partenza +npm run insert-step X # where X is the position to insert the new step. ``` ## delete-step -Uno script eseguito una sola volta che cancella un passo esistente e poi riordina i passi rimanenti nella cartella del progetto e che aggiorna l'array della proprietà `challengeOrder` nel `meta.json` del progetto secondo il nuovo ordine dei passi. +A one-off script that deletes an existing step, decrementing all subsequent steps (both their titles and in their meta.json) + +**Note:** This script also runs [update-step-titles](#update-step-titles). ### Come eseguire lo script @@ -63,61 +63,18 @@ Uno script eseguito una sola volta che cancella un passo esistente e poi riordin 2. Esegui il seguente comando npm: ```bash -npm run delete-step num=x # dove x è il numero dello step da eliminare. +npm run delete-step X # where X is the step number to be deleted. ``` -## reorder-steps +## update-step-titles -Uno script eseguito una sola volta che riordina automaticamente i file dei passi nel markdown del progetto basandosi sui nomi dei file. Aggiorna anche l'array della proprietà `challengeOrder` nel `meta.json` del progetto secondo il nuovo ordine dei passi. +A one-off script that automatically updates the frontmatter in a project's markdown files so that they are consistent with the project's meta.json. It ensures that each step's title (and dashedName) match the meta's challengeOrder. -### Esempi di funzionamento - -Diciamo che inizi con la seguente struttura: - -```bash -step-001.md -step-002.md -step-003.md -step-004.md -step-005.md -step-006.md -``` - -A un certo punto decidi che hai bisogno di eliminare `part-002.md`, perché quel passo non è più necessario. Inoltre, decidi di dividere `step-004.md` in tre passi invece di uno. - -Per ottenere questa ristrutturazione, avresti bisogno di eliminare `step-002.md` e poi aggiungere un `step-4a.md` e un `step-4b.md`. La nuova struttura della cartella assomiglierà alla seguente: - -```bash -step-001.md -step-003.md -step-004.md -step-004a.md -step-004b.md -step-005.md -step-006.md -``` - -Adesso serve che i nomi dei file vadano da `step-001.md` a `step-007.md`, poiché ne hai rimosso uno ma ne hai aggiunti due, con una differenza netta di un file. Inoltre, la presentazione di ogni file sotto un passo rimosso o aggiunto dovrà essere modificata rendendo il valore della chiave `title` uguale al nuovo numero del passo. Ad esempio, dopo aver rinominato `part-3.md` in `step-2.md`, dovrai cambiare il titolo di `step-2.md` da `Step 03` a `Step 02`. - -Vedi qui sotto per gli effettivi cambiamenti necessari alla cartella del progetto: - -```bash -step-001.md -step-003.md rinominato a step-002.md e titolo cambiato a "Step 2" -step-004.md rinominato a step-003.md e titolo cambiato a "Step 3" -step-004a.md rinominato a step-004.md e titolo cambiato a "Step 4" -step-004b.md rinominato a step-005.md e titolo cambiato a"Step 5" -step-005.md rinominato a step-006.md e titolo cambiato a "Step 6" -step-006.md rinominato a step-007.md e titolo cambiato a "Step 7" -``` - -Insieme ai cambi qui sopra, la chiave `challengeOrder` nel file `meta.json` del progetto deve riflettere il nuovo ordine dei passi. Questo è necessario perché ogni passo sotto la cancellazione e/o l'aggiunta di un passo cambia il `title` associato ad ognuno degli `id` delle sfide ai passi interessati. - -### Come eseguire lo script +### How to run script 1. Vai alla directory del progetto. 2. Esegui il seguente comando npm: ```bash -npm run reorder-steps +npm run update-step-titles ``` diff --git a/docs/i18n/japanese/how-to-work-on-practice-projects.md b/docs/i18n/japanese/how-to-work-on-practice-projects.md index 34dda9fe34..084ba92756 100644 --- a/docs/i18n/japanese/how-to-work-on-practice-projects.md +++ b/docs/i18n/japanese/how-to-work-on-practice-projects.md @@ -10,9 +10,7 @@ ## 次のステップを作成する -一時スクリプトにより `step-xxx.md` と付番される最後のステップに基づいて、次のステップを自動的に追加します。`xxx` は最後のステップの 3 桁のステップ数を表します。 チャレンジシードコードは、前のステップのチャレンジシードコードを使用します。このシードコードでは編集可能なリージョンマーカー (ERM) が削除されています。 - -**注: ** このスクリプトは [ステップの並べ替え](#ステップを並べ替える) も実行します。 +A one-off script that will automatically add the next step based on the last step in the project. The challenge seed code will use the previous step's challenge seed code. ### スクリプトを実行する方法 @@ -25,9 +23,9 @@ npm run create-next-step ## 空のステップを作成する -一時スクリプトにより、特定の開始ステップ番号に指定されたステップ数を自動的に追加します。 作成された全ステップのチャレンジシードコードは空になります。 +A one-off script that automatically adds a specified number of steps. The challenge seed code for all steps created will be empty. -**注: ** このスクリプトは [ステップの並べ替え](#ステップを並べ替える) も実行します。 +**Note:** This script also runs [update-step-titles](#update-step-titles). ### スクリプトを実行する方法 @@ -35,14 +33,14 @@ npm run create-next-step 2. 以下の npm コマンドを実行します。 ```bash -npm run create-empty-steps start=X num=Y # where X is the starting step number and Y is the number of steps to create. +npm run create-empty-steps X # where X is the number of steps to create. ``` -## 中間ステップを作成する +## insert-step -一時スクリプトにより、 2 つの既存の連続したステップの間に自動的に新しいステップを追加します。 チャレンジシードコードは、既存の開始ステップのチャレンジシードコードを使用します。このシードコードでは編集可能なリージョンマーカー (ERM) が削除されています。 +A one-off script that automatically adds a new step at a specified position, incrementing all subsequent steps (both their titles and in their meta.json). The challenge seed code will use the previous step's challenge seed code with the editable region markers (ERMs) removed. -**注: ** このスクリプトは [ステップの並べ替え](#ステップを並べ替える) も実行します。 +**Note:** This script also runs [update-step-titles](#update-step-titles). ### スクリプトを実行する方法 @@ -50,12 +48,14 @@ npm run create-empty-steps start=X num=Y # where X is the starting step number a 2. 以下の npm コマンドを実行します。 ```bash -npm run create-step-between start=X # where X is the starting step number +npm run insert-step X # where X is the position to insert the new step. ``` ## ステップを削除する -一時スクリプトにより、既存のステップを削除して、プロジェクトフォルダー内の残りのステップファイルを並べ替えるます。また、プロジェクトの `meta.json` 内の `challengeOrder` プロパティ配列を、新しいステップ順序で更新します。 +A one-off script that deletes an existing step, decrementing all subsequent steps (both their titles and in their meta.json) + +**Note:** This script also runs [update-step-titles](#update-step-titles). ### スクリプトを実行する方法 @@ -63,61 +63,18 @@ npm run create-step-between start=X # where X is the starting step number 2. 以下の npm コマンドを実行します。 ```bash -npm run delete-step num=x # where x is the step number to be deleted. +npm run delete-step X # where X is the step number to be deleted. ``` -## ステップを並べ替える +## update-step-titles -一時スクリプトにより、ファイル名に基づいて、プロジェクトのマークダウンファイル内のステップファイルを自動的に並べ替えます。 また、プロジェクトの `meta.json` 内の `challengeOrder` プロパティ配列を、新しいステップ順序で更新します。 +A one-off script that automatically updates the frontmatter in a project's markdown files so that they are consistent with the project's meta.json. It ensures that each step's title (and dashedName) match the meta's challengeOrder. -### 作業例 - -例えば、次のプロジェクト構造から始めるとします。 - -```bash -step-001.md -step-002.md -step-003.md -step-004.md -step-005.md -step-006.md -``` - -ある時点で、ステップが不要になったため `step-002.md` を削除する必要があると判断します。 また、`step-004.md` を 1 つではなく 3 つのステップに分解することにします。 - -この構造を再構築するには、`step-002.md` を削除し、 `step-004a.md` と `step-004b.md` を追加する必要があります。 新しいフォルダ構造は次のようになります。 - -```bash -step-001.md -step-003.md -step-004.md -step-004a.md -step-004b.md -step-005.md -step-006.md -``` - -ここで、ファイル名は `step-001.md` から `step-007.md` である必要があります。これは、1 つ削除して、2つ追加したので、正味差は1ファイルだからです。 また、削除されたステップまたは追加されたステップの各ファイルのフロントマターは、`title` キー値を新しいステップ数と一致させた上で変更する必要があります。 例えば、`step-3.md` を `step-2.md` に変更した後、 `step-2.md` のタイトルを `Step 03` から `Step 02` へ変更します。 - -以下は、実際のプロジェクトフォルダの変更です。 - -```bash -step-001.md -step-003.md renamed to step-002.md and title changes to "Step 2" -step-004.md renames to step-003.md and title changes to "Step 3" -step-004a.md renames to step-004.md and title changes to "Step 4" -step-004b.md renames to step-005.md and title changes to "Step 5" -step-005.md renames to step-006.md and title changes to "Step 6" -step-006.md renames to step-007.md and title changes to "Step 7" -``` - -上記の変更に伴い、プロジェクトの `meta.json` ファイル内の `challengeOrder` キーは、新しいステップの順序を反映する必要があります。 これは、ステップの削除や追加に伴い、その下にある各ステップが、影響を受けるステップのチャレンジ `id` に関連する `title` を変更するためです。 - -### スクリプトを実行する方法 +### How to run script 1. プロジェクトのディレクトリに変更します。 2. 以下の npm コマンドを実行します。 ```bash -npm run reorder-steps +npm run update-step-titles ``` diff --git a/docs/i18n/portuguese/how-to-work-on-practice-projects.md b/docs/i18n/portuguese/how-to-work-on-practice-projects.md index 91e94bdc5c..b70461397b 100644 --- a/docs/i18n/portuguese/how-to-work-on-practice-projects.md +++ b/docs/i18n/portuguese/how-to-work-on-practice-projects.md @@ -10,9 +10,7 @@ Se você quer criar novos passos, as ferramentas a seguir vão simplificar o pro ## create-next-step (criar próximo passo) -Um script único que automaticamente adiciona um novo passo baseado no último passo numerado como `step-xxx.md` onde `xxx` representa o número de 3 dígitos do último passo. O código inicial de desafio usará o código inicial de desafio da etapa anterior com os marcadores de região editáveis ​​(ERMs) removidos. - -**Observação:** esse script também executa [reorder-steps](#reorder-steps). +A one-off script that will automatically add the next step based on the last step in the project. The challenge seed code will use the previous step's challenge seed code. ### Como executar esse script: @@ -25,9 +23,9 @@ npm run create-next-step ## create-empty-steps (criar passos vazios) -Um script único que adiciona automaticamente um número especificado de passos começando a partir de um número específico. O código seed de todos os passos criados estarão vazios. +A one-off script that automatically adds a specified number of steps. The challenge seed code for all steps created will be empty. -**Observação:** esse script também executa [reorder-steps](#reorder-steps). +**Note:** This script also runs [update-step-titles](#update-step-titles). ### Como executar esse script: @@ -35,14 +33,14 @@ Um script único que adiciona automaticamente um número especificado de passos 2. Execute o comando npm a seguir: ```bash -npm run create-empty-steps start=X num=Y # onde X é o número do passo onde deve iniciar e Y é o número de passos que deverão ser criados. +npm run create-empty-steps X # where X is the number of steps to create. ``` -## create-step-between +## insert-step -Um único script que automaticamente adiciona passos entre dois passos consecutivos. O código inicial do desafio usará o código inicial do desafio da etapa inicial existente com os marcadores de região editáveis ​​(ERMs) removidos. +A one-off script that automatically adds a new step at a specified position, incrementing all subsequent steps (both their titles and in their meta.json). The challenge seed code will use the previous step's challenge seed code with the editable region markers (ERMs) removed. -**Observação:** esse script também executa [reorder-steps](#reorder-steps). +**Note:** This script also runs [update-step-titles](#update-step-titles). ### Como executar esse script: @@ -50,12 +48,14 @@ Um único script que automaticamente adiciona passos entre dois passos consecuti 2. Execute o comando npm a seguir: ```bash -npm run create-step-between start=X # onde X é o número do passo para começar +npm run insert-step X # where X is the position to insert the new step. ``` ## delete-step -Um único script que deleta um passo existente e reordena os passos que restaram na pasta do projeto e também atualiza a propriedade do array `challengeOrder` no `meta.json` do projeto com a nova ordem dos passos. +A one-off script that deletes an existing step, decrementing all subsequent steps (both their titles and in their meta.json) + +**Note:** This script also runs [update-step-titles](#update-step-titles). ### Como executar esse script @@ -63,61 +63,18 @@ Um único script que deleta um passo existente e reordena os passos que restaram 2. Execute o comando npm a seguir: ```bash -npm run delete-step num=x # onde x é o número do passo a ser deletado. +npm run delete-step X # where X is the step number to be deleted. ``` -## reorder-steps +## update-step-titles -Um script único que automaticamente reordena os aquivos de passos em arquivos markdown do projeto baseado no nome dos arquivos. Também atualiza a propriedade do array `challengeOrder` no `meta.json` do projeto com a nova ordem dos passos. +A one-off script that automatically updates the frontmatter in a project's markdown files so that they are consistent with the project's meta.json. It ensures that each step's title (and dashedName) match the meta's challengeOrder. -### Exemplo de trabalho - -Digamos que você começa com a estrutura de projeto a seguir: - -```bash -step-001.md -step-002.md -step-003.md -step-004.md -step-005.md -step-006.md -``` - -Em algum momento, você decide que precisa deletar `step-002.md`, porque os passos nele não são mais necessários. Você também decide que vai diluir as partes dentro de `step-004.md` em três passos ao invés de um. - -Para completar essa reestruturação, você precisará excluir a `step-002.md` e então adicionar a `step-004a.md` e a `step-004b.md`. A nova estrutura da pasta deve ficar assim: - -```bash -step-001.md -step-003.md -step-004.md -step-004a.md -step-004b.md -step-005.md -step-006.md -``` - -Você precisa agora que os nomes dos arquivos sejam `step-001.md` a `step-007.md`, porque você removeu um, mas ganhou dois arquivos novos, assim gerando somente um arquivo novo. Além disso, o frontmatter de cada arquivo abaixo de um passo adicionado ou excluído precisará ser modificado, onde o valor chave do `title` tem que ser igual ao novo número do passo. Por exemplo, depois de renomeaer `step-3.md` para `step-2.md`, você precisará alterar o título do `step-2.md` de `Step 03` para `Step 02`. - -Veja abaixo as mudanças necessárias na pasta do projeto: - -```bash -step-001.md -step-003.md renomeado para step-002.md e o título muda para "Step 2" -step-004.md renomeado para step-003.md e o título muda para "Step 3" -step-004a.md renomeado para step-004.md e o título muda para "Step 4" -step-004b.md renomeado para step-005.md e o título muda para "Step 5" -step-005.md renomeado para step-006.md e o título muda para "Step 6" -step-006.md renomeado para step-007.md e o título muda para "Step 7" -``` - -Junto com as mudanças acima, a chave `challengeOrder` no arquivo `meta.json` do projeto precisará refletir a nova ordem dos passos. Isso é necessário porque cada etapa abaixo de uma exclusão de etapa e/ou adição de etapa altera o `title` associado a cada um dos `id` do desafio da etapa afetada. - -### Como executar esse script +### How to run script 1. Mude para o diretório do projeto. 2. Execute o comando npm a seguir: ```bash -npm run reorder-steps +npm run update-step-titles ``` diff --git a/docs/i18n/ukrainian/how-to-work-on-practice-projects.md b/docs/i18n/ukrainian/how-to-work-on-practice-projects.md index 9dc283fb5a..a2fd04d456 100644 --- a/docs/i18n/ukrainian/how-to-work-on-practice-projects.md +++ b/docs/i18n/ukrainian/how-to-work-on-practice-projects.md @@ -10,9 +10,7 @@ If you want to create new steps, the following tools simplify that process. ## create-next-step -A one-off script that will automatically add the next step based on the last step numbered as `step-xxx.md` where `xxx` represents the 3-digit step number of the last step. The challenge seed code will use the previous step's challenge seed code with the editable region markers (ERMs) removed. - -**Note:** This script also runs [reorder-steps](#reorder-steps). +A one-off script that will automatically add the next step based on the last step in the project. The challenge seed code will use the previous step's challenge seed code. ### How to run script: @@ -25,9 +23,9 @@ npm run create-next-step ## create-empty-steps -A one-off script that automatically adds a specified number of steps at a specific starting step number. The challenge seed code for all steps created will be empty. +A one-off script that automatically adds a specified number of steps. The challenge seed code for all steps created will be empty. -**Note:** This script also runs [reorder-steps](#reorder-steps). +**Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script: @@ -35,14 +33,14 @@ A one-off script that automatically adds a specified number of steps at a specif 2. Run the following npm command: ```bash -npm run create-empty-steps start=X num=Y # where X is the starting step number and Y is the number of steps to create. +npm run create-empty-steps X # where X is the number of steps to create. ``` -## create-step-between +## insert-step -A one-off script that automatically adds a new step between two existing consecutive steps. The challenge seed code will use the existing starting step's challenge seed code with the editable region markers (ERMs) removed. +A one-off script that automatically adds a new step at a specified position, incrementing all subsequent steps (both their titles and in their meta.json). The challenge seed code will use the previous step's challenge seed code with the editable region markers (ERMs) removed. -**Note:** This script also runs [reorder-steps](#reorder-steps). +**Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script: @@ -50,12 +48,14 @@ A one-off script that automatically adds a new step between two existing consecu 2. Run the following npm command: ```bash -npm run create-step-between start=X # where X is the starting step number +npm run insert-step X # where X is the position to insert the new step. ``` ## delete-step -A one-off script that deletes an existing step and then reorders the remaining step files in the project's folder as well as updates the `challengeOrder` property array in the project's `meta.json` with the new order of the steps. +A one-off script that deletes an existing step, decrementing all subsequent steps (both their titles and in their meta.json) + +**Note:** This script also runs [update-step-titles](#update-step-titles). ### How to run script @@ -63,55 +63,12 @@ A one-off script that deletes an existing step and then reorders the remaining s 2. Run the following npm command: ```bash -npm run delete-step num=x # where x is the step number to be deleted. +npm run delete-step X # where X is the step number to be deleted. ``` -## reorder-steps +## update-step-titles -A one-off script that automatically reorders the step files in a project's markdown files based on the filename. It also updates the `challengeOrder` property array in the project's `meta.json` with the new order of the steps. - -### Working Example - -Let's say you start with the following project structure: - -```bash -step-001.md -step-002.md -step-003.md -step-004.md -step-005.md -step-006.md -``` - -At some point you decide you need to delete `step-002.md`, because that step is no longer needed. Also, you decide to break down `step-004.md` into three steps instead of just one. - -To accomplish this restructure, you would need to delete `step-002.md` and then add a `step-004a.md` and a `step-004b.md`. The new folder structure would look like the following: - -```bash -step-001.md -step-003.md -step-004.md -step-004a.md -step-004b.md -step-005.md -step-006.md -``` - -You now need the file names to be `step-001.md` through `step-007.md`, because you removed one but gained two more for a net difference of one file. Also, the frontmatter of each file below a deleted step or added step will need to be modified by making the `title` key value match the new step number. For example, after renaming `step-3.md` to `step-2.md`, you would need to change `step-2.md`'s title from `Step 03` to `Step 02`. - -See below for the actual project folder changes needed: - -```bash -step-001.md -step-003.md renamed to step-002.md and title changes to "Step 2" -step-004.md renames to step-003.md and title changes to "Step 3" -step-004a.md renames to step-004.md and title changes to "Step 4" -step-004b.md renames to step-005.md and title changes to "Step 5" -step-005.md renames to step-006.md and title changes to "Step 6" -step-006.md renames to step-007.md and title changes to "Step 7" -``` - -Along with the above changes, the `challengeOrder` key in the project's `meta.json` file needs to reflect the new step order. This is needed because each step below a step deletion and/or step addition changes the `title` associated with each of the affected step's challenge `id`. +A one-off script that automatically updates the frontmatter in a project's markdown files so that they are consistent with the project's meta.json. It ensures that each step's title (and dashedName) match the meta's challengeOrder. ### How to run script @@ -119,5 +76,5 @@ Along with the above changes, the `challengeOrder` key in the project's `meta.js 2. Run the following npm command: ```bash -npm run reorder-steps +npm run update-step-titles ```