Difference between revisions of "MarkupBabel"

From Wiki4Intranet
Jump to: navigation, search
(GNUplot)
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Extension4i
+
{{Extension4info
 
|name=MarkupBabel
 
|name=MarkupBabel
|назначение=«Вавилон разметок» — включает поддержку [[LaTeX]]-формул, [[Graphviz]]-графов, [[Gnuplot]]-графиков и процентных диаграмм, UML-схем через UMLGraph. Не требует дополнительных скриптов, в отличие от [[mediawikiwiki:Extension:Math|Math]].
+
|description en=«Markup Babylon» — support for [[LaTeX]], [[Graphviz]], [[Gnuplot]], UMLGraph and UMLet.
|created=2008-10-14
+
|description ru=«Вавилон разметок» — поддержка [[LaTeX]], [[Graphviz]], [[Gnuplot]], UMLGraph и UMLet.
|version=2012-12-19
+
|created=2006-06-29
 
|included=2008-10-14
 
|included=2008-10-14
 
|status=our
 
|status=our
 +
|useful=definitely
 
}}
 
}}
 +
{{ExtensionFromInfo|lang=en|name=MarkupBabel}}
  
== Использование ==
+
«Markup Babylon» — support for [[wikipedia:LaTeX|LaTeX]] formulas, [[wikipedia:Graphviz|Graphviz]] graphs, [[wikipedia:Gnuplot|Gnuplot]] charts and diagrams, UML diagrams via UMLGraph or UMLet. Does not require additional «texvc» script for LaTeX, unlike [[mediawikiwiki:Extension:Math|Math]], and renders LaTeX in vector format (SVG) for improved quality.
  
Расширение добавляет следующие теги парсера:
+
== Usage ==
  
=== LaTeX ===
+
This extension enables the following parser tags:
  
* <tt><nowiki><m>Код</m></nowiki></tt>
+
=== [[rupedia:LaTeX|LaTeX]] ===
* <tt><nowiki><math>Код</math></nowiki></tt>
+
* <tt><nowiki><amsmath>Код</amsmath></nowiki></tt>
+
  
<tt>Код</tt> — только содержимое документа. В заголовок автоматически подключаются пакеты babel [english, russian], amssymb, amsmath, amscd, color.
+
* <tt><nowiki><m>Code</m></nowiki></tt>
 +
* <tt><nowiki><math>Code</math></nowiki></tt>
 +
* <tt><nowiki><amsmath>Code</amsmath></nowiki></tt>
  
При наличии dvisvgm формулы отрисовываются в виде векторных SVG-изображений.
+
<tt>Code</tt> should be just the document content. babel [english, russian], amssymb, amsmath, amscd, color packages are included in header.
  
