mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
Merge pull request #1097 from Pita/develop
Pull in Develop branch so we can test latest develop
This commit is contained in:
commit
0420b89382
11 changed files with 113 additions and 28 deletions
13
Makefile
13
Makefile
|
@ -1,13 +1,20 @@
|
||||||
doc_dirs = doc $(wildcard doc/*/)
|
|
||||||
outdoc_dirs = out $(addprefix out/,$(doc_dirs))
|
|
||||||
doc_sources = $(wildcard doc/*/*.md) $(wildcard doc/*.md)
|
doc_sources = $(wildcard doc/*/*.md) $(wildcard doc/*.md)
|
||||||
outdoc_files = $(addprefix out/,$(doc_sources:.md=.html))
|
outdoc_files = $(addprefix out/,$(doc_sources:.md=.html))
|
||||||
|
|
||||||
docs: $(outdoc_files)
|
docassets = $(addprefix out/,$(wildcard doc/_assets/*))
|
||||||
|
|
||||||
|
VERSION = $(shell node -e "console.log( require('./src/package.json').version )")
|
||||||
|
|
||||||
|
docs: $(outdoc_files) $(docassets)
|
||||||
|
|
||||||
|
out/doc/_assets/%: doc/_assets/%
|
||||||
|
mkdir -p $(@D)
|
||||||
|
cp $< $@
|
||||||
|
|
||||||
out/doc/%.html: doc/%.md
|
out/doc/%.html: doc/%.md
|
||||||
mkdir -p $(@D)
|
mkdir -p $(@D)
|
||||||
node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
|
node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
|
||||||
|
cat $@ | sed 's/__VERSION__/${VERSION}/' > $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf out/
|
rm -rf out/
|
||||||
|
|
44
doc/_assets/style.css
Normal file
44
doc/_assets/style.css
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
body.apidoc {
|
||||||
|
width: 60%;
|
||||||
|
min-width: 10cm;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header {
|
||||||
|
background-color: #5a5;
|
||||||
|
padding: 10px;
|
||||||
|
color: #111;
|
||||||
|
}
|
||||||
|
|
||||||
|
a,
|
||||||
|
a:active {
|
||||||
|
color: #272;
|
||||||
|
}
|
||||||
|
a:focus,
|
||||||
|
a:hover {
|
||||||
|
color: #050;
|
||||||
|
}
|
||||||
|
|
||||||
|
#apicontent a.mark,
|
||||||
|
#apicontent a.mark:active {
|
||||||
|
float: right;
|
||||||
|
color: #BBB;
|
||||||
|
font-size: 0.7cm;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
#apicontent a.mark:focus,
|
||||||
|
#apicontent a.mark:hover {
|
||||||
|
color: #AAA;
|
||||||
|
}
|
||||||
|
|
||||||
|
#apicontent code {
|
||||||
|
padding: 1px;
|
||||||
|
background-color: #EEE;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid #DDD;
|
||||||
|
}
|
||||||
|
#apicontent pre>code {
|
||||||
|
display: block;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
@include embed_parameters
|
@include embed_parameters
|
||||||
@include http_api
|
@include http_api
|
||||||
@include hooks
|
@include hooks_overview
|
||||||
@include hooks_client-side
|
@include hooks_client-side
|
||||||
@include hooks_server-side
|
@include hooks_server-side
|
||||||
@include editorInfo
|
@include editorInfo
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>__SECTION__ Etherpad-Lite Manual & Documentation</title>
|
<title>__SECTION__ - Etherpad Lite v__VERSION__ Manual & Documentation</title>
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="_assets/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body class="apidoc" id="api-section-__FILENAME__">
|
<body class="apidoc" id="api-section-__FILENAME__">
|
||||||
<header id="header">
|
<header id="header">
|
||||||
<h1>Etherpad-Lite Manual & Documentation</h1>
|
<h1>Etherpad-Lite v__VERSION__ Manual & Documentation</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div id="toc">
|
<div id="toc">
|
||||||
|
|
|
@ -21,31 +21,49 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var log4js = require('log4js')
|
||||||
|
, async = require('async')
|
||||||
|
;
|
||||||
|
|
||||||
// set up logger
|
// set up logger
|
||||||
var log4js = require('log4js');
|
|
||||||
log4js.replaceConsole();
|
log4js.replaceConsole();
|
||||||
|
|
||||||
var settings = require('./utils/Settings');
|
var settings
|
||||||
|
, db
|
||||||
//set loglevel
|
, plugins
|
||||||
log4js.setGlobalLogLevel(settings.loglevel);
|
, hooks;
|
||||||
|
|
||||||
var db = require('./db/DB');
|
|
||||||
var async = require('async');
|
|
||||||
var plugins = require("ep_etherpad-lite/static/js/pluginfw/plugins");
|
|
||||||
var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");
|
|
||||||
var npm = require("npm/lib/npm.js");
|
var npm = require("npm/lib/npm.js");
|
||||||
|
|
||||||
hooks.plugins = plugins;
|
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
|
// load npm
|
||||||
|
function(callback) {
|
||||||
|
npm.load({}, function(er) {
|
||||||
|
callback(er)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// load everything
|
||||||
|
function(callback) {
|
||||||
|
settings = require('./utils/Settings');
|
||||||
|
db = require('./db/DB');
|
||||||
|
plugins = require("ep_etherpad-lite/static/js/pluginfw/plugins");
|
||||||
|
hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");
|
||||||
|
hooks.plugins = plugins;
|
||||||
|
|
||||||
|
//set loglevel
|
||||||
|
log4js.setGlobalLogLevel(settings.loglevel);
|
||||||
|
callback();
|
||||||
|
},
|
||||||
|
|
||||||
//initalize the database
|
//initalize the database
|
||||||
function (callback)
|
function (callback)
|
||||||
{
|
{
|
||||||
db.init(callback);
|
db.init(callback);
|
||||||
},
|
},
|
||||||
|
|
||||||
plugins.update,
|
function(callback) {
|
||||||
|
plugins.update(callback)
|
||||||
|
},
|
||||||
|
|
||||||
function (callback) {
|
function (callback) {
|
||||||
console.info("Installed plugins: " + plugins.formatPlugins());
|
console.info("Installed plugins: " + plugins.formatPlugins());
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
"jsdom-nocontextifiy" : "0.2.10",
|
"jsdom-nocontextifiy" : "0.2.10",
|
||||||
"async-stacktrace" : "0.0.2",
|
"async-stacktrace" : "0.0.2",
|
||||||
"npm" : "1.1.x",
|
"npm" : "1.1.x",
|
||||||
|
"npm-registry-client" : "0.2.10",
|
||||||
"ejs" : "0.6.1",
|
"ejs" : "0.6.1",
|
||||||
"graceful-fs" : "1.1.5",
|
"graceful-fs" : "1.1.5",
|
||||||
"slide" : "1.1.3",
|
"slide" : "1.1.3",
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
var plugins = require("ep_etherpad-lite/static/js/pluginfw/plugins");
|
var plugins = require("ep_etherpad-lite/static/js/pluginfw/plugins");
|
||||||
var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");
|
var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");
|
||||||
var npm = require("npm");
|
var npm = require("npm");
|
||||||
var registry = require("npm/lib/utils/npm-registry-client/index.js");
|
var RegClient = require("npm-registry-client")
|
||||||
|
|
||||||
|
var registry = new RegClient(
|
||||||
|
{ registry: "http://registry.npmjs.org"
|
||||||
|
, cache: npm.cache }
|
||||||
|
);
|
||||||
|
|
||||||
var withNpm = function (npmfn, final, cb) {
|
var withNpm = function (npmfn, final, cb) {
|
||||||
npm.load({}, function (er) {
|
npm.load({}, function (er) {
|
||||||
|
@ -72,7 +77,7 @@ exports.search = function(query, cache, cb) {
|
||||||
cb(null, exports.searchCache);
|
cb(null, exports.searchCache);
|
||||||
} else {
|
} else {
|
||||||
registry.get(
|
registry.get(
|
||||||
"/-/all", null, 600, false, true,
|
"/-/all", 600, false, true,
|
||||||
function (er, data) {
|
function (er, data) {
|
||||||
if (er) return cb(er);
|
if (er) return cb(er);
|
||||||
exports.searchCache = data;
|
exports.searchCache = data;
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
var npm = require("npm/lib/npm.js");
|
var npm = require("npm/lib/npm.js");
|
||||||
var readInstalled = require("./read-installed.js");
|
var readInstalled = require("./read-installed.js");
|
||||||
var relativize = require("npm/lib/utils/relativize.js");
|
|
||||||
var readJson = require("npm/lib/utils/read-json.js");
|
|
||||||
var path = require("path");
|
var path = require("path");
|
||||||
var async = require("async");
|
var async = require("async");
|
||||||
var fs = require("fs");
|
var fs = require("fs");
|
||||||
|
|
|
@ -94,8 +94,21 @@ var npm = require("npm/lib/npm.js")
|
||||||
, path = require("path")
|
, path = require("path")
|
||||||
, asyncMap = require("slide").asyncMap
|
, asyncMap = require("slide").asyncMap
|
||||||
, semver = require("semver")
|
, semver = require("semver")
|
||||||
, readJson = require("npm/lib/utils/read-json.js")
|
, log = require("log4js").getLogger('pluginfw')
|
||||||
, log = require("npm/lib/utils/log.js")
|
|
||||||
|
function readJson(file, callback) {
|
||||||
|
fs.readFile(file, function(er, buf) {
|
||||||
|
if(er) {
|
||||||
|
callback(er);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
callback( null, JSON.parse(buf.toString()) )
|
||||||
|
} catch(er) {
|
||||||
|
callback(er)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = readInstalled
|
module.exports = readInstalled
|
||||||
|
|
||||||
|
@ -274,7 +287,7 @@ function findUnmet (obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
log.verbose([obj._id], "returning")
|
log.debug([obj._id], "returning")
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,6 @@ function render(lexed, filename, template, cb) {
|
||||||
|
|
||||||
template = template.replace(/__FILENAME__/g, filename);
|
template = template.replace(/__FILENAME__/g, filename);
|
||||||
template = template.replace(/__SECTION__/g, section);
|
template = template.replace(/__SECTION__/g, section);
|
||||||
template = template.replace(/__VERSION__/g, process.version);
|
|
||||||
template = template.replace(/__TOC__/g, toc);
|
template = template.replace(/__TOC__/g, toc);
|
||||||
|
|
||||||
// content has to be the last thing we do with
|
// content has to be the last thing we do with
|
||||||
|
|
Loading…
Reference in a new issue