|
| 1 | +# THIS IS FOR EDUCATION PURPOSE ONLY. |
| 2 | + |
| 3 | +<br> |
| 4 | + |
| 5 | +# Steps |
| 6 | + |
| 7 | +<br> |
| 8 | + |
| 9 | +## Command-line |
| 10 | + |
| 11 | +Recommended to use [Cmder](https://cmder.net/) or [Windows terminal with WSL](hhttps://docs.microsoft.com/en-us/windows/terminal/get-started) if you are on Windows. |
| 12 | + |
| 13 | +<br> |
| 14 | + |
| 15 | +## Copying site |
| 16 | + |
| 17 | +Tools that helped in the process: [Wget](https://www.gnu.org/software/wget/) |
| 18 | + |
| 19 | +Run on command-line: |
| 20 | + |
| 21 | +``` |
| 22 | +
|
| 23 | +wget --mirror --page-requisites --adjust-extension --convert-links -e robots=off https://example.com |
| 24 | +
|
| 25 | +``` |
| 26 | +or |
| 27 | + |
| 28 | +``` |
| 29 | +wget -m -p -E -k -e robot=off https://example.com |
| 30 | +
|
| 31 | +``` |
| 32 | + |
| 33 | +<br> |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +<br> |
| 38 | + |
| 39 | +## Filtering Assets (PNG, JPG, SVG, GIF, WEBP) |
| 40 | + |
| 41 | +Tools that helped in the process: [Everything](https://www.voidtools.com/) |
| 42 | + |
| 43 | +- Go to the path where you copied the website earlier using Wget and filter by .png, .jpg, ... |
| 44 | + |
| 45 | +- Select all, right-click and click on `Copy Full Name to Clipboard` - This will copy the absolute path of files. |
| 46 | + |
| 47 | +<br> |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +<br> |
| 52 | + |
| 53 | +## VSCode arranging content |
| 54 | + |
| 55 | +Tools that helped in the process: [Visual Studio Code](https://code.visualstudio.com/) |
| 56 | + |
| 57 | +- Create a new file with any extension like `.md` and paste the earlier copied content from Everything and name it as `path.md` for example. |
| 58 | + |
| 59 | +<br> |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | +<br> |
| 64 | + |
| 65 | +- Replace the path till `../developer.android.com` with `https://developer.android.com/` |
| 66 | + |
| 67 | +<br> |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +<br> |
| 72 | + |
| 73 | +- Replace `\` with `/` |
| 74 | + |
| 75 | +- Create a new file called `title.md`, `image.md` in the same directory as `path.md` |
| 76 | + |
| 77 | +- Copy contents of `path.md` in `title.md` |
| 78 | + |
| 79 | +- Click on regex mode in VSCode and enter `.*/` in the field and replace all - This will remove all the content from the string until the last `/` |
| 80 | + |
| 81 | +<br> |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | +<br> |
| 86 | + |
| 87 | +- Enter `.png` and replace it with an empty string to get the title. |
| 88 | + |
| 89 | +<br> |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +<br> |
| 94 | + |
| 95 | +- Enter regex `^` and replace with `#### ` to get a nice heading. |
| 96 | + |
| 97 | +<br> |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +<br> |
| 102 | + |
| 103 | +- Go to command-line and Merge `title.md` and `path.md` with `paste -d "^" title.md path.md > tp.md` |
| 104 | + |
| 105 | +<br> |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | +<br> |
| 110 | + |
| 111 | +- Perform regex: `$(?<!\.png)(?<!\.gif)(?<!\.svg)(?<!\.jpg)(?<!\.webp)(\n)` on `tp.md` and replace with empty string - This will select all lines that do not end with .png, .gif, .svg, .jpg, .webp and remove their line breaks. |
| 112 | + |
| 113 | +<br> |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | +<br> |
| 118 | + |
| 119 | +- Copy contents in `path.md` and paste in `image.md` |
| 120 | + |
| 121 | +- Replace `https:` with `` - This will make the image render in markdown. |
| 122 | + |
| 123 | +<br> |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | +<br> |
| 130 | + |
| 131 | +- Go to command-line and Merge `tp.md` and `image.md` with `paste -d \n tp.md image.md > tpi.md` |
| 132 | + |
| 133 | +<br> |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | +<br> |
| 138 | + |
| 139 | +- In `tpi.md` perform Regex `\^` to replace ^ with Ctrl+Enter (line break) |
| 140 | + |
| 141 | +<br> |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | +<br> |
| 146 | + |
| 147 | +- Perform regex `^https:` to replace `https:` with `Source: https:` - This will only replace the `https:` at the beginning of the line. |
| 148 | + |
| 149 | +<br> |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | +<br> |
| 154 | + |
| 155 | +- Replace `####` with `<br> {Ctrl+Enter} ####` - Press {Ctrl + Enter} to give line break. |
| 156 | + |
| 157 | +<br> |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | +<br> |
| 162 | + |
| 163 | +- Done. This will produce the same output as in the repository. |
| 164 | + |
| 165 | +<br> |
| 166 | + |
| 167 | + |
0 commit comments