Coder Social home page Coder Social logo

tosher / mediawiker Goto Github PK

View Code? Open in Web Editor NEW
135.0 13.0 27.0 9.11 MB

A plugin for Sublime Text editor that adds possibility to use it as Wiki Editor on MediaWiki-based sites like Wikipedia and many other.

License: Other

JavaScript 0.04% AppleScript 0.04% Python 99.82% Rich Text Format 0.01% Shell 0.10%
wiki-editor mediawiki wikipedia sublime-text-wiki-editor

mediawiker's Introduction

Sublime Text plugin: Mediawiker

Mediawiker is a plugin for Sublime Text editor that adds possibility to use it as Wiki Editor on Mediawiki based sites like Wikipedia and many other.

Main features

  • MWClient library based.
  • Syntax highlighting - improved version of the Textmate Mediawiki bundle.
  • Editor - create new pages, edit existing and post it to wiki.
  • Completions - auto completions for internal wiki links
  • History - list of edited pages
  • Bookmarks - bookmark your favorite pages
  • TOC - table of contents for opened page - available through command Show TOC or Symbol list (Ctrl+R)
  • Insert templates, images into pages
  • Upload files to wiki
  • Search - search by wiki
  • Table editor - edit simple wiki-tables with plugin TableEdit, convert csv-format tables to wiki-tables.
  • Snippets - basic wiki marking tags - bold, italic, headings, etc.
  • Edit panel - all commands and snippets available through one panel.
  • Shortcuts - possibility to create plugin specific shortcuts to all commands and snippets to create word-like editor.
  • Connectivity - http/https, direct/proxy connection with basic/digest web-server authorization. Types of authorization:
    • Login/Password;
    • OAuth;
    • Browser's cookie based - Firefox or Chrome.
  • Connection manager - add new wiki sites, and switch between them.
  • Page preview - possibility to preview page before posting with some preview customization options.
  • Text folding - folding/unfolding page blocks by headers, tags, templates, html comments.
  • Notifications - show notifications as menu.
  • Context opening - possibility to open included page, template, function by inline context.
  • Configurator - visual configuration of important settings.

Subime Text Wiki editor plugin - Mediawiker Screenshot using the Mediawiker_Dark color scheme

External dependencies (with modifications or not)

Dependencies, supported by Package control

Installation

