From 7dbf2fb3fcf4e9918421b55dd6bf38be5d1ec0fe Mon Sep 17 00:00:00 2001 From: m455 Date: Wed, 7 Dec 2022 21:27:30 -0500 Subject: [PATCH] Fixed rendering issues - Image paths: Images worked on the README.md, but as soon as you tried to view the images in the files tree, and the images were in a subdirectory, the full path was added after the directory name. For example, an image at /images/screenshot.gif, would be generated in the file tree with the following link: images/images/screenshot.gif because it doesn't know that the link to the source file is actually also linking to the images directory, because I generate directories for all links, as if you were actually traversing them. This means we are able to strip the directory from the file path completely, because our links already go to the desired directory, to get images to show up in the source file view - Unknown file type issues: I changed the else statement to render the unknown filetype, because it cause the source of, for example, main.scm to just say "(Unknown file type)". Maybe we can revise this in the future to see when we want to use Unknown filetypes! Thoughts: I think I'm going to try to see if prepending a slash at the front of image paths will create an absolute path, so we dont have to get into messy relative paths haha. --- main.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.scm b/main.scm index cf82c02..010823c 100755 --- a/main.scm +++ b/main.scm @@ -103,9 +103,9 @@ string-block (display "")) (markdown->html (git-file->string source-file)))) ((jpg jpeg png gif webp webm apng avif svgz ico) - (format #t "

" source-file)) + (format #t "

" source-file)) ((svg) - (format #t "

" source-file) + (format #t "

" source-file) (display "
")
      (display-escaped-html (git-file->string source-file))
      (display "
")) @@ -116,7 +116,9 @@ string-block (display-escaped-html (git-file->string source-file)) (display "")) (else - (display "

(Unknown file type)

")))) + (display "
")
+     (display-escaped-html (git-file->string source-file))
+     (display "
")))) (define (display-files-html source-files-list) (display "
    \n")