mirror of
https://github.com/kjanat/articulate-parser.git
synced 2026-04-18 16:52:02 +02:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -40,19 +40,19 @@ func (e *MarkdownExporter) Export(course *models.Course, outputPath string) erro
|
|||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
|
|
||||||
// Write course header
|
// Write course header
|
||||||
buf.WriteString(fmt.Sprintf("# %s\n\n", course.Course.Title))
|
fmt.Fprintf(&buf, "# %s\n\n", course.Course.Title)
|
||||||
|
|
||||||
if course.Course.Description != "" {
|
if course.Course.Description != "" {
|
||||||
buf.WriteString(fmt.Sprintf("%s\n\n", e.htmlCleaner.CleanHTML(course.Course.Description)))
|
fmt.Fprintf(&buf, "%s\n\n", e.htmlCleaner.CleanHTML(course.Course.Description))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add metadata
|
// Add metadata
|
||||||
buf.WriteString("## Course Information\n\n")
|
buf.WriteString("## Course Information\n\n")
|
||||||
buf.WriteString(fmt.Sprintf("- **Course ID**: %s\n", course.Course.ID))
|
fmt.Fprintf(&buf, "- **Course ID**: %s\n", course.Course.ID)
|
||||||
buf.WriteString(fmt.Sprintf("- **Share ID**: %s\n", course.ShareID))
|
fmt.Fprintf(&buf, "- **Share ID**: %s\n", course.ShareID)
|
||||||
buf.WriteString(fmt.Sprintf("- **Navigation Mode**: %s\n", course.Course.NavigationMode))
|
fmt.Fprintf(&buf, "- **Navigation Mode**: %s\n", course.Course.NavigationMode)
|
||||||
if course.Course.ExportSettings != nil {
|
if course.Course.ExportSettings != nil {
|
||||||
buf.WriteString(fmt.Sprintf("- **Export Format**: %s\n", course.Course.ExportSettings.Format))
|
fmt.Fprintf(&buf, "- **Export Format**: %s\n", course.Course.ExportSettings.Format)
|
||||||
}
|
}
|
||||||
buf.WriteString("\n---\n\n")
|
buf.WriteString("\n---\n\n")
|
||||||
|
|
||||||
@@ -60,15 +60,15 @@ func (e *MarkdownExporter) Export(course *models.Course, outputPath string) erro
|
|||||||
lessonCounter := 0
|
lessonCounter := 0
|
||||||
for _, lesson := range course.Course.Lessons {
|
for _, lesson := range course.Course.Lessons {
|
||||||
if lesson.Type == "section" {
|
if lesson.Type == "section" {
|
||||||
buf.WriteString(fmt.Sprintf("# %s\n\n", lesson.Title))
|
fmt.Fprintf(&buf, "# %s\n\n", lesson.Title)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
lessonCounter++
|
lessonCounter++
|
||||||
buf.WriteString(fmt.Sprintf("## Lesson %d: %s\n\n", lessonCounter, lesson.Title))
|
fmt.Fprintf(&buf, "## Lesson %d: %s\n\n", lessonCounter, lesson.Title)
|
||||||
|
|
||||||
if lesson.Description != "" {
|
if lesson.Description != "" {
|
||||||
buf.WriteString(fmt.Sprintf("%s\n\n", e.htmlCleaner.CleanHTML(lesson.Description)))
|
fmt.Fprintf(&buf, "%s\n\n", e.htmlCleaner.CleanHTML(lesson.Description))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process lesson items
|
// Process lesson items
|
||||||
|
|||||||
Reference in New Issue
Block a user