help3/html/README.md | 50 -------------------- help3/html/autocomplete.js | 111 ++++++++++++++++++++++++++++++++++++++++++++- help3/html/mode/xml/xml.js | 6 +- 3 files changed, 114 insertions(+), 53 deletions(-)
New commits: commit 41a9c4ddeb2d2785a583507c7a210dd54f55bada Author: Mike Saunders <mike.saund...@documentfoundation.org> AuthorDate: Wed Sep 5 09:38:21 2018 -0300 Commit: Olivier Hallot <olivier.hal...@libreoffice.org> CommitDate: Thu Sep 6 14:15:21 2018 +0200 xhp-editor, further work Hello, I've had some more time to work on the editor -- the latest version is attached! My changes: * Completed the XHP syntax (see autocomplete.js -- and note that entities and attributes with dashes need to be surrounded with quotes) * Fixed the problem with "meta" not closing properly, as you saw in the video a while back (for future reference, the problem was caused in mode/xml/xml.js: line 15: "autoSelfClosers", which had "meta" defined. If any other XHP entities have this problem, check there first) * Removed various unneeded CodeMirror files, to simplify the structure and hopefully make it easier for others to get involved * Some cosmetic cleanups Change-Id: If536db1e1c6dd13a6088d72658b79843d32edc44 Reviewed-on: https://gerrit.libreoffice.org/60034 Reviewed-by: Olivier Hallot <olivier.hal...@libreoffice.org> Tested-by: Olivier Hallot <olivier.hal...@libreoffice.org> diff --git a/help3/html/README.md b/help3/html/README.md index 9a982bc..8a4ff82 100644 --- a/help3/html/README.md +++ b/help3/html/README.md @@ -1,49 +1,3 @@ -# CodeMirror +# LibreOffice Documentation XHP Editor -[![Build Status](https://travis-ci.org/codemirror/CodeMirror.svg)](https://travis-ci.org/codemirror/CodeMirror) -[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror) -[![Join the chat at https://gitter.im/codemirror/CodeMirror](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/codemirror/CodeMirror) -[Funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?again)](https://marijnhaverbeke.nl/fund/) - -CodeMirror is a versatile text editor implemented in JavaScript for -the browser. It is specialized for editing code, and comes with over -100 language modes and various addons that implement more advanced -editing functionality. Every language comes with fully-featured code -and syntax highlighting to help with reading and editing complex code. - -A rich programming API and a CSS theming system are available for -customizing CodeMirror to fit your application, and extending it with -new functionality. - -You can find more information (and the -[manual](http://codemirror.net/doc/manual.html)) on the [project -page](http://codemirror.net). For questions and discussion, use the -[discussion forum](https://discuss.codemirror.net/). - -See -[CONTRIBUTING.md](https://github.com/codemirror/CodeMirror/blob/master/CONTRIBUTING.md) -for contributing guidelines. - -The CodeMirror community aims to be welcoming to everybody. We use the -[Contributor Covenant -(1.1)](http://contributor-covenant.org/version/1/1/0/) as our code of -conduct. - -### Installation - -Either get the [zip file](https://codemirror.net/codemirror.zip) with -the latest version, or make sure you have [Node](https://nodejs.org/) -installed and run: - - npm install codemirror - -**NOTE**: This is the source repository for the library, and not the -distribution channel. Cloning it is not the recommended way to install -the library, and will in fact not work unless you also run the build -step. - -### Quickstart - -To build the project, make sure you have Node.js installed (at least version 6) -and then `npm install`. To run, just open `index.html` in your -browser (you don't need to run a webserver). Run the tests with `npm test`. +This is based on CodeMirror: http://codemirror.net diff --git a/help3/html/autocomplete.js b/help3/html/autocomplete.js index ed00af7..8d2bad3 100644 --- a/help3/html/autocomplete.js +++ b/help3/html/autocomplete.js @@ -17,17 +17,124 @@ var tags = { attrs: {version: ["1.0"]}, }, meta: { + children: ["topic", "history"], attrs: {localise: ["false"]}, - children: ["topic", "history"] + }, + topic: { + children: ["title", "bookmark", "filename"], + attrs: {id: null, indexer: ["exclude", "include"]} + }, + history: { + children: ["created", "lastedited"] + }, + created: { + attrs: {date: null} + }, + lastedited: { + attrs: {date: null} }, body: { - attrs: {name: null}, + attrs: {name: null, localize: ["false"]}, children: ["section", "paragraph", "table", "comment", "bookmark", "switch", "embed", "list", "sort"] }, section: { attrs: {id: null, localise: ["false"]}, children: ["section", "paragraph", "table", "list", "comment", "embed", "switch", "sort"] }, + paragraph: { + attrs: {'xml-lang': null, role: null, level: null, id: null, l10n: null, oldref: null, localize: ["false"]}, + children: ["image", "embedvar", "br", "emph", "help-id-missing", "item", "link", "switchinline", "variable", "ahelp", "object", "bookmark"] + }, + image: { + attrs: {src: null, width: null, height: null, id: null, localize: null}, + children: ["caption", "alt"] + }, + caption: { + attrs: {id: null, localize: ["false"]}, + children: ["embedvar", "br", "emph", "item", "link", "switchinline", "variable"] + }, + alt: { + attrs: {'xml-lang': null, id: null, localize: ["false"]}, + }, + embedvar: { + attrs: {href: null, markup: ["keep", "ignore"]}, + }, + br: { + attrs: {'xml-lang': null, id: null, localize: ["false"]}, + children: ["embedvar", "br", "emph", "item", "link", "switchinline", "variable"] + }, + emph: { + children: ["item", "comment", "help-id-missing"] + }, + item: { + attrs: {type: null}, + }, + link: { + attrs: {href: null, name: null, type: null}, + children: ["emph", "item", "variable", "embedvar", "switchinline"] + }, + switchinline: { + attrs: {select: null}, + children: ["caseinline", "defaultinline"] + }, + variable: { + attrs: {id: null, visibility: ["hidden", "visible"]}, + children: ["ahelp", "embedvar", "br", "emph", "item", "link", "variable", "image", "object", "switchinline"] + }, + ahelp: { + attrs: {hid: null, visibility: ["hidden", "visible"]}, + children: ["comment", "embedvar", "br", "emph", "item", "link", "variable"] + }, + object: { + attrs: {type: null, id: null, data: null, width: null, height: null}, + }, + bookmark: { + attrs: {branch: null, 'xml-lang': null, localize: ["false"]}, + children: ["bookmark-value"] + }, + 'bookmark-value': { + children: ["embedvar"] + }, + table: { + attrs: {name: null, width: null, height: null, unit: ["px", "pt"], class: null, id: null, localize: ["false"]}, + children: ["caption", "tablerow"] + }, + tablerow: { + attrs: {height: null, unit: ["px", "pt", "cm", "in"], class: null, localize: ["false"]}, + children: ["tablecell"] + }, + tablecell: { + attrs: {colspan: null, rowspan: null, width: null, unit: ["px", "pt", "cm", "in", "pct"], class: null, localize: ["false"]}, + }, + list: { + attrs: {type: ["ordered", "unordered"], startwith: null, format: ["1", "i", "I", "a"], bullet: ["disc", "circle", "square"], localize: ["false"], sorted: ["asc", "desc"]}, + children: ["listitem", "comment"] + }, + listitem: { + attrs: {format: ["1", "i", "I", "a"], bullet: ["disc", "circle"], localize: ["false"], class: null}, + children: ["comment", "section", "paragraph", "table", "switch", "embed", "bookmark"] + }, + sort: { + attrs: {order: ["asc", "desc"]}, + children: ["section"] + }, + embed: { + attrs: {href: null, role: null, level: null}, + }, + switch: { + attrs: {select: ["sys"], localize: ["false"]}, + children: ["case", "comment", "default"] + }, + case: { + attrs: {select: null}, + children: ["paragraph", "table", "comment", "bookmark", "embed", "list", "switch", "section"] + }, + default: { + children: ["paragraph", "table", "comment", "bookmark", "embed", "list", "section"] + }, + title: { + attrs: {'xml-lang': null, id: null, localize: ["false"]}, + }, }; // And here's the code that provides the auto-completion in the editor diff --git a/help3/html/mode/xml/xml.js b/help3/html/mode/xml/xml.js index 0f1c9b1..ea2dc13 100644 --- a/help3/html/mode/xml/xml.js +++ b/help3/html/mode/xml/xml.js @@ -12,9 +12,9 @@ "use strict"; var htmlConfig = { - autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, - 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, - 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, + autoSelfClosers: {'area': true, 'base': true, 'col': true, 'command': true, + 'frame': true, 'hr': true, 'img': true, 'input': true, + 'keygen': true, 'param': true, 'source': true, 'track': true, 'wbr': true, 'menuitem': true}, implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits