Html2wt: Difference between revisions

From Freephile Wiki
Created page with "The Parsoid project gives the ability to parse HTML, however the results definitely need to be examined to see how it might be able to work <source>cat uvm.html | webapps/wiki..."
 
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight"
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
The Parsoid project gives the ability to parse HTML, however the results definitely need to be examined to see how it might be able to work
== Transforming HTML to WikiText ==
<source>cat uvm.html | webapps/wiki/extensions/parsoid/tests/parse.js --html2wt</source>
Transforming (hopefully well-formed) HTML to WikiText is required if you want to import HTML content into a wiki.  Some editors do well at this, and perhaps the best editor to do this is the [[Visual editor]] which now is the default editor for the MediaWiki project.
 
== Parsoid ==
 
The [[mw:Parsoid]]<ref>Git repo https://git.wikimedia.org/summary/mediawiki%2Fextensions%2FParsoid</ref> project gives the ability to parse HTML, however the results definitely need to be examined to see how it might be able to work.  Take a look at the [[mw:Parsoid/MediaWiki DOM spec]] for capabilities.
 
Example usage
<syntaxhighlight lang="bash">cat uvm.html | webapps/wiki/extensions/parsoid/tests/parse.js --html2wt</syntaxhighlight>
 
== Other Classes or Libraries ==
 
The 'Wikilog' extension <ref>See also [[MediaWiki/Bundles]]</ref> is a [http://www.mediawiki.org/wiki/Extension:Wikilog MediaWiki extension that adds "blogging" features] <ref>however, it's unmaintained, so see the modified version at github</ref> to MediaWiki (e.g. http://laussy.org/wiki/Blog).  One aspect of the project is a PHP class that transforms HTML to wiki text.  See https://github.com/mediawiki4intranet/Wikilog/blob/master/HtmlToMediaWiki.php  Also, the Wikilog extension makes use of namespaces to create multiple blogs.
 
== Other Transformations ==
 
http://en.wikipedia.org/wiki/Help:WordToWiki
 
{{References}}


[[Category:Wiki]]
[[Category:Wiki]]

Latest revision as of 13:22, 24 February 2025

Transforming HTML to WikiText[edit]

Transforming (hopefully well-formed) HTML to WikiText is required if you want to import HTML content into a wiki. Some editors do well at this, and perhaps the best editor to do this is the Visual editor which now is the default editor for the MediaWiki project.

Parsoid[edit]

The mw:Parsoid[1] project gives the ability to parse HTML, however the results definitely need to be examined to see how it might be able to work. Take a look at the mw:Parsoid/MediaWiki DOM spec for capabilities.

Example usage

cat uvm.html | webapps/wiki/extensions/parsoid/tests/parse.js --html2wt

Other Classes or Libraries[edit]

The 'Wikilog' extension [2] is a MediaWiki extension that adds "blogging" features [3] to MediaWiki (e.g. http://laussy.org/wiki/Blog). One aspect of the project is a PHP class that transforms HTML to wiki text. See https://github.com/mediawiki4intranet/Wikilog/blob/master/HtmlToMediaWiki.php Also, the Wikilog extension makes use of namespaces to create multiple blogs.

Other Transformations[edit]

http://en.wikipedia.org/wiki/Help:WordToWiki

References[edit]

  1. Git repo https://git.wikimedia.org/summary/mediawiki%2Fextensions%2FParsoid
  2. See also MediaWiki/Bundles
  3. however, it's unmaintained, so see the modified version at github