Giter Club home page Giter Club logo

dokuwiki-plugin-codemirror's Introduction

CodeMirror plugin for DokuWiki
==============================

Documentation for this plugin can be found at
http://www.dokuwiki.org/plugin:codemirror

Source code for this plugin can be found at
https://github.com/albertgasset/dokuwiki-plugin-codemirror

----

Copyright (C) 2014-2017  Albert Gasset <[email protected]>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

dokuwiki-plugin-codemirror's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dokuwiki-plugin-codemirror's Issues

A single space character at the end of the line does not show in Safari

In the screenshot below, there is a letter 'f' and a space after the letter, and the cursor is right after the space character.

However, if I'm editing anywhere in the middle of the line, this problem doesn't occur.

I have tried on a fresh installation of DokuWiki to make sure plugins weren't interfering with this, and this problem doesn't occur on Firefox.

I'm using Safari 10.0.1.

screen shot 2017-01-07 at 6 33 20 pm

integration with other plugins

Hi,

Would it be possible to use a named function instead of an anonymous function as a plugin wrapper, so that it can be called by other plugins?

[enhancement] Markdown / LateX support in dokuwiki editor

Hi, I replaced dokuwiki syntax with markdown (via markdowku plugin), in addition the source is plenty of LateX code.
I don't know if it is already possible, but I couldn't activate Latex and/or Markdown syntax highlighting in the source editor via codemirror.
I know it is possible in the rendered html, but I'ld need it for the code editor.
Netsaver Paul, Rome, IT

Not compatible with Vector template

Hi,
I have installed this plug-in on a closed wiki that is using the Vector template. However, it seems that the plug-in is not compatible with this template as it adds half-spaces between the lines. However, if I disable the Vector template and use the dokuwiki default template, the plug-in looks and works as expected.

Improvement - The edit form should be resizable...

Perhaps I've got an old version (2014) but it seems that the 'div' of the edit form is not resizable.

It would be great to have it resizable adding this kind of css statement:

form#dw__editform .CodeMirror {resize: both;}

Sorry if it's done in the current version...

Not able to mark text and incompatible with Typography plugin

After installing the codemirror plugin I´m not able anymore to select more than one line of text in the editor. (only one line is possible)
+
When I try to use the Typography plugin (select 1 line or a single word) the result look like:

I select the 2 words: selected text

and then use the plugin icon for e.g. medium text, the result is:

====

selec

rest of the code mirror stuff?

Thanks for the great program. I was thinking about customizing it per instructions on codemirror.net, but the full code mirror package is not included in the plugin. The codemirror folder is empty, so it's not obvious how one would add plugins, change style and so on. Is there a reason why its not there?

Request: anchor/link autocomplete

Hello,

I would like to have a completion of existing achors/links (within a namespace) by pressing ctrl-space after typing "[[". Often I do not know the correct link names and searching for them in a different browser tab is not very handy.

Would this an interesting feature you could imagine to implement? Or when I want to implement that on my own what's the best way to do so (clone your repository or checkin to yours)?

Regards,

Ralf

copy paste of batch script

a copy&paste of a bash code from notepad++ (linux line end) within is not displayed properly. the "download" of the code looks alrigt.

See the attached screenshots
View from N++ and also on Unix (AIX) Shell:
code_ok_from_npp

View from Dokuwiki:
code_not_ok_from_dokuwiki

View from Dokuwiki Editor (with codemirror):
code_not_ok_from_dokuwiki_codemirror

I missed some shortcuts

The codemirror has some very nice new features, but I really missed some useful shortkeys:

  • Move lines down/up (Alt-Up/Down)

  • Ident/Outdent (Tab/Shift-Tab)

  • Replace {All] (Strg-{Shift}-R)

    Can you help?

Highlighting did not work in IE and 404 (Not Found) Error in Chrome

Hi,

installed the latest Version of codemirror plugín for dokuwiki.

It is not possible to highlight any text in ie while editing. When I use F12 in Chrome (in Chrome the highlight work) it shows:

