项目作者: stcarrez

项目描述 :
Wiki 2 Wiki Converter
高级语言: Ada
项目地址: git://github.com/stcarrez/wi2wic.git
创建时间: 2020-09-20T12:01:28Z
项目社区:https://github.com/stcarrez/wi2wic

开源协议:Apache License 2.0

下载


Wiki To Wiki Converter

Build Status
License
Commits
Docker

Wi2wic is a small server that allows to convert HTML in Wiki text such as Markdown, MediaWiki, Dotclear or Creole.
It can also convert one Wiki syntax to another. It can be used to:

  • Migrate HTML page in Markdown or another Wiki,
  • Convert Wiki page in HTML,2
  • Cleanup a complex and noisy HTML page

The server is written in Ada and provides the following REST operations:

  • import some HTML content and convert it in a Wiki syntax,
  • convert a Wiki text from one syntax to another,
  • render a Wiki text in HTML.

You can try Wi2wic on https://wi2wic.vacs.fr/wi2wic/index.html

It was created as a demo site for Ada Wiki.

Building Wi2wic

To build wi2wic you will need Alire.

Then, build the application:

  1. make

Running Wi2wic

You will then start the application as follows:

  1. bin/wi2wic-server

and point your browser to http://localhost:8080/wi2wic/index.html

Docker

A docker container is available for those who want to try Wi2wic without installing
and building all required packages. To use the Wi2wic docker container you can
run the following commands:

  1. sudo docker pull ciceron/wi2wic
  2. sudo docker run --name wi2wic -p 8080:8080 ciceron/wi2wic

and then point your browser to http://localhost:8080/wi2wic/index.html

To stop the running application you will use:

  1. sudo docker stop wi2wic
  2. sudo docker rm wi2wic

If you want to build locally the docker image, you can use:

  1. sudo docker build -t wi2wic -f docker/Dockerfile .

Security

The server can download a URL through the /wi2wic/import API entry point.
The server only accepts http:// and https:// URL. The server should
be run from a docker container or similar restricted environment in order
to protect malicious URL.

Limitations

The HTML parser and converter is able to read and parse invalid HTML but
some structures are not convertable to some Wiki syntax.

The HTML to Wiki converter does not read the CSS and therefore cannot
convert correctly some HTML that has specific presentation through their CSS.
The interpretation of HTML+CSS is left to the reader as an exercise
(Hint: use the Ada parser for CSS files)