I've been using dokuwiki[0] for this for a while now and I am quite satisfied with it. It allows simple markdown so you can add (internal and external) links, images and code snippets. If I remember correctly it also saves everything to simple folder structured text files so you will always be able to revert back to that when you want to take it offline.
[0]
https://www.dokuwiki.org/dokuwiki#