GET http://.../dokuwiki/lib/plugins/codemirror/dist/scripts.min.js.map 404 (Not Found)
lib/plugins/codemirror/dist/modes/htmlmixed.min.js.map:1 GET http://..../dokuwiki/lib/plugins/codemirror/dist/modes/htmlmixed.min.js.map 404 (Not Found)
xml.min.js.map:1 GET http://.../dokuwiki/lib/plugins/codemirror/dist/modes/xml.min.js.map 404 (Not Found)
javascript.min.js.map:1 GET http://.../dokuwiki/lib/plugins/codemirror/dist/modes/javascript.min.js.map 404 (Not Found)
css.min.js.map:1 GET http://.../dokuwiki/lib/plugins/codemirror/dist/modes/css.min.js.map 404 (Not Found)

How to make offsets in code smaller

Hello!
I typed in my dokuwiki:

<code>
for t in [1, 2, 3, 4, 5]:
     print(t)
</code>

After I pressed preview button, I saw that code offset is too big:
code offset
How can I make this offset smaller?
Thanks in advance.

"Smiley replacement" breaks editor

I'm witnessing a weird behavior. On a page we have lots of curl commands and explanations for ontology related calls and such. This means we have a lot of text that "looks" like a Smiley but is included in inline code tags or actual code blocks. It appears CodeMirror breaks when some of these elements are tried to be parsed. My Chrome console shows:

codemirror.js:5391 Uncaught SyntaxError: Invalid regular expression: /^(?:8-\\\\ 
... 
LOTS of backslashes 
... 
\\\:LOL|FIXME|DELETEME)(?=\W|$)/: RegExp too big

To reproduce (put errorpage from the pastebin below into your wiki):
Move cursor to the end of the "--header" section. Right behind ''X-Custom-Header:''
Type a space " ".

This immediately makes the entire preview text disappear and the editor unusable. After a couple of seconds the tab becomes unresponsive. Then after a few more seconds the console shows the error described above and depicted in the screenshots.

When I comment out all entries in "smileys.conf" then the error message says:

codemirror.js:5964 Uncaught SyntaxError: Invalid regular expression: /^(?:<->|->|<-|

I get the same errors referencing to min.js but I guess that just because of the script compression.

end_error
more_error
start_error

http://gfycat.com/BitesizedUnfortunateCirriped

Find the full page that causes this here: http://pastebin.com/SVnNr053

I'm running Detritus with CodeMirror 20150827

no autoresize of the codemirror textarea

codemirror textarea is not resizable. I get a fixed textarea oh 300px heigth directly in HTML (not even a css rule...)

is pretty useless: i've got a big screeen and a 500x300 textarea
image

Load js and css only for editors

I see this plugin's js and css doesn't get added to dokuwiki's compressed files, so maybe it would be easy to have it only load for logged in users?

mousebuffer paste does not work

Hi Albert,
pasting stuff from the mousebuffer with middle mouse button into the editor windows does not work with enabled codemirror plugin. If we use the standard dokuwiki editor, pasting with middle mouse button works.

system is fedora19, same issue on fedora20.
browsers are firefox in versions: 34, 37
do you need more information about the system? I will provide it.

is it basically supposed to work? or do you catch middle mouse button for something else?

hope you can help us with this issue, we just upgraded our dokuwiki to the newest hrun version and find your codemirror editor pretty neat and useful :)

all the best
Jojo@LINBIT Vienna

middle-mouse-click fails with codemirror on firefox and opera

Middle mouse button paste fails on my desktops in firefox/iceweasel and opera. Most of the time nothing happens. Firefox sometimes (but not always) behaves as if the back button was pressed. Opera sometimes segfaults.
However, middle mouse button paste works as expected in chromium, konqueror and rekonq.

  • firefox version: 31.4.0
  • opera version: 12.6
  • rekonq version: 0.9.2
  • konqueror version: 14.0.2
  • platform: linux 3.16.0.4-amd64, debian testing/jessie, upgraded weekly

BTW, thank you for the very useful plugin! I'd be pleased if it would be integrated in dokuwiki main someday.

