• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

philipashlock/mediawiki-to-markdown: Convert MediaWiki pages to GitHub flavored ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

philipashlock/mediawiki-to-markdown

开源软件地址(OpenSource Url):

https://github.com/philipashlock/mediawiki-to-markdown

开源编程语言(OpenSource Language):

PHP 100.0%

开源软件介绍(OpenSource Introduction):

MediaWiki to Markdown

Convert MediaWiki pages to GitHub flavored Markdown (or other formats supported by Pandoc). The conversion uses an XML export from MediaWiki and converts each wiki page to an individual markdown file. Directory structures will be preserved. The generated export can also include frontmatter for Github pages.

You may also be interested in a forked version of this codebase available at https://github.com/outofcontrol/mediawiki-to-gfm

Requirements

  • PHP
  • Pandoc

Export MediaWiki Pages

You'll export all your pages as a single XML file following these steps: http://en.wikipedia.org/wiki/Help:Export

Installation

Install Pandoc

http://johnmacfarlane.net/pandoc/installing.html

Get Composer

curl -sS https://getcomposer.org/installer | php

Install Composer Packages

php composer.phar install

Run

####--filename#### The only required parameter is filename for the name of the xml file you exported from MediaWiki, eg:

php convert.php --filename=mediawiki.xml

####--output#### You can also use output to specify an output folder since each wiki page in the XML file will generate it's own separate markdown file.

php convert.php --filename=mediawiki.xml --output=export

####--indexes#### You can set indexes as true if you want pages with the same name as a directory to be renamed as index.md and placed into their directory

php convert.php --filename=mediawiki.xml --output=export --indexes=true

####--frontmatter#### You can specify whether you want frontmatter included. This is automatically set to true when the output format is markdown_github

php convert.php --filename=mediawiki.xml --output=export --format=markdown_phpextra --frontmatter=true

####--format#### You can specify different output formats with format. The default is markdown_github. See

php convert.php --filename=mediawiki.xml --output=export --format=markdown_phpextra

Supported pandoc formats are:

  • asciidoc
  • beamer
  • context
  • docbook
  • docx
  • dokuwiki
  • dzslides
  • epub
  • epub3
  • fb2
  • haddock
  • html
  • html5
  • icml
  • json
  • latex
  • man
  • markdown
  • markdown_github
  • markdown_mmd
  • markdown_phpextra
  • markdown_strict
  • mediawiki
  • native
  • odt
  • opendocument
  • opml
  • org
  • plain
  • revealjs
  • rst
  • rtf
  • s5
  • slideous
  • slidy
  • texinfo
  • textile



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap