Git Product home page Git Product logo

sphinx-to-antora-migrator's Introduction

Sphinx-Doc to Antora Migration Tool

This is a small repository that provides tools for migrating a Sphinx-Doc installation to Antora. It’s written in PHP, as the tool was written while working at ownCloud (the vast majority of ownCloud’s code is written in PHP). Given that, it makes sense to keep using PHP. If you want to port it to another language, please feel free.

What is it?

The tool is a command-line utility,provided as a PHP Phar archive, that provides a range of commands for exporting a Sphinx-Doc installation to Antora. Currently, there is only one supported command; this is navigation:build-from-files, which builds an Antora (AsciiDoc) navigation file, from a list of AsciiDoc files.

Installation

The tool is provided both as code, and as a pre-packaged Phar file. So to install it, all you need is PHP, at least version 7.1 or higher. If you want to re-build the Phar archive, then you have two choices:

1. Via GNU Make

To use GNU Make to rebuild the Phar archive, run make rebuild-phar. When built, the Phar archive will be located in the build directory and named converter.phar.

2. Manually

To manually rebuild the Phar archive, run the following commands:

cd source
composer install
php create-phar.php

When completed, the Phar archive will be located in the root of the repository, and named converter.phar.

Usage Instructions

Creating an AsciiDoc navigation menu

To creating an AsciiDoc navigation menu, you have to pass a list of AsciiDoc files that you want to create an AsciiDoc navigation menu for to the navigation:build-from-files command.

The following example shows how to find all AsciiDoc files, and to pipe that file list to thenavigation:build-from-files command.

find ./path/to/my/manual/modules/ROOT/pages \
	-type f -name "*.adoc" | \
	php converter.phar navigation:build-from-files

List Available Commands

To list the available commands, supported by the Phar archive, just run it without any additional arguments, as in the example command below:

php converter.phar

Currently, this will output the following to the console:

#!/usr/bin/env php

Console Tool

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  help                         Displays help for a command
  list                         Lists commands
 navigation
  navigation:build-from-files  Creates a navigation AsciiDoc file from the source files

sphinx-to-antora-migrator's People

Contributors

settermjd avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sphinx-to-antora-migrator's Issues

Bugs in the migration process

There are some issues in the navigation file creator

  • The files list has to be generated in the "pages" directory, otherwise "pages" is added to the navigation list as the root element, and all the generated files and directories are added as sub-links. For example:
* Pages 
** Appliance
*** Ucs
**** xref:appliance/ucs/add-groups-and-users.adoc[Add groups and users]
*** xref:appliance/Active_Directory.adoc[Active Directory]
  • An empty top-level nav menu item is generated and all items are added as sub-links. For example:
* 
** Appliance
*** Ucs
**** xref:appliance/ucs/add-groups-and-users.adoc[Add groups and users]
*** xref:appliance/Active_Directory.adoc[Active Directory]
  • Directories are not linked. For example:
*** Files
**** External_storage
  • PHP interrobang is added to the start of the navigation file: #!/usr/bin/env php.
  • Directory names are not converted, only file names. e.g., Ucs should be UCS in the first two examples.
  • Manual name missing from the top of the navigation menu. Yes, it's optional afaik, but for consistency and legibility, it should be there. For example:
It's currently this:

* xref:appliance/[Appliance]

It should be:

.Admin Manual
*  xref:appliance/[Appliance]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.