Closed TriMoon closed 5 years ago
"mediawiker_site":
{
"quake.wikia.com":
{
"domain": "",
"host": "quake.wikia.com",
"https": false,
"pagepath": "/wiki/",
"password": "mypassword",
"path": "/",
"username": "my-username-at-wikia.com"
}
}
Username and password - from wikia site, not from facebook or google.
Without credential defining, you can use cookies from browser:
"authorization_type": "cookies",
"cookies_browser": "firefox"
mediawiker_
- maybe in future versions
iii. Favorites - No user action is required with this settings, it's just a storage.quick reply @tosher ,
2.iii. I think, multiple level nesting with normalized data - good for inner storage, but for user settings - not. It's hard to understand and support. Only really special settings must be inside per-wiki-options. Or it must be optional. I'll think about it :)
1. https://github.com/tosher/Mediawiker/releases/tag/v3.4.10
No idea what really changed because the syntax highlighting still looks same, maybe try adding support for ParserFunctions+StringFunctions, eg: {{#xxx:..}}
Before
After
About the before and after; I really didn't notice, It is so subtile, but looks better as was :wink: Supporting those function calls would have made a bigger impact :wink:
@tosher 2.iii. I think, multiple level nesting with normalized data - good for inner storage, but for user settings - not. It's hard to understand and support. Only really special settings must be inside per-wiki-options. Or it must be optional. I'll think about it :)
Could you at least start with allowing the settings to be put inside project files? That way we can keep the settings inside a central config per project.
It's your current settings, right? It looks like a self-sufficient :) But I'm asked about "what needs to change" and your version of the settings for it :)
As you can notice the script changes a lot of your default output, to make it look good for wikia. Maybe you could make your default output use the layout and tag-settings it creates?
Oh ps: Your extension should automatically use system-proxy settings when they are available in the environment....
More Project based improvement:
<project dir>/Trainstation wiki/User:©TriMoon™/Station/Management
This would recognize this file as being from wiki-setting Trainstation wiki and page User:©TriMoon™/Station/Management
After editing this local file you should be able to:
Maybe you could make your default output use the layout and tag-settings it creates?
It can be a default for concrete wikia site, not for all. The plugin doesn't have the setting for all sites. We can add an example into project's wiki if you want.
Maybe you could make your default output use the layout and tag-settings it creates?
It can be a default for concrete wikia site, not for all. The plugin doesn't have the setting for all sites. We can add an example into project's wiki if you want.
That would be a nice thing if it's finished, but no idea when that will be yet. The script i crafted is setup to allow for user settings, but the layout is for all wikia that uses oasis-skin.
One thing you could add right away now in your extension is the title tag, then i could grab that in my script to display the page name :wink:
lol i meant the actual <title>pagename</title>
tag inside the head but ill see how to use the var... :rofl:
Just tested but using the below gives a blank <title></title>
"<title>{{ title }}</title>"
"preview_custom_head": [
"<title>{{ title }}</title>",
"<meta charset=\"UTF-8\"/>",
"<link rel=\"stylesheet\" href=\"{{ http }}://{{ host }}{{ path }}load.php?debug=false&lang={{ lang }}&modules=site&only=styles&skin=vector\"/>",
"<link rel=\"stylesheet\" href=\"{{ http }}://{{ host }}{{ path }}load.php?debug=false&lang={{ lang }}&modules={{ geshi_css }}ext.visualEditor.viewPageTarget.noscript|mediawiki.legacy.commonPrint,shared|mediawiki.sectionAnchor|mediawiki.skinning.interface|mediawiki.ui.button|skins.vector.styles&only=styles&skin=vector&*\" />"
]
With default settings works fine for me.
No idea why the title didn't work 2 days ago, but seems to be self-fixed in mean time :+1: Must be browser updates...(I'm using Firefox Nightly)
I'm using Daily :) (i know about builds)
Could you enhance the popups that are displayed for the parser functions so that it includes a link to open the documentation in the browser?
Here are links to respective pages on mediawiki website, that are most used:
It would be super if the page opened would automatically scroll to the respective section on that page using the "#"-hash parameter on the link :wink:
oh PS: it would be really appreciated if parser-functions and magic-words would be displayed in different colors from template calls by the syntax-highlighting...
Just FYI: I removed the old-gist and created a new gist with:
mediawikerFixPreview(
'<remote base url>'
,'<local base url>' // Can be 'File://<local absolute path>'
)
This will make it easier for others to follow/use what i use, and for me to update parts of it to improve things in due time. Keep on coding :+1: :rofl:
These should also be able to be set in a project file, which overrides user settings
parser-functions and magic-words would be displayed in different colors from template calls by the syntax-highlighting
the keys should be without the "mediawiker_"
the popups that are displayed for the parser functions so that it includes a link to open the documentation in the browser
Testing..
Hmm after 2nd though it might be better to have the project settings be applied after the global mediawiker settings but before the user settings. The user settings should always be the highest priority, so the user in question can always override to its own taste... Especially in case of username and password, which normally won't be in project file settings but you understand the subtle diff in priority :wink:
I'm excited about what is to come :+1:
List is consists of your quotes! :)
In Sublime text projects settings always has a higher priority (it's like a tab's settings) - i think it's a correct way.
As example - many sites in user settings, but one site in separated project.
I just checked but:
xxxx.sublime-project
{
"mediawiker.category_root": "Category:Templates"
}
Instead of the usually used form in project settings:
{
"mediawiker": {
"category_root": "Category:Templates"
}
}
I would think most will prefer the later so they can copy&paste from one settings file to another and it will also ease your parsing of settings as they use same names and logic. You just need to grab the "mediawiker" object from the project file...
"mediawiker.category_root": "Category:Templates"
. Prefixed settings in projects - is a standard way, as I know.Question, just interesting.. Why not to use one variable per line (just for readability) instead of
{{#vardefine:progress-val | {{{1 | {{{val | {{#var:progress-val|}} }}} }}}
}}{{#nextdefine|..
}}...
If needs no-breakable line, you can use a <span style="white-space: nowrap">
. It can be in separated template like {{nobr}}.
Question, just interesting.. Why not to use one variable per line (just for readability) instead of
{{#vardefine:progress-val | {{{1 | {{{val | {{#var:progress-val|}} }}} }}} }}{{#nextdefine|.. }}...
If needs no-breakable line, you can use a
<span style="white-space: nowrap">
. It can be in separated template like {{nobr}}.
The reason for that kind of coding is because templates include newlines in their output if you don't do it this way :wink: it's like:
<div>blabla</div>
<div>blabla</div>
versus:
<div>blabla</div
><div>blabla</div>
For only text displayed you could use the nowrap, but when you generate html extra newlines get converted to <p></p>
etc by mediawiki parser, which mess up the generated html.
2. Works for me, detailes needed
At this moment when i open my Wiki-Project in ST3, without having any remote wiki page open.
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 1034, in run_
return self.run(**args)
File "/home/mainuser/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_page_actions.py", line 16, in run
if not utils.conman.require_password():
File "/home/mainuser/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_utils.py", line 862, in require_password
site = self.get_site(name)
File "/home/mainuser/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_utils.py", line 704, in get_site
self.get_site_config(name=name)
File "/home/mainuser/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_utils.py", line 642, in get_site_config
self.validate_site(name, site_config)
File "/home/mainuser/.config/sublime-text-3/Packages/Mediawiker/mwcommands/mw_utils.py", line 658, in validate_site
assert 'host' in site_config, 'Host is not defined for site %s' % name
TypeError: argument of type 'NoneType' is not iterable
Error loading scope:source.tsql: Unable to find syntax file for scope source.tsql in Packages/Mediawiker/MediawikiNG.sublime-syntax
Switched syntax to: Mediawiker/MediawikiNG
Warning: Page has en unclosed element of type Div at position 7177, force closing at 7181..
Warning: Page has en unclosed element of type Div at position 8007, force closing at 8011..
3. Plugin default settings => Plugin user settings => Project settings. Project as extended way for work and it extends plugin's settings.
This should become Plugin default settings => Project settings => Plugin user settings.
4. `"mediawiker.category_root": "Category:Templates"`. Prefixed settings in projects - is a standard way, as I know.
Yes if the plugin has only a very few or single setting that is true, but with a plugin like yours that has many options the otherway is standard. Imagine if eslint (for example) would do what you did.... :wink:
update: Seems the no host error above is caused by my own project config, where i used the object notation version instead of your current mediawiker. dot notation....I will try that part later...
update2: Still same with this kind of project settings file
{
"folders": [
{ "name": "Other wikia related"
,"path": "Wikia"
}
,{ "name": "Trainstation"
,"path": "trainstation.wikia"
}
]
,"syntax_override": {
"\\.(mediawiki|wiki)$": ["Mediawiker","MediawikiNG"]
}
,"mediawiker.site": {
"Trainstation wiki": {
"username": "*****"
,"password": "*****"
,"host": "trainstation.wikia.com"
,"pagepath": "/wiki/"
,"path": "/"
,"authorization_type": "login"
,"https": true
,"is_ssl_cert_verify": true
,"is_wikia": true
,"preview_custom_head": [
"<meta charset=\"UTF-8\"/>"
,"<title>{{ title }}</title>"
,"<script src=\"http://localhost/Wiki/Wikia/mediawiker_preview_fix.js\"></script>"
,"<script src=\"http://localhost/Wiki/trainstation.wikia/mediawiker_preview_script.js\"></script>"
]
}
}
}
It's an incorrect project file structure, needs:
{
"build_systems": [...],
"folders": [...],
"settings":
{
"mediawiker.site": {...}
}
}
Error loading scope:source.tsql: Unable to find syntax file for scope source.tsql in Packages/Mediawiker/MediawikiNG.sublime-syntax
Your ST's installation hasn't syntax for tsql. Not error - just message from ST.
Warning: Page has en unclosed element of type Div at position 7177, force closing at 7181..
Warning: Page has en unclosed element of type Div at position 8007, force closing at 8011..
Messages from the plugin's parser - object doesn't has a close-tag or it maybe a parsing error. It's ok for hard pages like yours :) ... and it can brake the popups.
After putting your settings in my project file like you showed, the popups started working again and i could load remote wiki pages, but...
It's an incorrect project file structure, needs:
{ "build_systems": [...], "folders": [...], "settings": { "mediawiker.site": {...} } }
You are using the settings object-key of sublime-text self, the note makes it clear that the "settings" object-key is refering to sublime text own settings. Note that only settings in the category Editor Settings may be controlled by a project.
Therefor you should use your own plugins name here instead of "settings" used in that example. By doing so you separate your plugins settings from sublime text self and other plugins so they won't interfere with each other, plus you won't need your dot notation anymore either... example:
{
"build_systems": [...],
"folders": [...],
"settings": { settings for SublimeText },
"syntax_override": { settings for project specific syntax plugin },
"mediawiker":
{
"site": {...}
}
}
Error loading scope:source.tsql: Unable to find syntax file for scope source.tsql in Packages/Mediawiker/MediawikiNG.sublime-syntax
Your ST's installation hasn't syntax for tsql. Not error - just message from ST.
Exactly it comes from MediawikiNG.sublime-syntax and starts with Error loading because Mediawiker does not include that file but somehow depends on it. Lines starting with Warning can be harmless but those that start with Error are errors and should be fixed. Just like Javascript errors they make things break. Maybe that's why the other errors...
Another no-brake way, without visually breaking tags:
{{blabla}}<!--
-->{{blabla}}
Just empty comment.
Another no-brake way, without visually breaking tags:
{{blabla}}<!-- -->{{blabla}}
Just empty comment.
The whole point of coding like i do is to prevent unwanted output from the template, you just make it output even more unwanted stuff if you do it like that. :wink: Maybe you should look into options to hand-over the syntax highlighting to other highlighters. That will be better for your workload and highlighting issues with any languages people might be using.
Anyway thanks for your work so far, i have stopped editing wiki pages again for some time and moved over to other stuff, but i'm sure i will be needing this project again when i edit wiki's in future :+1:
Hi it's been a while since i used this extension, and just started to use it again in ST3. Below are some observations from a fresh user point of view:
TypeError exception for get_page: unorderable types: int() > NoneType()
must be a time-out?does not take into account the namespace of the page being previewed. This causes links to templates in Template: namespace to be wrong.-> Only happens for locally opened pages, works ok when page is opened from wiki...