The easiest way to install this is with Package Control.

  • If you just went and installed Package Control, you probably need to restart Sublime Text before doing this next bit.
  • Bring up the Command Palette (Command+Shift+p on OS X, Ctrl+Shift+p on Linux/Windows).
  • Select Package Control: Install Package (it'll take a few seconds)
  • Select Mediawiker when the list appears.

Package Control will automatically keep Mediawiker up to date with the latest version.

Documentation

  • Note: Not all color schemes fully supports syntax highlighting scopes required by markup languages like Mediawiki or Markdown. On this moment, color schemes with better support are: Twilight, Sunburst, Eiffel. Also, Mediawiker package includes Twilight (Mediawiki), Eiffel (Mediawiki) and Mediawiker_Dark/Mediawiker_Light schemes with improved highlighting for mediawiki syntax.
  • Check plugin wiki for setup instructions.
  • Use Preferences / Package settings / Mediawiker / Settings for setup wiki connection and plugin options.

Configurator

GUI configurator for important settings.

Mediawiker configurator

Commands

  • Edit panel with all commands and snippets in ordered list (can be customized in the settings).
  • Main menu / Tools / Mediawiker / Edit panel (windows, osx: Alt+F1, linux: Ctrl+Shift+F1)
  • Open page command for retrieving existing wiki-page. If the page does not exists, you can create the new one.
  • Main menu / Tools / Mediawiker / Open page
  • Use page name or page url as a wiki page name. When the url will be inserted, it will be cleared to page name, if wiki parameters is correct and current wiki site was selected.
  • Reopen page command - to reopen current page (F5).
  • Post page command for publishing pages. When you post a page, the name of the page will be saved to pages history.
  • Main menu / Tools / Mediawiker / Post page
  • Settings option mediawiker_mark_as_minor (default: false) - using to mark changes as minor. Or you can use ! character as summary prefix to invert this option on current post.
  • Pages history command to open the page by name from history.
  • Show TOC command for show table of contents of the current page and to move by page headers. Or you can use standard Symbol list (Ctrl+R).
  • Show internal links command for show all internal links of the current page. You can go to selected link on page, open it in editor or in browser.
  • Show external links command for show all external links of the current page (links like [link..]). You can go to selected links on page or open it in browser.
  • Select wiki command to select your current wiki site.
  • Add/Edit wiki site command for create new or edit existed wiki sites configurations.
  • Open page in browser command to open current page in web-browser.
  • Set category command to add category to current article from list of root category members (check "mediawiker_category_root" option in configuration).
  • Insert image command to insert link to image from wiki. Parameter mediawiker_image_prefix_min_length is using to limit length of search prefix for large wikies (by default: 4 characters).
  • Insert template command to insert template from wiki.
  • Search command to search articles by text string. Results are shown as markdown formatted text in a new tab. Parameter mediawiker_search_results_count is using to limit search results count.
  • Category tree command to show sub-categories and pages of the predefined category as menu.
  • Numbered TOC command to set headers as numbered list (format 1.1.1.).
  • File upload for uploading files to wiki
  • CSV data to wiki table command to transform selected csv-text to wiki table (default delimiter since version 2.0: |).
  • (Buggy) Wiki table to Simple command to transform the selected table (or under cursor) to Simple table (for using with plugin TableEdit).
  • (Buggy) Simple table to wiki command to convert Simple table back to wiki syntax.
  • Native Sublime text Command palette with predefined filter of plugin's commands and snippets.
    • Alt+F11

Predefined mediawiki sites settings

Note: You must setup your credentials for authorization in the settings.

You can add your favorite sites in the settings.

mediawiker's People

Contributors

danmichaelo avatar gigamicro avatar jandahl avatar putnik avatar rabin-io avatar rheingoldriver avatar smanolloff avatar ticclick avatar tosher avatar

Stargazers

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

Watchers

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

mediawiker's Issues

check page version on post

on post, right now the plugin is uploading the full page which in a highly collaborative environment could results in overwriting other people changes.

i wonder if is possible to change the behaviour a bit, maybe store locally the page version on open (or reopen), than on post first check the version. if the version differs either show a dialog box asking the user to choose what they want (overwrite|stop|) or open the new version in a different doc in sublime so i can run a diff and resolve the changes. if i where to have an option i would choose the second option (maybe have a setting that enables opening the new version automatically in a new doc by default)

what do you think? too complicated?

Feature request: Option to disable publish page command

I would like to have a configuration option to disable the publish page command: I'm not comfortable with the possibility to upload article with a single keystroke because I translate/write long articles and make extensive change to existing one so I prefer to check the preview several time before uploading the final version.

An alternative could be to add a confirmation step before publishing the article and enabling/disabling the confirmation step in the plug-in configuration, with a default of disable so there would be no change in the default behaviour of the plug-in.

Notifications

For quite some time now the mechanism of notifications is entered into Wikipedias.

Notification 1
Notification 2

May you realize so that users of Sublime Text could receive notices and when editing Wikipedia by means of Mediawiker? Thanks.

auto completions for internal wiki links only showing in console.

auto completions for internal wiki links is not being inserted in the file, but it shows the result in Console.
So I start typing GTD+TAB it gives me GTD - Getting Things Done in the Console, but leaves a empty tabspace in the document.

Using Sublime Text 3, installed from Package Control.

Great plugin btw!!

Registering a scheme handler in ST and the OS to open pages from browsers

I was wondering how feasible it would be to have a scheme handler to automatically open a page from the browser, e.g.

mediawiker://en.wikipedia.org/wiki/Sublime_Text

… would open Sublime Text with Mediawiker fetching "Sublime Text" with credentials matched against "en.wikipedia.org" from the settings.

Then I could make a Greasemonkey plugin to add an icon next to a page name for "Edit in Sublime Text"

How doable do you think this would be?

(By the way, I love your plugin)

Kind regards,
Jan

ssl import fails on Linux

It looks like since you implemented the workaround for HTTPS on linux now the ssl module doesn't load and caused the whole plugin to fail to load.

Mediawiker: enabling custom linux ssl module
Mediawiker: _ssl module import error - No module named '_ssl'
Mediawiker: _ssl module import error - No module named '_ssl'
Mediawiker: _ssl module import error - No module named '_ssl'
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 73, in reload_plugin
    m = importlib.import_module(modulename)
  File "X/importlib/__init__.py", line 88, in import_module
  File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "/opt/sublime_text_3/sublime_plugin.py", line 671, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/home/user/.config/sublime-text-3/Packages/Mediawiker/mediawiker.py", line 66, in <module>
    from . import mwclient
ImportError: cannot import name mwclient

The Mediawiker menu is available in tools but is grayed out and no options are available from keyboard shortcuts or the command list.

Display headings with syntax highlighting

One of the few essential things this package does not do is provide syntax highlighting for headings, e.g.:

== H2 ==

=== H3 ===

In long MediaWiki documents, picking out headings is important. The old TextMate syntax highlighting bundle does this, and your screenshot shows it. However, I have never been able to get this to work, regardless of theme/color scheme in Sublime.

Package Manager Fails & No Syntax Highlighting

ST3...

Just attempted to install Mediawiker via package control and it just times out.

Have installed it manually via GIT download of .zip file, with the contained Mediawiker-master folder copied to ST3/Data/Packages and renamed to Mediawiker.

Appears to work OK (ie. keys are active and menu entries exist) but I am getting no syntax highlighting. The 'Mediawiki' sytax exists as I can select it, but no highlighting happens.

Any thoughts and help appreciated.

NOTE: I am trying to use Mediawiker to edit a DokuWiki site. Pages have a .txt extension.

Changes Summary

Is there an option to bypass/skip inputing changes? I would like to post the page with one keystroke.

syntax highlighting not working ?

Hi,
I've just installed Mediawiker using the Package Manager, restarted Sublime 2 but when I open a new document and set the syntax highlighting to MediaWiki, it does not work

screen shot 2013-09-18 at 11 25 46 am

what did I do wrong ?
cheers

Control-S keyboard shortcut mapped to Change Summary

This may be obvious (I'm not that skilled at Sublime Text) but is there a way to reclaim the Control-S keyboard shortcut which Mediawiker takes over for the "Change Summary" function, so it can be reverted to the built in Sublime Text "Save" function?

I can't seem to break myself of the unconscious habit of saving with Control-S which ends up not actually saving the file.

Pull CSS for page preview

The new page preview(#62) is really nice addition, I was wondering if you can pull the css files to give the page a little styling. (?)

Mediawiker is laggy when typing links to namespace pages on Wikia

For instance, if I try to write something like [[File:SomeFile.jpg]] or [[Category:SomeCategory]], the cursor will pause almost at every character, sometimes freezing the editor for a couple of seconds, and I get no auto-complete suggestions (though I'm not sure if I should), unlike regular content pages which have no issues at all. This happens with a wiki from Wikia.

Currently using latest Mediawiker release and Sublime Text 3.

Version 3.0.0 does not start

reloading plugin Mediawiker.mediawiker
Traceback (most recent call last):
  File "/Users/jjaco/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 74, in reload_plugin
    m = importlib.import_module(modulename)
  File "./importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1022, in load_module
  File "<frozen importlib._bootstrap>", line 1003, in load_module
  File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 868, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "/Users/jjaco/Library/Application Support/Sublime Text 3/Packages/Mediawiker/mediawiker.py", line 21, in <module>
    from . import mwutils as mw
  File "/Users/jjaco/Library/Application Support/Sublime Text 3/Packages/Mediawiker/mwutils.py", line 12, in <module>
    import requests
ImportError: No module named 'requests'
reloading plugin Mediawiker.mwsetup
Traceback (most recent call last):
  File "/Users/jjaco/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 74, in reload_plugin
    m = importlib.import_module(modulename)
  File "./importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1022, in load_module
  File "<frozen importlib._bootstrap>", line 1003, in load_module
  File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 868, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "/Users/jjaco/Library/Application Support/Sublime Text 3/Packages/Mediawiker/mwsetup.py", line 9, in <module>
    from . import mwutils as mw
  File "/Users/jjaco/Library/Application Support/Sublime Text 3/Packages/Mediawiker/mwutils.py", line 12, in <module>
    import requests
ImportError: No module named 'requests'
reloading plugin Mediawiker.mwutils
Traceback (most recent call last):
  File "/Users/jjaco/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 74, in reload_plugin
    m = importlib.import_module(modulename)
  File "./importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1022, in load_module
  File "<frozen importlib._bootstrap>", line 1003, in load_module
  File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 868, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "/Users/jjaco/Library/Application Support/Sublime Text 3/Packages/Mediawiker/mwutils.py", line 12, in <module>
    import requests
ImportError: No module named 'requests'

Thanks for an awesome extension for Sublime. I use it every day.

I cant get the new version of Mediawiker to start. I have tried to reinstall the package and when I look in the console I get the above message. Do I have to install anything more with the new version of Mediawiker?

Any ideas?

Can anyone help me set up Wikia connection?

I'm brand new to Sublime Text. Like, BRAND new. I just got it tonight because I got sick of Wikia's template editor and its lack of word wrapping. So I'm here to ask how the heck I properly set up a Wikia connection! Trying to access a page with a general Wikia connection crashed the program, and after fiddling with the settings (as in, adding a specific mediawiki_site line for the wiki I wanted to access), I did get it to not crash...but instead of crashing, it instead brings up an error that says this:

"HTTP connection failed: httplib.HTTPResponse instance at 0x000000000403ADC8

I have no idea what this means (again, new to Sublime Text), but my API path is set as "api/v1/", since all the Wikia API info I could find led me to believe this was the right path. I think the API path might be the problem but I don't know how to set that up!

Anyone who's set this up with Wikia able to help me out here? (And of course, tell me if I'm wrong with my API-path wild guessing, lol!)

Mediawiker breaks other sublime plugins using urllib in ST3

This is what I'm getting after loading Mediawiker in my sublime text, and trying to use some plugins that use urllib (or just using the console):

>>> import urllib.request
>>> urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) )
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "X/urllib/request.py", line 540, in build_opener
NameError: global name 'HTTPSHandler' is not defined

Of course this leads to crashes in other plugins...

License

I would like to use your grammar for Mediawiki but I don't know what licensing terms you're distributing it under. Any chance you could pick one from here: http://choosealicense.com?

Unable to use search in Sublime Text 3

When using Mediawiker:Search I get the following error:

Traceback (most recent call last):
  File "/Users/muloka/Library/Application Support/Sublime Text 3/Packages/Mediawiker/mediawiker.py", line 849, in show_results
    for i in range(self.search_limit):
TypeError: 'NoneType' object cannot be interpreted as an integer

[Errno 11004] getaddrinfo failed

I have this error when open, save , ... file wiki.

Traceback (most recent call last):
File ".\sublime_plugin.py", line 356, in run_
File ".\mediawiker.py", line 179, in run
File ".\mwutils.py", line 215, in get_connect
File ".\mwclient\client.py", line 115, in init
self.site_init()
File ".\mwclient\client.py", line 122, in site_init
meta = self.api('query', meta='siteinfo|userinfo', siprop='general|namespaces', uiprop='groups|rights')
File ".\mwclient\client.py", line 185, in api
info = self.raw_api(action, **kwargs)
File ".\mwclient\client.py", line 285, in raw_api
json_data = self.raw_call('api', data).read()
File ".\mwclient\client.py", line 254, in raw_call
stream = self.connection.post(self.host, url, data=data, headers=headers)
File ".\mwclient\httpmw.py", line 288, in post
return self.find_connection(host).post(host, path, headers, data)
File ".\mwclient\httpmw.py", line 280, in find_connection
conn = cls(host, self)
File ".\mwclient\httpmw.py", line 107, in init
self._conn.connect()
File ".\httplib.py", line 716, in connect
File ".\socket.py", line 500, in create_connection
socket.gaierror: [Errno 11004] getaddrinfo failed

Feature request: "Template usage example generator"

I use templates with many named variables, e.g.

Hello {{{Name}}},
Thanks for {{{Reason}}}

What I'd love to see is a function that creates a - and maybe even updates an existing - "Usage" paragraph, e.g.

Usage:
{{ Template:Foo
| Name=Example Name
| Reason=Example Reason
}}

This could be done by trawling the open page for unique {{{Named Variables}}}, parsing them into an array as above, and in case one exists, add the {{{Named Variables}}} not already on the list (with "Example {{{Named Variable}}}" behind the equal sign)

TypeError trying preview: unexpected keyword 'disableeditsection'

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 568, in run_
    return self.run(edit, **args)
  File "C:\Users\username\AppData\Roaming\Sublime Text 3\Packages\Mediawiker\mediawiker.py", line 1371, in run
    html = sitecon.parse(text=text, title=mw.get_title(), disableeditsection=True).get('text', {}).get('*', '')
TypeError: parse() got an unexpected keyword argument 'disableeditsection'

How to NOT show Mediawiker snippets in non-MediaWiki scoped files?

Perhaps this is a general Sublime-related question, but when I'm in a file that is in a language other than MediaWiki (such as a Ruby or PHP file), then when I pull up the Command Palette, the MediaWiker snippets still appear.

How can I get them to NOT appear at that time, and to ONLY appear when the current file is specifically made to use the MediaWiki syntax highlighting?

Syntax highlighting only partially works

I can successfully install this on ST2(2.02, build 2221) and ST3 (build 3047). On either version I don't get the full syntax highlighting. Most immediately noticeable are the headings. In your screenshots they are orange, but I get nothing. So far the only things I've noticed to be working are:

• [[Category:]]
• [[Image:]]
• frame
• style= (this one is inconsistent)

Let me know if there is anything I can provide to help.

Parse error when "proxy_host" is set.

Hello.

I have been trying to set up the plugin to use a proxy server via the "proxy_host" setting that appears to support only host and port (according to the documentation), i tried to specify the username and password via URL (user:password@host:port) and i get the parse error below via a sublime message window.

At a second look, i get the same error with the standard documented URL format of "host:port" also.

Connection failed for ('https', 'user:pass@proxy-01:3128'): Failed to parse: proxy-01:3128https:

I am using Sublime Text 3083 and the plugin is version 3.0.2 installed via Package Control 3.1.2

Thank you!

remember open page on post

would it be possible to remember the name of the page opened so on post i don't have to always type in the page? this would be a huge time saver

Search via https + auth + domain

Just found Mediawiker. Thx for the effort! There really is a lack of good MediaWiki-tools usable outside of browsers.

I added a corporate-wiki, that needs authentication with domain and https. Opening pages works so far, but I couldn't search. When trying to search, there's an info "Trying to get https connection to ..." but nothing afterwards. Without auth and https, it works fine.

Is there any log-output or debug-flag I can set to maybe get some more verbose information about what actually happens?

I'm aware of the "experimental" state of https in Mediawiker.

Regards

Feature request: Command to translate internal wikilink using interwiki and wikidata

Normally I translate (or add content) translating articles from en.wiki to it.wiki, so I have to traslate wikilink from the en.wiki title to the it.wiki title.

I would like to have an option to configure a "target wiki" and a command to search the current select text as title article on the target wiki and get the corresponding title on the working wiki using the wikidata database. For example select the text “Steve Jackson (US game designer)" search it as article title on en.wiki (target wiki) and getting "Steve Jackson (1953)" on it.wiki (working wiki)

Support symbol search

I want to use symbol search.
List and jump to header by Ctrl+P and type @ or only Ctrl+R like such as Markdown.

Sublime Text 3 - mediawiker silently fails

More precisely, I tell it to open a page; after a pause, it opens a new tab without contents, but no overt error message.

If I check the console, I see this:

Traceback (most recent call last):
  File "/Users/jandahl/Library/Application Support/Sublime Text 3/Packages/Mediawiker/mwclient/client.py", line 113, in __init__
    self.site_init()
  File "/Users/jandahl/Library/Application Support/Sublime Text 3/Packages/Mediawiker/mwclient/client.py", line 120, in site_init
    meta = self.api('query', meta='siteinfo|userinfo', siprop='general|namespaces', uiprop='groups|rights')
  File "/Users/jandahl/Library/Application Support/Sublime Text 3/Packages/Mediawiker/mwclient/client.py", line 186, in api
    res = self.handle_api_result(info, token=token)
  File "/Users/jandahl/Library/Application Support/Sublime Text 3/Packages/Mediawiker/mwclient/client.py", line 213, in handle_api_result
    raise errors.APIError(info['error']['code'], info['error']['info'], kwargs)
errors.APIError: ('readapidenied', 'You need read permission to use this module', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 543, in run_
    return self.run(edit, **args)
  File "/Users/jandahl/Library/Application Support/Sublime Text 3/Packages/Mediawiker/mediawiker.py", line 365, in run
    sitecon = mw_get_connect(password)
  File "/Users/jandahl/Library/Application Support/Sublime Text 3/Packages/Mediawiker/mediawiker.py", line 59, in mw_get_connect
    sitecon = mwclient.Site(addr, path)
  File "/Users/jandahl/Library/Application Support/Sublime Text 3/Packages/Mediawiker/mwclient/client.py", line 116, in __init__
    if e[0] not in (u'unknown_action', u'readapidenied'):
TypeError: 'APIError' object does not support indexing

My settings are copied from ST2 verbatim. I'm running the newest version from Package Control.

Can't invoke Mediawiker "Select Wiki"

Base data:

OS: Win7
ST: 3, build 3059
Installated via Package Control

Invoking "Select wiki" gives following output:

 Traceback (most recent call last):
   File "mediawiker in C:\Users\jan.dahl\AppData\Roaming\Sublime Text 3\Installed Packages\Mediawiker.sublime-package", line 544, in <lambda>
   File "C:\Program Files\Sublime Text 3\sublime.py", line 341, in show_quick_panel
     if len(items) > 0 and isinstance(items[0], list):
 TypeError: object of type 'map' has no len()

The referred line in the sublime-package... well...

3524 a351 e23f 2a27 119c 1ef3 74a2 a705

Steps taken to abate:

  • Removed and reinstalled Mediawiker (using PackageControl)
  • Cleaning personalized settings
  • Manually removing user settings

Scopes in infobox templates

What scopes at elements on which shooters show?

Scopes in infobox templates

| , parameter, = and value.

I didn't find that these scopes were involved in your .tmTheme files. Thanks.

Open file in browser not displaying

I cannot use 'Open file in browser' because it is not displayed in the command palette.
I looked in the settings file and there is a proper entry, though.
I'm running Sublime Text 3 on Ubuntu 14.04.

EDIT: I activated the default keyboard shortcut and it works, but it's still not displayed in the command palette.

HTTPS

Hi.

I don't know wheter this is a question or an issue.

I access my private knowledgebase (mediawiki) via https and like to edit the pages with sublime, but i don't know if mediawiker does support https and how to configure it.

I tried putting https:// in front of "host" but because of the colon it is interpreted as port.

Thanks

Silberling

Incorrect OS X Dependencies

There is no fileio dependency available via Package Control for ST2 since ST2 on OS X comes with _fileio. This causes errors for ST2 users on OS X who install this package.

SSL handshake fails on OS X 10.11.2 (certificate verify failed)

I'm using Mediawiker with a corporate wiki on the latest El Capitan release.

Whenever I try to open a page, I get an error:

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:550)

Now that I've done my homework, I've found that similar bug plagues Package Control, and the solution is to add custom certificate to Package Control.user-ca-bundle. That didn't help though.

Is there some other way to add custom certificate to Mediawiker?

SSL support on Debian wheezy

Hi all, hi @tosher ,

I was wondering if someone ever tried to connect to mediawiki that runs on a non-standard port (other than 80 or 443). I was able to connect to an https mediawiki, but I couldn't change the port. My config (sublime 3) is:
"host": "server.org:12345",
"path": "/wiki/",
"pagepath": "/wiki/index.php/",
"username": "user",
"password": "pw",
"domain": "", (I also tried "server.org:12345").
"https": true

I appreciate any comments and help :)
Thanks!

