Skip to content

Commit

Permalink
Made fenced code blocks prettier with syntax highlights and filenames. (
Browse files Browse the repository at this point in the history
  • Loading branch information
djacu authored Feb 9, 2024
1 parent a0fec59 commit d09b641
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
File renamed without changes.
21 changes: 19 additions & 2 deletions lib/lessons.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
)
);

getFileExtension = path: (
lib.concatStringsSep
"."
(
builtins.tail (
lib.splitString
"."
(
builtins.baseNameOf
path
)
)
)
);

createLessonMetadata = name: value: let
lessonPath = value;
rawLesson = builtins.readFile (lib.path.append lessonPath "lesson.md");
Expand All @@ -35,8 +50,10 @@
textToSubstitute = (
builtins.map
(
file: ''
```
file: let
fileExtension = getFileExtension file;
in ''
``` ${fileExtension} title="${file}"
${
builtins.readFile
(
Expand Down

1 comment on commit d09b641

@github-actions
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.