Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo assesment -> assessment #445

Merged
merged 3 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ struct RenderHierarchyTranslator {
renderHierarchyTutorial.landmarks.append(RenderHierarchyLandmark(reference: RenderReferenceIdentifier(assessmentReference.absoluteString), kind: .assessment))

let urlGenerator = PresentationURLGenerator(context: context, baseURL: bundle.baseURL)
let assesmentLinkReference = LinkReference(
let assessmentLinkReference = LinkReference(
identifier: RenderReferenceIdentifier(assessmentReference.absoluteString),
title: "Check Your Understanding",
url: urlGenerator.presentationURLForReference(assessmentReference).relativeString
)
linkReferences[assessmentReference.absoluteString] = assesmentLinkReference
linkReferences[assessmentReference.absoluteString] = assessmentLinkReference
}

return renderHierarchyTutorial
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftDocC/Model/Rendering/RenderNodeTranslator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ public struct RenderNodeTranslator: SemanticVisitor {
}

node.sections.append(tutorialSections)
if let assesments = tutorial.assessments {
node.sections.append(visitAssessments(assesments) as! TutorialAssessmentsRenderSection)
if let assessments = tutorial.assessments {
node.sections.append(visitAssessments(assessments) as! TutorialAssessmentsRenderSection)
}

// We guarantee there will be at least 1 path with at least 4 nodes in that path if the tutorial is curated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ struct ExternalReferenceWalker: SemanticVisitor {
mutating func visitTutorial(_ tutorial: Tutorial) {
visit(tutorial.intro)
tutorial.sections.forEach { visit($0) }
if let assesments = tutorial.assessments {
visit(assesments)
if let assessments = tutorial.assessments {
visit(assessments)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftDocC/Semantics/Walker/SemanticWalker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension SemanticWalker {
mutating func visitAssessments(_ assessments: Assessments) { descendIntoChildren(of: assessments) }
/// Visits a multiple-choice question.
mutating func visitMultipleChoice(_ multipleChoice: MultipleChoice) { descendIntoChildren(of: multipleChoice) }
/// Visits an assesment justification.
/// Visits an assessment justification.
mutating func visitJustification(_ justification: Justification) { descendIntoChildren(of: justification) }
/// Visits a single choice in a multiple-choice question.
mutating func visitChoice(_ choice: Choice) { descendIntoChildren(of: choice) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1936,7 +1936,7 @@
},
"sections": {
"type": "string",
"enum": ["task", "assesment", "heading"]
"enum": ["task", "assessment", "heading"]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a breaking change for swift-docc-render? @ethan-kusters

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't be – I believe this is just fixing the incorrect spec. We should confirm the emitted JSON has always had the correct spelling (assessment) before merging but I believe it has.

Copy link
Contributor

@Kyle-Ye Kyle-Ye Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The is confirmed on swift-docc-render and swift-docc. But I think we still need a test case for it though.

}
},
Expand Down