Using with personnal/company wiki

I manage to set up your plugin to work with English wikipedia but when I try to set it up to work with my company wiki here is what I got:

Error

Traceback (most recent call last):
  File "./sublime_plugin.py", line 356, in run_
  File "./mediawiker.py", line 179, in run
  File "./mediawiker.py", line 30, in mediawiker_get_connect
  File "./mwclient/client.py", line 92, in __init__
    self.site_init()
  File "./mwclient/client.py", line 101, in site_init
    siprop = 'general|namespaces', uiprop = 'groups|rights')
  File "./mwclient/client.py", line 161, in api
    info = self.raw_api(action, **kwargs)
  File "./mwclient/client.py", line 244, in raw_api
    json_data = self.raw_call('api', data).read()
  File "./mwclient/client.py", line 219, in raw_call
    url, data = data, headers = headers)
  File "./mwclient/http.py", line 229, in post
    path, headers, data)
  File "./mwclient/http.py", line 161, in post
    return self.request('POST', host, path, headers, data)
  File "./mwclient/http.py", line 152, in request
    raise errors.HTTPStatusError, (res.status, res)
mwclient.errors.HTTPStatusError: (400, <httplib.HTTPResponse instance at 0x7f4a90328e18>)

User Settings

    "AJLSM":
    {
        "domain": "",
        "host": "mw.my-company.com",
        "pagepath": "/wiki/",
        "password": "******",
        "path": "", /* <---- not sure about this */
        "username": "my-account"
    },

