yakivmospan / github-wikito-converter

Generate HTML & PDF documentation from Github wiki or any other markdown-based wiki.
Other
293 stars 52 forks source link

Preserve links to /uploads/ #52

Closed alexmemory closed 3 years ago

alexmemory commented 4 years ago

I did this to make links to /uploads/ work in a converted Gitlab wiki. It seems that /uploads/ is where Gitlab wiki stores uploaded files, and gwtc was breaking those links. I doubt this hack is the right general solution. Any suggestions for a better one?

yakivmospan commented 4 years ago

Hey, Not for now, at least from me. Thanks for your fix, please link any git hub issue to this pull requests if any exists. Will merge it soon

yakivmospan commented 4 years ago

Can you please give an example of this link usage? You were making a downloadable link to uploaded files inside of wiki? And this file was drag and dropped into wiki editor? Thanks

alexmemory commented 4 years ago

My goal was to export a Gitlab wiki to archive it in a readable form, including all files I had uploaded to the wiki. If I recall correctly, I did these steps:

  1. Follow directions to export a Gitlab project. This provides access to an uploads folder.

  2. Clone the wiki repository for the project. Links in its markdown to uploaded files are like this: /uploads/<hash code>/<file name>

  3. Convert the wiki using gwtc. Without the fix/hack I made, the full paths (including the hash codes) to upload files are lost. With the fix, the paths are preserved and I can place or link that uploads folder in / locally to get all those links to work in my local copy of the HTML from gwtc.

yakivmospan commented 3 years ago

Sorry, but after cloning gitlab repo I'm able to see images from /uploads folder without your fix. Also in the code, the check !(href.match(/^https?:\/\//) will be triggered even before yours, as it is trying to link all urls that do not start from https as local resource urls.