=== Graphviz ===
+
Formulas are rendered in vector format (SVG) if you have [http://dvisvgm.sourceforge.net/ dvisvgm] installed on the server (available as part of texlive-extra-utils package under Debian).
  
Теги:
+
Requires installed LaTeX distribution (for example texlive), tex packages and [http://dvisvgm.sourceforge.net/ dvisvgm] utility. Wikipedia-specific "texvc" utility is not required.
; graph, neato, circo, fdp, twopi: Аналогично соответствующим раскладкам Graphviz. graph — это обычная раскладка dot.
+
; graph-print, neato-print, circo-print, fdp-print, twopi-print: Включает граф только в растровом виде и только в печатную версию документа.
+
  
Код внутри тега — полный код графа, вместе с <tt>digraph G { ... }</tt>.
+
=== [[Graphviz]] ===
  
=== GeSHi-подсветка синтаксиса ===
+
Tags:
 +
; graph, neato, circo, fdp, twopi: Each tag renders the corresponding Graphviz layout. "graph" tag uses the standard "dot" layout.
 +
; graph-print, neato-print, circo-print, fdp-print, twopi-print: Same, but only in raster format and only visible in printable version.
  
Требует установленного и подключённого [http://qbnz.com/highlighter/ geshi] (GEneric Syntax HIghlighter). В сборке MediaWiki4Intranet он включён вместе со стандартным расширением <tt>SyntaxHighlight_GeSHi</tt>.
+
You should include the full graph code in tag, along with <tt>digraph G { ... }</tt>.
  
Все теги вида <tt>code-xxx</tt>, где xxx - язык. Языки:
+
[http://www.graphviz.org/ Graphviz] is required for these tags to work.
* actionscript, ada, apache, asm, asp, bash, c, c_mac, caddcl, cadlisp, cpp, csharp, css, delphi, html4strict, java, javascript, lisp, lua, mpasm, nsis, objc, oobas, oracle8, pascal, perl, php, php-brief, python, qbasic, smarty, sql, vb, vbnet, visualfoxpro, xml
+
  
На самом деле, данный способ вставки кода является несколько устаревшим и всё его удобство заключается исключительно в том, что блок кода заворачивается в блок вида &lt;pre&gt;: <pre>/* в такой вот блок */</pre>
+
=== [http://qbnz.com/highlighter/ GeSHi] syntax highlight ===
 +
 
 +
Requires [http://qbnz.com/highlighter/ geshi] (GEneric Syntax HIghlighter). Duplicates <tt>SyntaxHighlight_GeSHi</tt> functionality and differs from it only by &lt;pre&gt; wrapping and different tags which are of <tt>code-xxx</tt> format, where xxx is the highlight language. Supported languages:
 +
* actionscript, ada, apache, asm, asp, bash, c, c_mac, caddcl, cadlisp, cpp, csharp, css, delphi, html4strict, java, javascript, lisp, lua, mpasm, nsis, objc, oobas, oracle8, pascal, perl, php, php-brief, python, qbasic, smarty, sql, vb, vbnet, visualfoxpro, xml
  
 
=== [[Gnuplot]] ===
 
=== [[Gnuplot]] ===
  
Для вставки графиков с помощью Gnuplot используйте тег &lt;plot&gt;…&lt;/plot&gt;
+
Gnuplot graphs are rendered via &lt;plot&gt;…&lt;/plot&gt; tag.
 +
 
 +
=== Gantt-like charts ===
 +
 
 +
This extension also includes minimal Gantt-like chart renderer via Gnuplot. Syntax is:
 +
 
 +
<pre>
 +
<gantt [width=WIDTH height=HEIGHT]>
 +
resource begin_date end_date|duration_in_days task_name...
 +
...
 +
</gantt>
 +
</pre>
 +
 
 +
Resource must not include spaces, begin_date and end_date must be in YYYY-MM-DD format. Example:
 +
 
 +
<gantt width="800" height="200">
 +
Dev 2014-01-28 2 Bug 1
 +
Test 2014-01-29 6 Bug 1
 +
Dev 2014-02-03 4 Bug 2
 +
Test 2014-02-06 2 Bug 3
 +
</gantt>
 +
 
 +
<gantt width="800" height="200">
 +
3.6.3 2014-01-28 14 Dev
 +
3.6.3 2014-02-11 7 Test
 +
3.6.3 2014-02-18 20 Verify
 +
3.6.4 2014-02-11 10 Dev
 +
3.6.4 2014-02-21 5 Test
 +
3.6.4 2014-02-26 14 Verify
 +
</gantt>
 +
 
 +
=== [http://www.umlgraph.org/ UMLGraph] ===
 +
 
 +
UMLGraph draws UML diagrams using Java-like description. That's not always convenient, so there is also an option to use [[PlantUML]] extension.
 +
 
 +
Tag is &lt;umlgraph&gt;.
 +
 
 +
Java and [http://www.umlgraph.org/ UMLGraph] itself are required to work.
  
Минимальную справку по самому Gnuplot можно прочитать здесь: [[Gnuplot]].
+
=== [http://www.umlet.com/ UMLet] ===
  
=== UMLet ===
+
Another UML diagram language. Tag is &lt;umlet&gt;. Also requires Java and [http://www.umlet.com/ UMLet].
  
=== UMLGraph ===
+
== Installation ==
  
== Установка ==
+
Just download the extension to extensions/MarkupBabel and add a usual line in LocalSettings.php:
  
Стандартный процесс установки.
+
<code-php>
 +
require_once "$IP/extensions/MarkupBabel/MarkupBabel.php";
 +
</code-php>

Latest revision as of 22:09, 11 October 2015

MarkupBabel is a MediaWiki extension.

Status for Mediawiki4Intranet distribution:

  • Inclusion date: 2008-10-14
  • Included version: newest available
  • Improvement status: Created by MediaWiki4Intranet project

«Markup Babylon» — support for LaTeX formulas, Graphviz graphs, Gnuplot charts and diagrams, UML diagrams via UMLGraph or UMLet. Does not require additional «texvc» script for LaTeX, unlike Math, and renders LaTeX in vector format (SVG) for improved quality.

Usage

This extension enables the following parser tags:

LaTeX

  • <m>Code</m>
  • <math>Code</math>
  • <amsmath>Code</amsmath>

Code should be just the document content. babel [english, russian], amssymb, amsmath, amscd, color packages are included in header.

Formulas are rendered in vector format (SVG) if you have dvisvgm installed on the server (available as part of texlive-extra-utils package under Debian).

Requires installed LaTeX distribution (for example texlive), tex packages and dvisvgm utility. Wikipedia-specific "texvc" utility is not required.

Graphviz

Tags:

graph, neato, circo, fdp, twopi
Each tag renders the corresponding Graphviz layout. "graph" tag uses the standard "dot" layout.
graph-print, neato-print, circo-print, fdp-print, twopi-print
Same, but only in raster format and only visible in printable version.

You should include the full graph code in tag, along with digraph G { ... }.

Graphviz is required for these tags to work.

GeSHi syntax highlight

Requires geshi (GEneric Syntax HIghlighter). Duplicates SyntaxHighlight_GeSHi functionality and differs from it only by <pre> wrapping and different tags which are of code-xxx format, where xxx is the highlight language. Supported languages:

  • actionscript, ada, apache, asm, asp, bash, c, c_mac, caddcl, cadlisp, cpp, csharp, css, delphi, html4strict, java, javascript, lisp, lua, mpasm, nsis, objc, oobas, oracle8, pascal, perl, php, php-brief, python, qbasic, smarty, sql, vb, vbnet, visualfoxpro, xml

Gnuplot

Gnuplot graphs are rendered via <plot>…</plot> tag.

Gantt-like charts

This extension also includes minimal Gantt-like chart renderer via Gnuplot. Syntax is:

<gantt [width=WIDTH height=HEIGHT]>
resource begin_date end_date|duration_in_days task_name...
...
</gantt>

Resource must not include spaces, begin_date and end_date must be in YYYY-MM-DD format. Example:

UMLGraph

UMLGraph draws UML diagrams using Java-like description. That's not always convenient, so there is also an option to use PlantUML extension.

Tag is <umlgraph>.

Java and UMLGraph itself are required to work.

UMLet

Another UML diagram language. Tag is <umlet>. Also requires Java and UMLet.

Installation

Just download the extension to extensions/MarkupBabel and add a usual line in LocalSettings.php:

require_once "$IP/extensions/MarkupBabel/MarkupBabel.php";