raito
raito copied to clipboard
Qol Patch
I've decided to call this PR a "Quality of Life" patch since it suggests improvements to existing features and some fixes.
- Images are automatically loaded
- Personally, I think loading images with leading
#
is good. All the html regarding images is rendered with markdown.js and Javascript could be used to lazy load and resolve images. Nice to have feature when dealing with lots of images.
- Personally, I think loading images with leading
- All links and images are automatically relative to the directory of a markdown file
- Sub directory support in other words
- See
subdir_example.md
and markdown files undersbd1
for examples
- Full relative linking support with
./
and../
in paths to refer images and markdown files- This would cause an issue where using relative links would pollute page hash with circular(?) references
a/../a/b/../
and so on - Fixed the same by writing a relative to absolute path resolver
- This would cause an issue where using relative links would pollute page hash with circular(?) references
- No need for any special syntax such as
#
in markdown files- Code handles all syntax for a better "out-of-the-box" experience
- Fixed an issue where
loadContent
would be called more than once on the same page when prettifying hash - Fixed an issue where a file could be requested out the directory of
index.html
-
config.root
is no longer required- This can be tested by starting html server outside the directory of
index.html
-
Please consider clearing
cache
before testing forconfig.root
or use incognito
- This can be tested by starting html server outside the directory of
Thanks a lot for the welcomed improvements! Give me a few days to review
It's hard to review big PRs like this, so I backported some of them into separate branches, and cleaned them up a bit.
- [x] Markdown Image support : Backported into #19
- [x] Scroll position b/w renders : Backported into #20
- [x] Double-fire
loadContent
: Backported into #21 - [x] Relative linking support : Backported into #25
- [x] Subdirectory support : Already implemented
- [x] No need for # in markdown : Already implemented
These are cool features, thank you very much!