Wikitext-VSCode-Extension icon indicating copy to clipboard operation
Wikitext-VSCode-Extension copied to clipboard

Multiple site support

Open Californ1a opened this issue 2 years ago • 2 comments

If you edit multiple wikis it's a bit of a hassle to need to go into the settings and change everything every time you go edit a different site. It would be much nicer if you could specify more than one in the settings json, maybe with a layout like:

{
	"wikitext.hosts": {
		"mediawiki.org": {
			"apiPath": "/w/api.php",
			"articlePath": "/wiki/",
			"userName": "username",
			"password": "password"
		},
		"community.fandom.com": {
			"apiPath": "/api.php",
			"articlePath": "/wiki/",
			"userName": "username",
			"password": "password"
		}
	}
}

Then when you pull a page, you could select which host before typing in the page name, and it would keep track of which host you picked so when you push, it would know which host to push to. Similarly when using the gadget directly on a wiki, it already includes the host in the vscode:// URL, so it already knows which host it should push back to.

Californ1a avatar Sep 15 '21 20:09 Californ1a

Bump.

Using the gadget is almost pointless if you edit multiple wikis since a reconfig is needed. Potential easy fix would be expanding the <%-- [PAGE_INFO] segment to have info about which wiki the page is pulled from and then push back to that. No need to change the main config or it's layout, instead that would operate as a "default wiki" that is used when details in page info is not supplied or if pulling from within VSC.

Example:

<%-- [PAGE_INFO]
    comment = #Please do not remove this struct. It's record contains some important information of edit. This struct will be removed automatically after you push edits.#
    pageTitle = #User:Zsotroav#
    pageID = #34935#
    revisionID = #190976#
    contentModel = #wikitext#
    contentFormat = #text/x-wiki#
    wiki = #zsotroav.fandom.com#
    apiPath = #/api.php#
    articlePath = #/wiki/#
[END_PAGE_INFO] --%>

zsotroav avatar Dec 19 '22 17:12 zsotroav

Furthermore, I'd recommend changing the label to bug instead of enhancment, since the plugin currently pushed back to the wrong wiki if the page was pulled through a link/the gadget.

zsotroav avatar Dec 19 '22 17:12 zsotroav