Hello! I'd like to download the OpenWRT documentation for offline use (mainly as a backup), but I couldn't find the appropriate link. Could you please tell me if this functionality is available on the website? If not, how difficult would it be to implement? As far as I understand, the documentation uses the DokuWiki engine. Perhaps this functionality is included out of the box or is provided by a plugin?
P.S. I found an old topic, but still decided to open a new one. Let me know if this doesn't comply with the rules of this forum (unfortunately, I didn't find them either).
This topic has come up many times, including the one you linked.
The answer, is still the same:
There is no "offline documentation" download option -- it's not practical for about a dozen different reasons.
It is largely unnecessary to download the entire corpus of OpenWrt documentation as the vast majority of it will not be needed by any given individual user. That is to say that a user who needs the basic 'getting started' documentation for use offline is likely not going to need the documents pertaining to configuring Asterisk and SIP and vise versa.
Most (but obviously not all) users can still get online via another device like a phone even when their main router/internet connection is down.
And typically, the steps necessary to get online in the most basic sense (to then get to the documentation for more advanced features) are simple enough that they don't require a mass-download. For most users, it's a matter of:
Plugging their router into their ISP modem/ONT or other upstream connection
Then, if necessary, configuring a PPPoE or static IP configuration on the wan (the default is DHCP).
Sometimes a VLAN ID is required on the wan.
Enabling wifi (and setting the country code, SSID name, encryption type, and passphrase)
You can download the individual pages you feel you may need by simply saving the html file or printing it to a pdf.... (please do not write a script/bot to scrape the site; saving a handful of pages is fine).
Thank you for quick response! Do you mean that the official position on my issue hasn't changed since the previous thread from three years ago, this functionality is not considered desirable? If so, what alternatives do I have for obtaining an offline copy without creating an unnecessary load on the server? Can I use a utility for saving web pages, or is there a source code repository from which I could build the documentation locally?
For context, I would like to have an offline copy because I live in Russia, and harmless resources (including software documentation) are often unavailable due to restrictions. I'd like to have a backup just in case.
As far as I know, many open source projects offer the ability to download offline versions of their documentation. For example, Godot Engine has a GitHub action that automatically builds an offline version of the documentation every Monday in two formats (HTML and ePUB). I can also build the documentation locally from the source code (Sphinx).
If you read through the previous threads on the topic, you will see that there are multiple factors. A few selected ones:
Aside from mirroring the entire database along with the web-serving infrastructure, it's nearly impossible to generate a cohesive set of docs. A wiki based document set is very much non-linear, has tons of cross-links and other complicating factors.
The documentation is extremely dynamic. Edits happen on a regular basis, so any offline docs could quickly become out of date.
The corpus is very large and includes extremely common things (i.e getting started, wifi configuration, etc.) all the way up to expert level and niche functions (i.e. telephony, RADIUS, etc.) and everything in between
The amount of effort that would be required to create a mechanism to export the documents to an offline format (pdfs, static html that could be served with a local web server) would be massive
the number of people who truly need offline docs at scale is vanishingly small.
That is to say that yes, a novice might need a few 'getting started' type pages, or an expert might need documentation about some very advanced and niche service, but almost nobody needs the whole corpus.
Most people can generate their own offline docs of selected pages by simply printing to pdf for anything they thing the'll need to store.
Beyond the settings started documents, it is generally assumed that anything advanced will only be useful if and when user is online anyway. (yes, there is the governmental access issue... I'll get to that).
As mentioned, find the pages you want to archive and save them locally (print-to-pdf can work well for this). There's just simply no reason that any normal person would need the entire site. Scraping the site will probably be noticed and the IP banned.
I do understand your predicament. However, as stated earlier, there is just no reason to have a backup/offline copy of the docs for absolutely everything that OpenWrt can do. You wouldn't buy all the books in a major bookstore so that you can find the on fiction novel you've been wanting to read.
Find the relevant pages for your use cases (may I suggest VPNs) and save them to pdf or html pages for local consumption.
While government restrictions in your country and in others may come and go, and yes, some sites like this can become targets, there are often still ways to access the material you need including other Internet forums, mirrors, vpns, and the like.
Ours is based in a wiki, so it's a bit different. If you'd like to develop a method by which this can be done (it must be lightweight and of minimal impact to the server load), it is possible that the maintainers of the wiki would be willing to deploy such a system (but again, it has huge caveats -- it would be massive in scope/size and would be a snapshot that could have outdated or incorrect information).
Thank you for your reply! I understand and respect that your workflow and tooling may differ from other projects. I'm not insisting, but I'd like to clarify my motivation:
I was surprised that I didn't find a link to download the documentation, as many projects offer this functionality. Examples:
Wikipedia (uses MediaWiki). Even though the dumps are tens or hundreds of gigabytes.
To reduce server load, it would be better to provide explicit functionality for users who want to obtain an offline copy by any means rather than having them use scripts/utilities. Since this question comes up again and again, there is clearly some interest.
Frequent documentation updates are not a problem. The archive can be updated periodically (e.g., once a week). Also, there's little point to update a local copy too frequently; within minor OpenWRT versions, the documentation is likely largely compatible.
As far as I understand from a quick review, the main obstacle lies in the DokuWiki ecosystem. I found a few plugins for exporting documentation to HTML/PDF/ePub, but none of them have been updated for a long time. So, it's fair to wonder whether they are still supported and especially what about their security, given that DokuWiki is a self-hosted PHP application. Implementing this feature would require writing a DokuWiki plugin from scratch or forking an existing one and then maintaining it by the OpenWRT team. As far as I understand, this effort isn't considered justified or widely needed.
Unfortunately, I'll have to follow your advice and limit myself to manually saving a few sections that seem most useful to me. However, this solution has several drawbacks:
This requires a lot of manual effort. I could write a script or use an existing tool, but I won't do so out of respect for your project.
This limits the size of my local copy. Yes, I can estimate which materials I definitely need and which I definitely don't. But there's a gray area where I'm not sure whether I'll need these documentation pages or not.
This limits the usefulness of my local copy, since I'll probably be too lazy to manually download the necessary pages one by one every time a new OpenWRT version is released. Downloading a single archive would be much easier.
Finally, I'd like to mention two alternatives. I can't ask you to do any of this, I just want to list the options:
Provide the ability to download a DokuWiki "snapshot" without generating HTML/PDF/ePub. The snapshot should include only content (wiki pages and media files), without revision history, configuration files, credentials, etc. See the DokuWiki's directory layout. Interested users could deploy a local DokuWiki instance and try using existing plugins to export documentation for offline use. This way, you wouldn't have to maintain a DokuWiki plugin and incur unnecessary security risks.
Migrate to GitHub/GitLab Wiki. This means changing your workflows and requires some effort. However, the advantage is that you can work with the wiki both through the web interface and as a Git repository. This is convenient if some of the editors aren't developers and wouldn't be comfortable using the patch system or pull requests to contribute to the wiki.
In any case, thank you for your attention and responses, as well as for your contribution to such an important project as OpenWRT!