So I'm not really sure about path and pagepath value.

Proxy setting

It appears that opening pages doesn't work behind a proxy.

Is it possible for the package to define proxy settings?

Logging in to self-hosted MediaWiki instance doesnt work

When trying to access my self-hosted MediaWiki instance, I can reach it fine if I try to use it without login data, getting an error popup about insufficient rights to access the Wiki (as expected for anonymous users).
When I set my Username in the user config of ST3's MediaWiker I'll get asked to enter my password and after that nothing happens except for this log:

`Writing file /C/Users/khorne/AppData/Roaming/Sublime Text 3/Packages/User/Mediawiker.sublime-settings with encoding UTF-8 (atomic)
reloading Packages/User/Mediawiker.sublime-settings
Traceback (most recent call last):
File "C:\Users\khorne\AppData\Roaming\Sublime Text 3\Packages\Mediawiker\mediawiker.py", line 175, in mw_get_connect
sitecon = mwclient.Site(host=addr, path=path)
File "C:\Users\khorne\AppData\Roaming\Sublime Text 3\Packages\Mediawiker\mwclient\client.py", line 115, in init
self.site_init()
File "C:\Users\khorne\AppData\Roaming\Sublime Text 3\Packages\Mediawiker\mwclient\client.py", line 122, in site_init
meta = self.api('query', meta='siteinfo|userinfo', siprop='general|namespaces', uiprop='groups|rights')
File "C:\Users\khorne\AppData\Roaming\Sublime Text 3\Packages\Mediawiker\mwclient\client.py", line 185, in api
info = self.raw_api(action, **kwargs)
File "C:\Users\khorne\AppData\Roaming\Sublime Text 3\Packages\Mediawiker\mwclient\client.py", line 283, in raw_api
json_data = self.raw_call('api', data).read().decode('utf-8')
File "C:\Users\khorne\AppData\Roaming\Sublime Text 3\Packages\Mediawiker\mwclient\client.py", line 254, in raw_call
stream = self.connection.post(self.host, url, data=data, headers=headers)
File "C:\Users\khorne\AppData\Roaming\Sublime Text 3\Packages\Mediawiker\mwclient\httpmw.py", line 301, in post
return self.find_connection(host).post(host, path, headers, data)
File "C:\Users\khorne\AppData\Roaming\Sublime Text 3\Packages\Mediawiker\mwclient\httpmw.py", line 224, in post
return self.request('POST', host, path, headers, data)
File "C:\Users\khorne\AppData\Roaming\Sublime Text 3\Packages\Mediawiker\mwclient\httpmw.py", line 214, in request
raise errors.HTTPStatusError(res.status, res)
errors.HTTPStatusError: (404, <http.client.HTTPResponse object at >0x0000000003A07CC0>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 543, in run_
return self.run(edit, **args)
File "C:\Users\khorne\AppData\Roaming\Sublime Text 3\Packages\Mediawiker\mediawiker.py", line 551, in run
sitecon = mw_get_connect(password)
File "C:\Users\khorne\AppData\Roaming\Sublime Text 3\Packages\Mediawiker\mediawiker.py", line 207, in mw_get_connect
raise Exception('HTTP connection failed.')
Exception: HTTP connection failed.`

