Editorial tools

Some tips for working with files

Download a website with httrack or wget

Tip

Use httrack or wget

Download a website
httrack website.html
Convert html files to rst
find . -name "*.ht*" | while read i; do pandoc -s -f html -t rst "$i" -o "${i%.*}.rst"; done

Tip

  • convert to rst or md

  • fix inner routes

For check the inner routes

Check the generated rst file

Check the generated file

change the extension to rst and add a route to file inside an index.rst

Modifications to index.rst

The command for replace it

Vim Command for replacing text in Document
'<,'>s/ </ <devops\/Books\/Asterisk\//g

After that now go to change the routes for images

Command for search files and filter by content
find ./layers/ -type f -iname '*.rst' -print0 | xargs -0 grep --color image::

Initital Problem

Made the change

Command for search files and edit content with sed
find ./layers/ -type f -iname '*.rst' -exec sed -i "s/thumbnail:: /thumbnail:: ..\/..\/..\/..\/_static\/img\/asterisk\//g" {} \;

Before Fix them


Last update: Nov 20, 2024