Add links to HTML
I came across a collection of sequential HTML files which I downloaded that do not have any links to each other. It was difficult to browse the pages, so I decided to create this little script to add a Previous and Next link to the top of the HTML pages. The names of the HTML files were in the format xxx-##.html where xxx represents a name, and ## represents the sequential number of the file.
What you will need:
- Python : Scripting/Programming Language
Note: I developed this script on my Mac so I haven’t tested it on a Windows OS. If you come across any problems running it on windows, post a comment to let me know and I’ll post a tweak for it.
You can get the script here: addlinks.txt (rename the extension from .txt to .py)
I have placed comments in the script file to make it easier to understand. If you wish you may edit it to your liking, also you may want to modify the absolute positioning of the links to better fit the theme of the HTML files that you have.
Place the script in your regular script directory. Execute it with the following format:
> addlinks.py C:\htmlfiles\
C:\htmlfiles\ with the directory that contains the HTML files you want to edit. However remember to always keep a backup in case you end up having problems and the outcome is not to your liking.
Reserved, going to add something here later.