[Gsoc idea] Red Pen Integration

Version 9.1 by De Sheng Chuan on 2017/06/26 07:13

 
 Feature
 Active
 

Description

This is about integrating RedPen into XWiki.

Introduction

RedPen is a proofreading tool that ensures a particular body of text is of a professional quality.

Approach

Phase 1:

  • Figure out how to export RedPen as a JAR library instead of having to operate it as a RedPen server. (Currently asking on redpen's Gitter: redpen-cc-gitter
  • Create main RedPen component within separate api folder
    • XWiki extension primarily contains a Java component that will execute command line onto a RedPen server, or use the RedPen library, depending on how RedPen is implemented. (Currently 50% complete)
  • Create XAR ui within an XWiki instance, then export into Maven with XAR Maven plugin
  • RedPen to be executed as a job on pages in the wiki. (Another component to be created)
  • Within the XWiki extension, write an EventListener component that allows RedPen to be executed when a WikiPage is saved. Most likely the onEvent function in the EventListener will return a boolean to the main Java component executing RedPen (Another component)

Phase 2:

  • Clean up UI on XWiki extension
  • Allow user to change proofreading rules in the wiki pages, regarding how the document will be checked. I will create a set of Validator plugins. A switch would be placed in the main Component that chooses which validator plugin to use with RedPen, depending on which set of rules the user chooses.
  • Create a component that will help to create a new Validator. The admin user can access an XWiki page, fill up the parameters, and the component will create a new Validator class using the parameters input.
  • Create a script service that calls the Java component in the extension to execute RedPen on any XWiki Page.

Phase 3:

  • Debugging
  • Contribute support for the XWiki Syntax 2.1 markup text format in RedPen

RedPen

  • Redpen provides a library, redpen-core, on the Maven central repository. The library allows a person to build a RedPen object that can validate and export errors in the form of a JSON object. It also provides Parser classes to be parse in text inputs of many formats.
  • Validation: The redpen object must be instantiated with a XML file containing its configuration setting. The XML contains nodes called Validators, which just references existing implementations of the validators in the RedPen Core library. To edit the configuration, one just needs to edit the XML file itself. This can be done in Java issues.

 


Get Connected