====== Convert HTML to DokuWiki ====== An idea for converting existing documents to text files with [[:DokuWiki]] [[:wiki:syntax]] using an HTML to Text converter. I've set up a config file for the tool available at http://www.mbayer.de/html2text/ which produces some usable results: [[https://www.dokuwiki.org/_media/wiki:text2html.rc|text2html.rc]]. * Thomas J. Messenger made a Perl module to convert HTML to DokuWiki's syntax available at http://www.citlink.net/~messengertj/ FIXME (see [[bug>81]], too) * Or the one at CPAN: http://search.cpan.org/~diberri/HTML-WikiConverter-0.68/lib/HTML/WikiConverter.pm * Online HTML to wiki converters (based on WikiConverter?) (paste HTML or fetch URL): * [[http://tools.wmflabs.org/magnustools/html2wiki.php|HTML2Wiki Converter]] - Convert HTML text to wiki markup (This is a slightly altered mirror of a script by Borislav Manolov) * A Converter Tool (HTML -> DokuWiki, UTF8, Tablespacing) [[http://runtimebasic.net/Projekt:WikiTool|WikiTool]] (inĀ German) * **Pandoc:** * Webinterface: http://johnmacfarlane.net/pandoc/try/ (Pandoc includes a Haskell library and a standalone command-line program.) * Starting in [[http://pandoc.org/releases.html#pandoc-1.13-15-august-2014|version 1.13]], pandoc suports DokuWiki output. Example: pandoc -s -r html https://www.dokuwiki.org/tips:htmltowiki -t dokuwiki > tips.txt ===== Html2DokuWiki Converter GUI for Win32 ===== Html2DokuWiki is a free HTML to DokuWiki converter for Win32 platforms. It is very simple to install and extremely easy to use. Just extract the executable from the archive, double-click to start, and Html2DokuWiki is ready to go. To start converting, just type HTML into the upper edit. The converted DokuWiki syntax will immediately appear in the lower edit. Then select (''CTRL+A'') the converted document and copy / paste it into any DokuWiki site. Larger HTML documents can also be pasted into the HTML input. [[http://www.yunqa.de/delphi/downloads/Html2DokuWiki.zip|Click here to download Html2DokuWiki]]. **Supported HTML Elements** {{ http://www.yunqa.de/software/Html2DokuWiki.png?250&nocache|Html2DokuWiki}}Html2DokuWiki converts all HTML elements currently supported by DokuWiki: * **** -> links, outputs multiple links for formatting * **** -> ''%%**%%'' * **
** -> ''>'', including nested quotes * **
** -> new line ''%%\\%%'' * **** -> ''%%''%%'' * **** -> '''' * **
,
, and
** -> Simulate output as simple unnumbered lists with ''
'' as bold. * **

** ... **

** -> ''%%======%%'' to ''%%==%%'' * **** -> ''%%//%%'' * **** -> images * **
  • ** -> list items, including nested lists * **
      ** -> numbered lists * **

      ** -> new paragraph * **

      ** -> ''''
        * **** -> ''%%**%%''
        * **** -> ''%%//%%''
        * **** -> ''%%**%%''
        * **** -> ''''
        * **** -> ''''
        * **** -> tables
        * **** -> recognized, but not output
        * **** -> recognized, but not output
        * **** -> recognized, but not output
        * **** -> table row, with ''align'' support
        * **** -> to ''%%''%%''
        * **** -> to ''__''
      
      ** Special Features **
      
        * Internal links are converted to DokuWiki's '':'' style, external ones are left unchanged. ''mailto:'' is removed from e-mail links.
        * Support for alignment in table cells and rows.
        * Image properties are converted, including alignment, width, and height.
        * Formatting is only applied where accepted by DokuWiki, but not to ''%%=== ... ===%%'' and ''%% ... %%'', for example.
        * Full Unicode support, with optional UTF-8 input or output encoding.
        * Option to hide links from DokuWiki syntax.
      
      **Author, Contact, and Development**
      
      Html2DokuWiki is developed by Ralf Junker. You can contact the author via the [[http://www.freelists.org/list/yunqa|Yunqa mailing list]]. Feel free to report praise, bugs, or suggestions about Html2DokuWiki.
      
      The converter might also be available as a software library (*.DLL, *.DCU, or Delphi source code). Please get in touch if interested.
      
      **Version History**
      
      // 2007-08-27 //
      
        * Add inline formatting to table cells.
        * New UTF-8 input encoding.
        * Fix paragraph problems with alternating inline-tags and block-tags.
        * Do not escape ''%%//%%'' to ''%%//%%'' if part of an external URI.
        * Escape ''%%'' to ''%%%%%%%%%%''.
        * Empty heading elements separate paragraphs.
      
      // 2007-10-22 //
      
        * New: Support for ''
      '', ''
      '', and ''
      ''. Simulate output as simple unnumbered lists with ''
      '' as bold. * Improve: Empty paragraph inserts line break. * Improve: Recognize DokuWiki internal escapes ''%%'', ''%%%%'', and ''%%%%'' and escape them properly. * Improve: Escape table markup (''|'' and ''^'') when inside a table. * Improve: Escape double parenthesis ''(('', which starts a DokuWiki footnote. * Improve: Suppress DokuWiki escapes and typography in ''
      '' blocks.
        * Fix: Newline output for HTML like ''%%

      one
      two


      three%%''. * Fix: ''
      '' table problem where a new row did not output a linebreak. ===== Workflow Microsoft Word 2 DokuWiki using html2wiki-GUI ===== I was looking for a way to convert about 150 DOC-files (Microsoft Word2000 or 2003) in our new wiki without too much hassle. The macros available didn't work for me. **Specifications** * usable for multiple files * converting tables * converting images **suggested workflow** (works best IMO) - open word-document in OpenOffice - save as HTML (the pictures will be stored in the same folder as the HTML) - open html2dokuwiki plugin[[http://www.yunqa.de/delphi/downloads/Html2DokuWiki.zip|Click here to download Html2DokuWiki]] - paste and copy HTML-code in the GUI - save as txt-file (or create new page for integrity) - copy txt-file in the DATA/PAGES/NAMESPACE-folder and Pictures in the DATA/MEDIA/NAMESPACE-folder Is there a faster way (2009/07/18 by bobeck) -> This is still the fastest and most reliable way (2014/09/24 by josh) ===== Create HTML in Microsoft Word 2007+ for DokuWiki ===== * Open/Compose Word document * Click Save As * Choose **Web Page Filtered** for the Save As Type * Open the HTML page in a text editor * Copy all HTML code * Paste into appropriate place on the wiki page * if needed change the html tag from '''' to simple ''... '' -> (2015/05/15 by qtrolazyg) > :!: This will only work if the [[config:htmlok]] config setting was enabled. But that opens up a huge **security risk**. So, please **use this approach only in closed wikis**! Apart from that, the HTML that Word creates is awful... --- [[user>ach|Anika Henke]] //2015-03-15 18:42//
      ** -> table cell, with ''align'' and ''colspan'' support * **
      ** -> table header cell, with ''align'' and ''colspan'' support * **