The Wiki is reachable and userless access works fine in the confinements of the configuration. I have actually no clue why MediaWiker throws 404's and Connection Errors.

I'd appreciate any help and input from you. Thank you.

Linux hotkeys

Hi,

maybe not a real issue, but just FYI, the Default (Linux).sublime-keymap contains commented-out hotkey commands (in contrast to the same ones for Mac and Windows):

[
    { "keys": ["ctrl+shift+f1"], "command": "mediawiker_edit_panel" },
    //{ "keys": ["ctrl+shift+f2"], "command": "mediawiker_show_toc" },
    //{ "keys": ["ctrl+shift+f3"], "command": "mediawiker_open_page" },
    //{ "keys": ["ctrl+shift+f5"], "command": "mediawiker_open_page_in_browser" },
    //{ "keys": ["ctrl+shift+f6"], "command": "mediawiker_set_active_site" },
    //{ "keys": ["ctrl+shift+f7"], "command": "mediawiker_post_page" },
    //{ "keys": ["ctrl+shift+f10"], "command": "mediawiker_page_list" },
    //{ "keys": ["ctrl+shift+f11"], "command": "show_overlay", "args": {"overlay": "command_palette", "text":"Mediawiker"} }
    {
        "keys": ["ctrl+b"], "command": "insert_snippet", "args": {"name": "Packages/Mediawiker/snippets/mw_bold.sublime-snippet"},
        "context": [{"key": "setting.mediawiker_is_here", "operand": true}]
    },
    ...

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.