Dokuwiki To Markdown

Posted on  by admin

Looking for a free text converter? Look no more, upload your GitHub-Flavored Markdown files and convert them to DokuWiki markup files. Yes, it’s that easy.

  1. Dokuwiki To Markdown Online
  2. Github Markdown Syntax

Converting from GitHub-Flavored Markdown

We love Markdown, because it’s just plain text. It’s simple and powerful at the same time. Pure beauty. It’s this one standard that works everywhere. Okay, it works a little bit different depending on the platform you are using, but we all agree that the GH flavor is the one and only Markdown flavor, don’t we? Actually, I’m not sure what’s so special about this MD standard, but never mind. Hopefully you know what’s it all about. Anyway, here is your free online converter for GitHub-flavored Markdown. Just upload your file, cross fingers and download the result. Hope it works.

The files end with .md by default.

Built in access controls and authentication connectors make DokuWiki especially useful in the enterprise context and the large number of plugins. Look no more, upload your original unextended Markdown files and convert them to DokuWiki markup files. Yes, it’s that easy. Converting from original unextended Markdown The original unextended Markdown is based on the syntax outlined in John Gruber’s original design document. DokuWiki to Markdown Converter Introduction. Tools to convert the DokuWiki syntax to Markdown syntax. Please note it has some specific Liquibase regular expressions in scripts/DocuwikiToMarkdownExtra.php. TODOS Fix the following conversion inconsistencies is replaced by ``.

Dokuwiki To Markdown

Converting to DokuWiki markup

DokuWiki is basically the Mediawiki syntax. And Mediawiki powers Wikipedia, so I think it’s fair to say it’s a widely used format. The DokuWiki system is based on PHP and uses plain text files, instead of a database. With DokuWiki you can structure those text files, e. g. put headlines above a paragraph, add links and so on. If you want to convert those DokuWiki files to another format (to migrate to another system for example) or want to convert your files to DokuWiki files, we got you covered. Upload all your wisdom and we spit out the format you’re looking for, for free.

The files end with .txt

Dokuwiki To Markdown Online

by default.

Other free online converters

  • This page is a replacment for http://danpeirce.net46.net/dokuwiki/doku.php?id=python_markdown

New updates will be made here rather than there (at least that is what I am thinking now).

Table of Contents
  • Python Markdown
    • Auto-Generating HTML5 with a Table of Contents
    • Syntax Highlighting Using Pygments

Auto-Generating HTML5 with a Table of Contents

One of the things I like about dokuwiki is that it automatically generates a table of contents.When I saw the extensions for Markdown at pythonhosted.orgit occurred to me that Markdown might actually provide what I need. ThePython file that was used to convert the markdown file make_toc.md toan HTML5 file is make_toc.py. The Python file is short enough to show here.

This is a combination of actual Python with multi-line string objects thatcontain some pre-written HTML.

The line that converts the Markdown text to html is

Markdown does not include code for opening the top of the HTML file or closingat the end so literal multi-line strings are used to add those and the HTMLconverted from Markdown is inserted in the middle.

The Python file was invoked as follows:

The CSS Style Sheets Used

I copied the CSS style Sheets used here from the web since they were availableand shared freely.

  • white.css was modified from avenir-white.css
  • default.css was taken from default.css -- used with Pygments for syntax highlighting.

Syntax Highlighting Using Pygments

Installing Pygments

On my Debian system Pygments was not pre-installed but it is a standard DebianPackage.

For a MS Windows computer that is not going to work.See installing-python-pygments-on-windows

Github Markdown Syntax

Example of C with Syntax Highlighting

Meta Extension to Read Title from Markdown File

Dokuwiki

The Markdown file requires the following on the first line:

For this to be seen as meta data it must occur on the first line. The first blank line in thefile indicates the end of the meta data.

Code as been added to the make_toc.py file to read the title and add it between titletags in the generated HTML5 file.

Converting from DokuWiki

I have worked out a method to convert my dokuwiki pages to static html using markdown as the new working file format.The method was inspired by http://donaldmerand.com/code/2012/07/20/how-i-actually-convert-dokuwiki-to-latex.html. Despite the name given to that page this is relevant since he actually talks a lot about converting dokuwiki to markdown

The steps I am using are

  1. Convert the DokuWiki page to HTML. This is done using dokucli.php which should be put in the dokuwiki/bin folder. On my Rasperry Pi it is at /var/www/danp/dokuwiki/bin/dokucli.php.

    The command is

    The file dokuwiki.php comes from https://www.dokuwiki.org/tips:dokuwiki_parser_cli

  2. The new HTML file may or may not require some cleanup as references to the path on the raspberry pi need to be removed and some non-Ascii characters may be pressent and need to be removed or converted to Ascii (Markdown will not work with non-Ascii in the file.

    (note that the input file ends in one underscore and the output file name ends in two underscores)

    I wrote cleanhtml.py myself and I am adding new non-ascii characters as I go. Notes on the webpage that gave me insight into this have be lost. cleanhtml.py

  3. Now the file should be ready to be converted to Markdown markup language. ./html2text.py < newfile.html__ > newfile.md -> {if cleanup was needed use the cleaned file}

    html2text.py is from https://github.com/aaronsw/html2text

  4. A few adjustments are edited into the markdown file. This generally easy to do in a text editor (I typically using vim).

    1. I am using the meta extension and put

      at the top of each markdown page.

    2. I put TOC in square brackets where I want the Table of Contents to go (using the TOC extension).

    3. In dokuwiki the local links are just the name of the page without an extension. I add the html extension and tweek the path if needed.

    4. Images that are in a subdirectory require the : be replaced with a / in the path.

  5. The markdown file is converted to an HTML file.

    My makehtml.py was modified from make_toc.py. See make_toc.html.

BeatifulSoup for Extracting Section of Web Page

Sometimes one needs only part of an existing webpage for conversion to Markdown.BeatifulSoup can be used to extract some part of a bigger page. A simple example in which I wanted to backup only particular divisions of a page generated by a CMS before the site was to be migrated to a different CMS.

This finds the div tag in which the id was set to 'content' and the id for which the id was set to 'sidebar'