Git Product home page Git Product logo

confluence-to-jekyll's Introduction

Purpose

This script was implemented in order to facilitate the migration of strongloop/loopback Confluence documentation to Jekyll templates.

Converter

Written using Node v4.4.3, it performs the conversion as a flow of tasks.

How to run the script

npm install
node . {PATH_TO_ORIGINAL_CONTENT} {OUTPUT_PATH}

Flow based converter

As many people offered their help on the forum topic, the converter should enable parallel team work.

The approach taken here splits each conversion task to a separate flow step.

Global flow

The steps in src/global-flow handle the global tasks in this sequence:

  • Reads the page hierarchy, provides:
    • List of files to convert
    • Hierarchical page structure
  • Updates the files metadata and define destination file path
  • Calls the conversion flow on each page file (see below Content conversion flow)
  • Builds and writes the side menu based on the page hierarchy

Content Conversion flow

Located under src/content-conversion-flow. Each step performs a task on the content and calls the next one.

This flow is executed sequentially once per file:

  • Reads the original content
  • Finds the attachment pictures, updates the src attribute and write the file on the new location
  • HTML to MD
    • link tags
    • image tags
    • content only and black list tags cleaning
    • tables, left as HTML for readability, cleans and beautify code
    • code blocks, if multiline, tags as JS and beautify if it passes JSON or JS validation
    • Confluence info macros (hint, success, problem, warning) to Jekyll include
    • hidden review comments left in div.sl-hidden but as beautified HTML
  • Builds the front matter
  • Writes the converted content

Tests

 ./scripts/watch.sh ./tests/{path-to-test-file}.js

Useful links

confluence-to-jekyll's People

Contributors

marc-ed-raffalli avatar

Watchers

 avatar

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.