---<)kaimartin(>---

Bug with external links

Hey,

since i updated to last revision i always get a problem with links in editor. If i write an external link starting with http:// or https:// i cannot save or preview the updated content. instead the acton performed when pressing the save or preview button is the direct download of doku.php
err

this is really strange. i think there is an escape problem

conflict with tagentry

Hi,

tagentry uses the textarea "wiki__text" to make changes with the tags. With codemirror plugin enabled this doesn´t work.....

Is there a chance to get tagentry work with codemirror? Is there a way to tell your plugin with the script.js from tagentry there where changes for the page?

Thanks

The plugin stopped working.

I've been ussing dokuwiki to keep track of my projects for a few months now (The release bundled with mapache, in win32) and today, after a month or so of dissuse, I opened the wiki. The first thing I did was updating the plugins, which from the top of my head were Codemirror, Cgkedit, and fastwiki.
Then I went to edit a page and, surprise, I got this: screenshot 370
Which is really weird, because habitually it only looks like that when I forget javascript disabled. After some dabbling -disabling fastwiki and deleting the cache- I improved things a bit, screenshot 368, to get at least the basic DW editor. Which, again, is strange because after re enabling fastwiki it still looks the exact same way.
For now I've deleted the cache and removed the cgkedit plugin, but I still haven't been able to get codemirror to show itself. even after downgrading codemirror. These are the plugins I am currently ussing, which I had used without troubles before.

Edit area is initialized with wrong height

When I enter edit mode with CodeMirror active, the edit window only shows about 17 lines. I had configured it to show about twice as much. If I click on the arrow buttons below the edit area to change the height of the edit area, the correct (previously saved) height is applied. But that only lasts until the next time I enter edit mode.

Line numbering format is broken when sidebar runs out of space

When line numbering is activated in the settings menu the formatting breaks when the number becomes larger than the sidebar width. For example:

When the number of lines reaches 100 the number is displayed as
10
0
all subsequent numbers are rendered overlapping the indented last number and is no longer usable. The problem temporarily solves itself when the line number reaches four digits and occurs again when the number reaches five digits and so on ...

Please see attached screenshots for the described behavior.
100 Lines
100lines
999 Lines
999lines
1000 Lines
1000lines
100.000 Lines
100000lines

When acronyms.conf is empty or missing editor will not work

There is an abbreviation tooltip feature in DokuWiki that can only be disabled by deleting or emptying the file /conf/acronyms.conf. If I do so the codemirror editor will not function.

I will click to edit a page but instead see an empty "default" editor dialog (even though the page has content) but you can not (fortunately) enter anything into the editor or save.

From what I can tell codemirror uses the acronym list to highlight corresponding words in the editor view. It would be nice to be able to disable acronyms for whatever reason and still be able to use the codemirror editor.

spellchecking

Hi,

Thanks a lot for this wonderful plugin. And I haven't yet tested the Vim key map. Indeed, it is amazing.
I don't know if it is a bug or a conflict with other plugin but the spellchecking doesn't work for me. I have tested quite all theme color, enable or disable options, and on Chromium and Firefox.
Annoying, because it is useful. Btw, it is possible to come back to native editor for spellchecking.
An idea on this issue.

Thanks,

No scroll on Enter

When I create a new line via the return key, the editor view, does not scroll down. The scroll happens on the first character input afterwards.
I have this problem on chromium 50.

Heading highlighted incompletely

The first equal sign of a heading is not always highlighted. This happens when the heading follows a monospaced list item (though there may be other situations where this occurs).

clipboard02

Doesn't work with fastwiki plugin

fastwiki (https://www.dokuwiki.org/plugin:fastwiki) switches to edit mode without reloading the page, so codemirror doesn't work when it's installed. Several people have wanted to use the two plugins side-by-side (see zioth/dokuwiki_fastwiki#18).

I'm not sure how to install the uncompressed version of your plugin, but I believe you can fix this by adding the following code to init.js:

    // fastwiki plugin support
    jQuery(window).on('fastwiki:afterSwitch', function(evt, viewMode, isSectionEdit, prevViewMode) {
        if (viewMode == 'edit' || isSectionEdit) {
            var textarea = jQuery('#wiki__text');
            if (textarea.length) {
                initMode();
                initHooks();
                initSettingsMenu();

                if (getSetting('nativeeditor') === '0') {
                    initCodeMirror();
                }
            }
        }
        else {
            destroyCodeMirror();
        }
    });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.