📄 Text editor for plaintext files
Перейти к файлу
dependabot[bot] 8772d2ddf1
Merge pull request #934 from nextcloud/dependabot/npm_and_yarn/sass-1.81.0
2024-11-16 02:06:44 +00:00
.github ci: Update workflows 2024-09-10 11:08:16 +02:00
.tx
appinfo bump min nc version to 24 2023-07-18 19:49:22 +02:00
css
img
js
l10n Fix(l10n): Update translations from Transifex 2024-11-04 00:54:38 +00:00
lib
tests
.gitignore
.nextcloudignore
.php-cs-fixer.dist.php
.scrutinizer.yml
CHANGELOG.md
Makefile
README.md
babel.config.js
composer.json
composer.lock Build(deps-dev): Bump phpunit/phpunit from 9.6.18 to 9.6.19 2024-04-06 01:24:47 +00:00
krankerl.toml
package-lock.json Build(deps-dev): Bump sass from 1.80.6 to 1.81.0 2024-11-16 02:05:20 +00:00
package.json Build(deps-dev): Bump sass from 1.80.6 to 1.81.0 2024-11-16 02:05:20 +00:00
webpack.config.js

README.md

Texteditor

Build Status Scrutinizer Code Quality Code Coverage

The original text editor app for Nextcloud, based on Ace.

Features:

  • Syntax highlighting
  • Autosave
  • Syntax checking
  • Responsive design (optimised on mobile and desktop)

Install

Simply copy the files_texteditor folder into the apps directory and enable the app within the Nextcloud settings.

Usage

To use the editer, click on a supported file within the Files app and the file will be loaded into the editor. Saving is automatic, but can also be triggered manually with Ctrl+S or Cmd+S.

Contributors

Maintainer: Robin Appelman Past contributors: Thomas Müller Tom Needham Jörn Friedrich Dreyer Vincent Petry

Preview apps

Apps can add side-by-side previews to the app for certain file types by using the preview api


OCA.MYApp.Preview = function(){
    ...
}

OCA.MYApp.Preview.Prototype = {
    /**
     * Give the app the opportunity to load any resources it needs and prepare for rendering a preview
     */
    init: function() {
        ...
    },
    /**
     * @param {string} the text to create the preview for
     * @param {jQuery} the jQuery element to render the preview in
     */
    preview: function(text, previewElement) {
        ...
    }
}

OCA.Files_Texteditor.registerPreviewPlugin('text/markdown', new OCA.MYApp.Preview());

For styling of the preview, the preview element will have the id preview and the className will be set to the mimetype of the file being eddited with any slash replaced by dashes.

e.g. when editing a markdown file the preview element can be styled using the #preview.text-markdown css query.