diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..01f30701b --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +doc_dirs = doc $(wildcard doc/*/) +outdoc_dirs = out $(addprefix out/,$(doc_dirs)) +doc_sources = $(wildcard doc/*/*.md) $(wildcard doc/*.md) +outdoc_files = $(addprefix out/,$(doc_sources:.md=.html)) + +docs: $(outdoc_files) + +out/doc/%.html: doc/%.md + mkdir -p $(@D) + node tools/doc/generate.js --format=html --template=doc/template.html $< > $@ + +clean: + rm -rf out/ diff --git a/doc/api/changeset_library.md b/doc/api/changeset_library.md index 498c29011..2dce55aa3 100644 --- a/doc/api/changeset_library.md +++ b/doc/api/changeset_library.md @@ -1,4 +1,4 @@ -## Changeset Library +# Changeset Library ``` "Z:z>1|2=m=b*0|1+1$\n" @@ -8,7 +8,7 @@ This is a Changeset. Its just a string and its very difficult to read in this fo A changeset describes the diff between two revisions of the document. The Browser sends changesets to the server and the server sends them to the clients to update them. This Changesets gets also saved into the history of a pad. Which allows us to go back to every revision from the past. -### Changeset.unpack(changeset) +## Changeset.unpack(changeset) * `changeset` {String} @@ -23,7 +23,7 @@ This functions returns an object representaion of the changeset, similar to this * `ops` {String} the actual changes, introduced by this changeset. * `charBank` {String} All characters that are added by this changeset. -### Changeset.opIterator(ops) +## Changeset.opIterator(ops) * `ops` {String} The operators, returned by `Changeset.unpack()` @@ -31,7 +31,7 @@ Returns an operator iterator. This iterator allows us to iterate over all operat You can iterate with an opIterator using its `next()` and `hasNext()` methods. Next returns the `next()` operator object and `hasNext()` indicates, whether there are any operators left. -### The Operator object +## The Operator object There are 3 types of operators: `+`,`-` and `=`. These operators describe different changes to the document, beginning with the first character of the document. A `=` operator doesn't change the text, but it may add or remove text attributes. A `-` operator removes text. And a `+` Operator adds text and optionally adds some attributes to it. * `opcode` {String} the operator type @@ -39,7 +39,7 @@ There are 3 types of operators: `+`,`-` and `=`. These operators describe differ * `lines` {Number} the number of lines changed by this operator. * `attribs` {attribs} attributes set on this text. -#### Example +### Example ``` { opcode: '+', chars: 1, @@ -47,7 +47,7 @@ There are 3 types of operators: `+`,`-` and `=`. These operators describe differ attribs: '*0' } ``` -### APool +## APool ``` > var AttributePoolFactory = require("./utils/AttributePoolFactory"); @@ -97,7 +97,7 @@ We used the fromJsonable function to fill the empty apool with values. the fromJ Simple example of how to get the key value pair for the attribute 1 -### AText +## AText ``` > var atext = {"text":"bold text\nitalic text\nnormal text\n\n","attribs":"*0*1+9*0|1+1*0*1*2+b|1+1*0+b|2+2"}; @@ -148,4 +148,4 @@ This is an atext. An atext has two parts: text and attribs. The text is just the The attribs are again a bunch of operators like .ops in the changeset was. But these operators are only + operators. They describe which part of the text has which attributes -For more information see /doc/easysync/easysync-notes.txt in the source. \ No newline at end of file +For more information see /doc/easysync/easysync-notes.txt in the source. diff --git a/doc/api/editorInfo.md b/doc/api/editorInfo.md index 38902bb5d..e4322e9e1 100644 --- a/doc/api/editorInfo.md +++ b/doc/api/editorInfo.md @@ -1,47 +1,47 @@ -## editorInfo +# editorInfo -### editorInfo.ace_replaceRange(start, end, text) +## editorInfo.ace_replaceRange(start, end, text) This function replaces a range (from `start` to `end`) with `text`. -### editorInfo.ace_getRep() +## editorInfo.ace_getRep() Returns the `rep` object. -### editorInfo.ace_getAuthor() -### editorInfo.ace_inCallStack() -### editorInfo.ace_inCallStackIfNecessary(?) -### editorInfo.ace_focus(?) -### editorInfo.ace_importText(?) -### editorInfo.ace_importAText(?) -### editorInfo.ace_exportText(?) -### editorInfo.ace_editorChangedSize(?) -### editorInfo.ace_setOnKeyPress(?) -### editorInfo.ace_setOnKeyDown(?) -### editorInfo.ace_setNotifyDirty(?) -### editorInfo.ace_dispose(?) -### editorInfo.ace_getFormattedCode(?) -### editorInfo.ace_setEditable(bool) -### editorInfo.ace_execCommand(?) -### editorInfo.ace_callWithAce(fn, callStack, normalize) -### editorInfo.ace_setProperty(key, value) -### editorInfo.ace_setBaseText(txt) -### editorInfo.ace_setBaseAttributedText(atxt, apoolJsonObj) -### editorInfo.ace_applyChangesToBase(c, optAuthor, apoolJsonObj) -### editorInfo.ace_prepareUserChangeset() -### editorInfo.ace_applyPreparedChangesetToBase() -### editorInfo.ace_setUserChangeNotificationCallback(f) -### editorInfo.ace_setAuthorInfo(author, info) -### editorInfo.ace_setAuthorSelectionRange(author, start, end) -### editorInfo.ace_getUnhandledErrors() -### editorInfo.ace_getDebugProperty(prop) -### editorInfo.ace_fastIncorp(?) -### editorInfo.ace_isCaret(?) -### editorInfo.ace_getLineAndCharForPoint(?) -### editorInfo.ace_performDocumentApplyAttributesToCharRange(?) -### editorInfo.ace_setAttributeOnSelection(?) -### editorInfo.ace_toggleAttributeOnSelection(?) -### editorInfo.ace_performSelectionChange(?) -### editorInfo.ace_doIndentOutdent(?) -### editorInfo.ace_doUndoRedo(?) -### editorInfo.ace_doInsertUnorderedList(?) -### editorInfo.ace_doInsertOrderedList(?) -### editorInfo.ace_performDocumentApplyAttributesToRange() \ No newline at end of file +## editorInfo.ace_getAuthor() +## editorInfo.ace_inCallStack() +## editorInfo.ace_inCallStackIfNecessary(?) +## editorInfo.ace_focus(?) +## editorInfo.ace_importText(?) +## editorInfo.ace_importAText(?) +## editorInfo.ace_exportText(?) +## editorInfo.ace_editorChangedSize(?) +## editorInfo.ace_setOnKeyPress(?) +## editorInfo.ace_setOnKeyDown(?) +## editorInfo.ace_setNotifyDirty(?) +## editorInfo.ace_dispose(?) +## editorInfo.ace_getFormattedCode(?) +## editorInfo.ace_setEditable(bool) +## editorInfo.ace_execCommand(?) +## editorInfo.ace_callWithAce(fn, callStack, normalize) +## editorInfo.ace_setProperty(key, value) +## editorInfo.ace_setBaseText(txt) +## editorInfo.ace_setBaseAttributedText(atxt, apoolJsonObj) +## editorInfo.ace_applyChangesToBase(c, optAuthor, apoolJsonObj) +## editorInfo.ace_prepareUserChangeset() +## editorInfo.ace_applyPreparedChangesetToBase() +## editorInfo.ace_setUserChangeNotificationCallback(f) +## editorInfo.ace_setAuthorInfo(author, info) +## editorInfo.ace_setAuthorSelectionRange(author, start, end) +## editorInfo.ace_getUnhandledErrors() +## editorInfo.ace_getDebugProperty(prop) +## editorInfo.ace_fastIncorp(?) +## editorInfo.ace_isCaret(?) +## editorInfo.ace_getLineAndCharForPoint(?) +## editorInfo.ace_performDocumentApplyAttributesToCharRange(?) +## editorInfo.ace_setAttributeOnSelection(?) +## editorInfo.ace_toggleAttributeOnSelection(?) +## editorInfo.ace_performSelectionChange(?) +## editorInfo.ace_doIndentOutdent(?) +## editorInfo.ace_doUndoRedo(?) +## editorInfo.ace_doInsertUnorderedList(?) +## editorInfo.ace_doInsertOrderedList(?) +## editorInfo.ace_performDocumentApplyAttributesToRange() diff --git a/doc/api/embed_parameters.md b/doc/api/embed_parameters.md index e8f9eaf7e..587305665 100644 --- a/doc/api/embed_parameters.md +++ b/doc/api/embed_parameters.md @@ -1,4 +1,4 @@ -## Embed parameters +# Embed parameters You can easily embed your etherpad-lite into any webpage by using iframes. You can configure the embedded pad using embed paramters. Example: @@ -9,39 +9,39 @@ Cut and paste the following code into any webpage to embed a pad. The parameters ``` -### showLineNumbers +## showLineNumbers * Boolean Default: true -### showControls +## showControls * Boolean Default: true -### showChat +## showChat * Boolean Default: true -### useMonospaceFont +## useMonospaceFont * Boolean Default: false -### userName +## userName * String Default: "unnamed" Example: `userName=Etherpad%20User` -### noColors +## noColors * Boolean Default: false -### alwaysShowChat +## alwaysShowChat * Boolean -Default: false \ No newline at end of file +Default: false diff --git a/doc/api/hooks_client-side.md b/doc/api/hooks_client-side.md index 03703e6b5..50ec3f989 100644 --- a/doc/api/hooks_client-side.md +++ b/doc/api/hooks_client-side.md @@ -1,4 +1,4 @@ -## Client-side hooks +# Client-side hooks Most of these hooks are called during or in order to set up the formatting process. All hooks registered to these events are called with two arguments: @@ -6,7 +6,7 @@ All hooks registered to these events are called with two arguments: 1. name - the name of the hook being called 2. context - an object with some relevant information about the context of the call -### documentReady +## documentReady Called from: src/templates/pad.html Things in context: @@ -15,7 +15,7 @@ nothing This hook proxies the functionality of jQuery's `$(document).ready` event. -### aceDomLineProcessLineAttributes +## aceDomLineProcessLineAttributes Called from: src/static/js/domline.js Things in context: @@ -31,7 +31,7 @@ The return value of this hook should have the following structure: The preHtml and postHtml values will be added to the HTML display of the element, and if processedMarker is true, the engine won't try to process it any more. -### aceCreateDomLine +## aceCreateDomLine Called from: src/static/js/domline.js Things in context: @@ -47,7 +47,7 @@ The return value of this hook should have the following structure: extraOpenTags and extraCloseTags will be added before and after the element in question, and cls will be the new class of the element going forward. -### acePostWriteDomLineHTML +## acePostWriteDomLineHTML Called from: src/static/js/domline.js Things in context: @@ -56,7 +56,7 @@ Things in context: This hook is for right after a node has been fully formatted and written to the page. -### aceAttribsToClasses +## aceAttribsToClasses Called from: src/static/js/linestylefilter.js Things in context: @@ -69,7 +69,7 @@ This hook is called during the attribute processing procedure, and should be use The return value for this function should be a list of classes, which will then be parsed into a valid class string. -### aceGetFilterStack +## aceGetFilterStack Called from: src/static/js/linestylefilter.js Things in context: @@ -79,14 +79,14 @@ Things in context: This hook is called to apply custom regular expression filters to a set of styles. The one example available is the ep_linkify plugin, which adds internal links. They use it to find the telltale `[[ ]]` syntax that signifies internal links, and finding that syntax, they add in the internalHref attribute to be later used by the aceCreateDomLine hook (documented above). -### aceEditorCSS +## aceEditorCSS Called from: src/static/js/ace.js Things in context: None This hook is provided to allow custom CSS files to be loaded. The return value should be an array of paths relative to the plugins directory. -### aceInitInnerdocbodyHead +## aceInitInnerdocbodyHead Called from: src/static/js/ace.js Things in context: @@ -95,7 +95,7 @@ Things in context: This hook is called during the creation of the editor HTML. The array should have lines of HTML added to it, giving the plugin author a chance to add in meta, script, link, and other tags that go into the `
` element of the editor HTML document. -### aceEditEvent +## aceEditEvent Called from: src/static/js/ace2_inner.js Things in context: @@ -107,14 +107,14 @@ Things in context: This hook is made available to edit the edit events that might occur when changes are made. Currently you can change the editor information, some of the meanings of the edit, and so on. You can also make internal changes (internal to your plugin) that use the information provided by the edit event. -### aceRegisterBlockElements +## aceRegisterBlockElements Called from: src/static/js/ace2_inner.js Things in context: None The return value of this hook will add elements into the "lineMarkerAttribute" category, making the aceDomLineProcessLineAttributes hook (documented below) call for those elements. -### aceInitialized +## aceInitialized Called from: src/static/js/ace2_inner.js Things in context: @@ -125,7 +125,7 @@ Things in context: This hook is for inserting further information into the ace engine, for later use in formatting hooks. -### postAceInit +## postAceInit Called from: src/static/js/pad.js Things in context: @@ -134,7 +134,7 @@ Things in context: There doesn't appear to be any example available of this particular hook being used, but it gets fired after the editor is all set up. -### userJoinOrUpdate +## userJoinOrUpdate Called from: src/static/js/pad_userlist.js Things in context: @@ -143,7 +143,7 @@ Things in context: This hook is called on the client side whenever a user joins or changes. This can be used to create notifications or an alternate user list. -### collectContentPre +## collectContentPre Called from: src/static/js/contentcollector.js Things in context: @@ -156,7 +156,7 @@ Things in context: This hook is called before the content of a node is collected by the usual methods. The cc object can be used to do a bunch of things that modify the content of the pad. See, for example, the heading1 plugin for etherpad original. -### collectContentPost +## collectContentPost Called from: src/static/js/contentcollector.js Things in context: @@ -169,7 +169,7 @@ Things in context: This hook is called after the content of a node is collected by the usual methods. The cc object can be used to do a bunch of things that modify the content of the pad. See, for example, the heading1 plugin for etherpad original. -### handleClientMessage_`name` +## handleClientMessage_`name` Called from: `src/static/js/collab_client.js` Things in context: diff --git a/doc/api/hooks_server-side.md b/doc/api/hooks_server-side.md index 8fd5c3ba7..8177696af 100644 --- a/doc/api/hooks_server-side.md +++ b/doc/api/hooks_server-side.md @@ -1,4 +1,4 @@ -## Server-side hooks +# Server-side hooks These hooks are called on server-side. All hooks registered to these events are called with two arguments: @@ -6,7 +6,7 @@ All hooks registered to these events are called with two arguments: 1. name - the name of the hook being called 2. context - an object with some relevant information about the context of the call -### pluginUninstall +## pluginUninstall Called from: src/static/js/pluginfw/installer.js Things in context: @@ -15,7 +15,7 @@ Things in context: If this hook returns an error, the callback to the uninstall function gets an error as well. This mostly seems useful for handling additional features added in based on the installation of other plugins, which is pretty cool! -### pluginInstall +## pluginInstall Called from: src/static/js/pluginfw/installer.js Things in context: @@ -24,14 +24,14 @@ Things in context: If this hook returns an error, the callback to the install function gets an error, too. This seems useful for adding in features when a particular plugin is installed. -### init_`