VisualEditor: Please add an "Add wikicode" tool
OpenPublic

Description

sometime, there is a piece of wikicode i get from elsewhere and want to add to the page.

more often than not, this comes in the form of pre-filled template: e.g., in hewiki we developed tools (in the form of bookmarklets) that generate external-link templates from popular sites (the user activate the bookmarklet on some on-line news site, and the tool generates the appropriate template for this site, with article name, author name, date etc. already filled).
another example is the "coord" template: we created a bookmarklet that allows the users to generate pre-filled "coord" template from google maps.

there are other cases where the user might want to inject some prepared wikicode into the page when using VE.

REQUESTED ACTION
create a button/hotkey that will open a "enter wikicode" form. it's ok to require that it will be legal wikicode and ask the parser to test it, and it's ok not to do so. the important thing is the request to allow insertion of raw wikicode through VE, rather than requiring that i'll save and switch to source code editor.

peace.


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=49686

bzimport set Reference to bz51899.
Kipod created this task.Via LegacyJul 23 2013, 6:27 PM
Thryduulf added a comment.Via ConduitJul 25 2013, 12:43 AM

From a comment I posted on bug 49686:

The desire [for VE to understand wikimarkup] stems from people wanting the best of both worlds - they want to be able to have the structure and layout of the visual editor with the low-level control they are used to in the source editor all in one place.

Long term something like this really ought to be possible, but I don't think [VE automatically converting wikitext to visual elements at save or on the fly] is the way. Rather there should be some way for the visual editor to include non-visual blobs that it sends to the parser as is without doing anything to it (other than word wrapping in the editing window); and someway for the editor to mark the start and end of such blobs.

TTO added a comment.Via ConduitJul 25 2013, 12:55 AM

This is already possible using the transclusion editor: instead of inserting a new template, insert a "content" section instead with your wikitext

But that workflow is not ideal - particularly because the VE doesn't convert the added wikitext to regular VE content on the fly - and it also seems a bit buggy from my quick tests.

Kipod added a comment.Via ConduitJul 25 2013, 1:39 PM

(In reply to comment #1)

From a comment I posted on bug 49686:

The desire [for VE to understand wikimarkup] stems from people wanting the
best
of both worlds - they want to be able to have the structure and layout of the
visual editor with the low-level control they are used to in the source
editor
all in one place.

Long term something like this really ought to be possible, but I don't think
[VE automatically converting wikitext to visual elements at save or on the
fly]
is the way. Rather there should be some way for the visual editor to include
non-visual blobs that it sends to the parser as is without doing anything to
it
(other than word wrapping in the editing window); and someway for the editor
to
mark the start and end of such blobs.

i am not sure this is required. once you inject a blob, ve can "pretend" that it found it there when it originally opened the page for editing (i.e., do "unparse for the whole content, inject the blob into the right place in the "unparsed" page, and then "reparse", to integrate the blob into the page). marking the beginning and end of blob will not be necessary if this approach is taken. this may not be a cheap or quick operation, but it's much better to have an expensive "inject" than no inject at all, which basically force the user to use "edit source".

i never investigated what VE does exactly when the user uses Copy/Paste between two pages (i.e., open one page in VE, mark part of it, "Copy", open another page for editing, and "Paste"). maybe we can take a page from that book, no?.

peace.

jayvdb added a comment.Via ConduitJul 26 2013, 11:45 AM

The National Library of Australia provides Wikipedia citation wikicode in their digitised newspaper system.
http://trove.nla.gov.au/general/using-digitised-newspapers-faq/#using_cite

bzimport added a comment.Via ConduitAug 12 2013, 1:31 AM

vssun9 wrote:

This tool is very much required.

Some use cases:

  • Copy-pasting some regularly used references (containing cite template)
  • Putting wiki signature

At present I am using a dummy template with subst for these purposes.

Thryduulf added a comment.Via ConduitAug 13 2013, 11:08 AM

Does this request duplicate bug 43133 or 47742?

Thryduulf added a comment.Via ConduitAug 13 2013, 11:08 AM

sorry bug 47742

Kipod added a comment.Via ConduitAug 13 2013, 2:11 PM

(In reply to comment #6)

Does this request duplicate bug 43133 or 47742?

not really: as far as i was able to understand, those are about wikitext _editing_, while this one asks to be able to "inject" wikitext (usually something you obtained externally, either from some tool/app that generates wikitext, or via copy/paste etc.)

i believe it's significantly simpler to implement than either bug 43133 or bug 47742, and the use-case is different (much more limited).

peace.

Thryduulf added a comment.Via ConduitSep 22 2013, 8:47 AM

Another request for this today on en.wp, this time from Rezonansowy

Jdforrester-WMF added a comment.Via ConduitNov 1 2013, 4:51 AM

As mentioned several times, there are a number of major issues that this would cause; we'll have to investigate if they're things we can work around.

Jdforrester-WMF moved this task to Backlog on the VisualEditor workboard.Via WebNov 24 2014, 4:17 PM

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.