Skip to content

Online XML Editor for SPDX Licenses, Google Summer of Code 2018

Tushar Mittal edited this page Jun 5, 2018 · 9 revisions

Project Overview

The objective of my GSoC'18 project is to add an XML editor the SPDX Online Tools using which users can easily edit the SPDX licenses and also create new ones from scratch.

Although there are other XML editors available online, the purpose of this project was to make the editor beginner friendly and comply with SPDX license schema, so that a person with minimal knowledge of XML can edit the documents and submit their changes to be reviewed by the SPDX team.

To make it beginner friendly I have added both the text based and tree based editor. The tree based editor will show the XML document in an expand/collapse tree manner, which will be easier to use for the beginners. But the tree format can only be generated if the XML document is valid, so to overcome this problem a text based editor is also included which is a conventional XML editor.

Project Details

This section includes the details of how all the features are implemented.

File Input Methods

There are 4 ways by which the user can give the XML input. He can write the XML text in the textarea, upload the XML file, give the license name which he wants to edit, can create a new XML document. When the user inputs the license name the license text is fetched from the license-list-xml repository. When the user inputs the info he is then redirected to the editor page. The input information is handled using Django and a session is created, this is done so that the user can have multiple editors tabs at the same time and the changes are not lost even when the page is refreshed.

Text Based Editor

The text based editor is implemented using CodeMirror which has many features such as autocomplete, code folding, xml beautify, code highlighting, fullscreen editing, trailing space detection etc.

Tree View Editor

Under Construction.

Extra Features

These features include downloading the edited XML document and making a Pull request in the license-list-xml repository so that the changes can be reviewed and merged.

ToDo:

  • Add alert when user leaves the editor page.
  • Implement tree editor.
  • Implement pull request feature.