Sometimes I want to develop WordPress themes when I have no internet connection. I need the Function Reference and Template Tags to be productive.
I searched for a downloadable or SVN copy of the Codex but could not find one. I ended up trying to mirror it using wget
, but the results were spotty (it’s too huge!).
Is there a better way?
I Use a much faster and easier way to create a local copy of the codex without installing a local server and without installing copy of mediawiki, its called ScrapBook which is a Firefox extension, that helps you to save Web pages and manage the collection. Key features are lightness, speed, accuracy and multi-language support.
using it’s Save Web site (In-depth Capture)feature you can set the directories you want to save , which in your case would be
Function Reference
andTemplate Tags
you can also organize your collections just like bookmarks, edit saved files and highlight key parts of pages and the best thing about it is the built in full text search.
Your best bet is to set up a local copy of MediaWiki. This is the same software that runs Wikipedia, but it’s also the application that powers the Codex.
After you’ve got that installed, you can tell the Codex to export the pages you want and you can import the XML docs into your local installation. It’s not automated, but it should give you enough information to work with for quick references.
Get MediaWiki
All of the documentation for downloading, installing, and configuring MediaWiki is available online.
If you can run WordPress locally, you should be able to run MediaWiki locally as well (you need both PHP and MySQL to set things up).
Export the Codex
Make a list of the pages you want to export. I’d love if there were an automated tool to export everything, but in the absence of that let’s stick with the manual process.
Navigate to http://codex.wordpress.org/Special:Export. This page lets you mark which pages and categories you want to export.
Lets say you just want to export the
Function Reference
page. You’d enter “Function_Reference” in the large box for page names. Place one page name per line to export multiple pages at once.But since that one page isn’t very useful … export the entire
Functions
category instead. Enter “Functions” in the category box and click add. The Codex will automatically list all 964 function pages for you. Then just add a line for “Function_Reference” so you get the index as well.You can see a list of all available pages at http://codex.wordpress.org/Special:AllPages. The list is quite extensive, so I won’t cover it here … but add every page you want exported anc click away.
Once you’ve clicked “Export,” the Codex will generate a (rather large) XML file containing all of the content.
Import the Codex
Now navigate back to your local MediaWiki installation. You can now import the XML doc and create your local “clone” of the WordPress Codex.
Detailed import instructions are available on MediaWiki’s website.
You can use Dash (OS X) or Zeal (Linux, Windows) applications which have scrape of Codex function reference available as documentation set.
It is easy to install and use, however a little fuzzy how up to date the sets are kept.
I think the best thing would be to create bug report and ask the WP foundation to install this extension http://www.mediawiki.org/wiki/Extension:PdfBook If nothing else, mark it for private use and then provide the generated PDF for the users.
I did this for myself using HTTrack (http://www.httrack.com/). It wound up being a handful of megabytes (not sure of the exact number now, I lost my local copy to a hard drive failure, and haven’t bothered to rebuild it yet), but it worked pretty well.
You can use the MediaWiki API. There is complete documentation on how to mirror a wiki using the API and other methods.
Cool idea,
There’s a few ways to make it “local”.
In short there’s no repository for this at the moment.
Although making one would be cool.
Maybe I’ll write that…
I’ll post back later tonight. I might actually have this done in a little bit.
I’ll put it on GitHub.Update: The MediaWiki answer is how this should really be done.
I Know this is an old thread but its been gathering hits so I’ll add this answer
devdocs.io has all the API’s for WordPress that you need, though its not structured like the Codex version it’s still helpful in some cases.
NOTE: It’s not just WordPress docs but many other popular languages too