raito icon indicating copy to clipboard operation
raito copied to clipboard

Qol Patch

Open jakima opened this issue 2 years ago • 1 comments

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.
  • 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 under sbd1 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
  • 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 for config.root or use incognito

jakima avatar Apr 14 '22 18:04 jakima

Thanks a lot for the welcomed improvements! Give me a few days to review

arnaudsm avatar Apr 26 '22 09:04 arnaudsm

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!

arnaudsm avatar Jul 12 '23 20:07 arnaudsm