The legacy wiki pages are here for reference purposes only.
For up-to-date information make sure to check the documentation section.

Publishes a document by adding it to the umbraco.config file, prior to this the document should be marked published by calling Document.Publish(User u) on the document object.


using umbraco.cms.businesslogic.web;

//Create new DocumentObject
Document doc = new Document(id);
//Mark the document for publish under Admin account
doc.Publish(new User(0));
//Publish the document by Updating umbraco.config file
library.UpdateDocumentCache(doc.Id); is the community mothership for Umbraco, the open source cms. With a friendly forum for all your questions, a comprehensive documentation and a ton of packages from the community. This site is running Umbraco version 7.5.2