Minor discrepancy in tutorial part 3 (version 0.25.1) #4

Closed
opened 2025-12-30 01:19:16 +01:00 by adam · 2 comments
Owner

Originally created by @Edward-Knight on GitHub (Feb 3, 2024).

In the Typed objects, properties and amending section, the TutorialPart.pkl has a name: String property, but in the next section (A new template) in the workshop2023.pkl example the agenda (which I assume is to be an agenda: Mapping<String, TutorialPart> from Workshop.pkl) uses title instead of name:

1543909566/docs/modules/language-tutorial/pages/03_writing_a_template.adoc (L189-L203)

1543909566/docs/modules/language-tutorial/pages/03_writing_a_template.adoc (L305-L310)

After following along with the tutorial, adding amends "Workshop.pkl" to the top of workshop2023.pkl resulted in the error:

–– Pkl Error ––
Cannot find property `title` in module `TutorialPart`.

43 | title = "Basic Configuration"
     ^^^^^
at workshop2023#agenda["beginners"] (file://.../workshop2023.pkl, line 43)

Available properties in module `TutorialPart`:
amountLearned
bandwidthRequirementPerSecond
duration
hasExercises
name
output
part

41 | agenda {
     ^^^^^^^^
at workshop2023#agenda (file://.../workshop2023.pkl, line 41)

106 | text = renderer.renderDocument(value)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at pkl.base#Module.output.text (https://github.com/apple/pkl/blob/0.25.1/stdlib/base.pkl#L106)

Originally created by @Edward-Knight on GitHub (Feb 3, 2024). In the [Typed objects, properties and amending](https://pkl-lang.org/main/current/language-tutorial/03_writing_a_template.html#typed-objects-properties-and-amending) section, the `TutorialPart.pkl` has a `name: String` property, but in the next section ([A new template](https://pkl-lang.org/main/current/language-tutorial/03_writing_a_template.html#a-new-template)) in the `workshop2023.pkl` example the `agenda` (which I assume is to be an `agenda: Mapping<String, TutorialPart>` from `Workshop.pkl`) uses `title` instead of `name`: https://github.com/apple/pkl/blob/15439095667dfe102934811e58ed677601b17deb/docs/modules/language-tutorial/pages/03_writing_a_template.adoc?plain=1#L189-L203 https://github.com/apple/pkl/blob/15439095667dfe102934811e58ed677601b17deb/docs/modules/language-tutorial/pages/03_writing_a_template.adoc?plain=1#L305-L310 After following along with the tutorial, adding `amends "Workshop.pkl"` to the top of `workshop2023.pkl` resulted in the error: ``` –– Pkl Error –– Cannot find property `title` in module `TutorialPart`. 43 | title = "Basic Configuration" ^^^^^ at workshop2023#agenda["beginners"] (file://.../workshop2023.pkl, line 43) Available properties in module `TutorialPart`: amountLearned bandwidthRequirementPerSecond duration hasExercises name output part 41 | agenda { ^^^^^^^^ at workshop2023#agenda (file://.../workshop2023.pkl, line 41) 106 | text = renderer.renderDocument(value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ at pkl.base#Module.output.text (https://github.com/apple/pkl/blob/0.25.1/stdlib/base.pkl#L106) ```
adam closed this issue 2025-12-30 01:19:16 +01:00
Author
Owner

@Edward-Knight commented on GitHub (Feb 3, 2024):

I belive this patch should fix:

diff --git a/docs/modules/language-tutorial/pages/03_writing_a_template.adoc b/docs/modules/language-tutorial/pages/03_writing_a_template.adoc
index cf7024c..2bce6c7 100644
--- a/docs/modules/language-tutorial/pages/03_writing_a_template.adoc
+++ b/docs/modules/language-tutorial/pages/03_writing_a_template.adoc
@@ -304,17 +304,17 @@ assistants {
 
 agenda {
   ["beginners"] {
-    title = "Basic Configuration"
+    name = "Basic Configuration"
     part = 1
     duration = 45.min
   }
   ["intermediates"] {
-    title = "Filling out a Template"
+    name = "Filling out a Template"
     part = 2
     duration = 45.min
   }
   ["experts"] {
-    title = "Writing a Template"
+    name = "Writing a Template"
     part = 3
     duration = 45.min
   }
@Edward-Knight commented on GitHub (Feb 3, 2024): I belive this patch should fix: ```diff diff --git a/docs/modules/language-tutorial/pages/03_writing_a_template.adoc b/docs/modules/language-tutorial/pages/03_writing_a_template.adoc index cf7024c..2bce6c7 100644 --- a/docs/modules/language-tutorial/pages/03_writing_a_template.adoc +++ b/docs/modules/language-tutorial/pages/03_writing_a_template.adoc @@ -304,17 +304,17 @@ assistants { agenda { ["beginners"] { - title = "Basic Configuration" + name = "Basic Configuration" part = 1 duration = 45.min } ["intermediates"] { - title = "Filling out a Template" + name = "Filling out a Template" part = 2 duration = 45.min } ["experts"] { - title = "Writing a Template" + name = "Writing a Template" part = 3 duration = 45.min } ```
Author
Owner

@holzensp commented on GitHub (Feb 5, 2024):

Happy to take this as-is, but also happy for you to do this by PR and get proper contributor attribution.

@holzensp commented on GitHub (Feb 5, 2024): Happy to take this as-is, but also happy for you to do this by PR and get proper contributor attribution.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#4