ՎիզուալԽմբագրիչ/Ծանոթագրության գործիք

From mediawiki.org
This page is a translated version of the page VisualEditor/Citation tool and the translation is 48% complete.
Outdated translations are marked like this.

ՎիզուալԽմբագրիչի ծանոթագրության գործիքը թույլ է տալիս ՎիզուալԽմբարիչում հեշտությամբ ավելացնել, հանել և խմբագրել ծանոթագրությունները: To enable the tool, you'll need the following: a working installation of VisualEditor and Parsoid , citation templates on your wiki that use TemplateData to specify how they are invoked, and a special .json message in order to hook VisualEditor and the templates together.

Ծանոթագրության կաղապարների ներմուծում

Ձեզ անհրաժեշտ կլինեն ծանոթագրության կաղապարներ այս ամենից օգտվելու համար:

Most citation templates on Wikipedia use the programming language Lua which Scribunto makes available, and they also use the extension's parser functions. The Cite extension allows you to use the ‎<ref> tags. All Wikipedias and other WMF wikis already have all of these things installed.

  1. Export citation templates from Wikipedia: Manual:Using content from Wikipedia . Exporting w:Template:Cite web, w:Template:Cite news, w:Template:Cite journal, w:Template:Cite book is a good place to start.

Recent versions of these templates at the English Wikipedia and some others also require the supporting Lua modules.

  1. Ներբեռնել ձեր կաղապարները` օգտագործելով Special:Import էջը (օրինակ` http://localhost/index.php/Special:Import)

Կաղապարի տվյալներ

ՎիզուալԽմբագրիչում կաղապարի տվյալը բացելու համար ձեզ պետք կգա Extension:TemplateData : For more information on how to define template data for citations, and to see screenshots of how a citation window should look with and without template data defined, see: Wikipedia:VisualEditor/TemplateData

Ծանոթագրության գործիքի նշանակություն

ՎիզուալԽմբագրիչի ծանոթագրության գործիքն ակտիվացնելու համար անհրաժեշտ է ձեր վիքիում ստեղծել հատուկ հաղորդագրություն` MediaWiki:Cite-tool-definition.json:

Կարգավորման հաղորդագրության նպատակը

Հաղորդագրություն.

  • Ցույց է տալիս, թե ձեր վիքիի որ կաղապարներն են օգտագործում ստանդարտ ծանոթագրություններ:
    • Ուշադրություն. յուրաքանչյուր կաղապար պետք է ունենա ԿաղապարիՏվյալ Եթե ձեր վիքիում բացակայում են ծանոթագրության կաղապարները, ապա կարող եք դրանք սարքել` օգտվելով այլ վիքիներից:
  • Ցույց է տալիս, թե որ պիտակն եք ցանկանում օգտագործել յուրաքանչյուր տեսակի ծանոթագրության համար:
    • Նրանք չորսն են` "կայք", "գիրք", "նորություններ" և "ամսագիր", որոնք համապատասխանում են MediaWiki:Visualeditor-cite-tool-name-web և այլն:
  • Ցույց է տալիս, թե որ պատկերն եք ցանկանում օգտագործել յուրաքանչյուր տեսակի ծանոթագրության համար:
    • Նրանք չորսն են` "ref-cite-web", "ref-cite-book", "ref-cite-news" և "ref-cite-journal", որոնք համապատասխանում են CSS դասին:

Երբ ստեղծվի MediaWiki:Cite-tool-definition.json կարգավորման հրամանը, ծանոթագրության գործիքը հասանելի կլինի ՎիզուալԽմբագրիչում:

Լրացուցիչ տեսակներ

Եթե ցանկանում եք նոր տեսակ ավելացնել, ծրագրավորողների խումբը մեծ հաճույքով կխոսի ձեր հետ և կօգնի ստեղծել համապատասխան պատկերը:

Նոր տեսակի ավելացման համար անհրաժեշտ է

  1. Որոշեք, թե ինչ տեսակ եք ցանկանում ստեղծել
    • Այս օրինակում ասվում է, որ եթե դուք ցանկանում եք ունենալ ծանոթագրության տվյալների շտեմարան, դուք կարող եք այն կոչել "տվյալների շտեմարան":
  2. Ստեղծել պիտակ դրա համար
    • Տվյալ օրինակի համար կարող եք սահմանել "db" անվանումը և ավելացնել պիտակը "database" արժեքով MediaWiki:Visualeditor-cite-tool-name-db մեջ:
  3. Ստեղծել պատկեր դրա համար
    • Տվյալ օրինակի համար կարող եք սահմանել "ref-cite-dbase" նկարը և ստեղծել SVG պատկեր և ներբեռնել այն Վիքիպահեստ: Այնուհետև ստեղծել "oo-ui-icon-ref-cite-dbase" պատկերի դասը և ավելացնել նախընտրած պատկերը "background-image:url(//upload.wikimedia.org/wikipedia/commons/1/12/VisualEditor_-_Icon_-_Ref_db.svg)" հետ:

Օրինակներ

Կարող եք օրինակներ տեսնել անգլերեն և լեհերեն վիքիներում: Copy the code to your wiki and adapt the names to the local context.

Template type mapping

In addition to MediaWiki:Cite-tool-definition.json, you also need to create MediaWiki:Citoid-template-type-map.json to specify which types of citations map to which templates. You can see an example on the English Wikipedia.

"Citation needed" tool

The "citation needed" tool.

"Citation needed" templates can be configured to show an "Add a citation" button in the editor by configuring MediaWiki:Visualeditor-template-tools-definition.json with a citationNeeded key.

The configuration value lists templates (which can contain multiple titles for redirects) and parameter mappings. Currently supported keys are:

  • reason - shows the reason a citation is needed in the context item
  • date - shows the date "citation needed" template was added in the context item
  • encapsulate - text which has been wrapped by the template, and which should be unwrapped when a citation is added

The value of these mappings is the name of the parameter(s) in the local template:

{
	"citationNeeded": [
		// This key is always "citationNeeded" in every language
		// Each item of this list represents a single template
		{
			"title": [
				// Title can be a string, or list of redirects
				"Citation needed",
				"Cn",
				...
			],
			"params": {
				"reason": "reason",
				"date": "date"
			}
		},
		// This template is defined separately as it supports the
		// "encapsulate" param. On some wikis this is the same
		// template as the one above.
		{
			"title": [
				"Citation needed span",
				"Cite needed span",
				...
			],
			"params": {
				// Parameters can be a string or list of aliases
				"encapsulate": [ "1", "text" ],
				"reason": "reason",
				"date": "date"
			}
		}
	]
}

See the example definition on English Wikipedia.

Խնդիրների հայտնաբերում

Եթե ԿաղապարիՏվյալը ներդրված է, սակայն ծանոթագրության պատուհանում դաշտերը չեն ցուցադրվում, ապա պետք է բացեք ծանոթագրության կաղապարը, փոփոխություններ չանեք և կրկին հիշել տաք այն: Սա ԿաղապարիՏվյալի միացման հետ կապված խնդիր է:

Հաշվի առեք, որ մասնակիցները ավելի դժվարությամբ կկիրառեն ձեր ծանոթագրության կաղապարները, քան այն տարածված չորսը: