Code for converting the Roadmap to Reentry into HTML from Word
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
js
roadmap-to-html
sass
templates
tests
.gitignore
Dockerfile
Makefile
README.md
all_contents.json
data.py
docker-compose.yml
full_toc
gulpfile.js
main.py
package-lock.json
package.json
requirements.txt
server.py
stylemap.txt

README.md

Roadmap to HTML

A github repo for code to convert the Roadmap to Reentry into HTML.

Before you start

Make sure you have node and python3 installed.

Getting started

Quickstart

An outline of commands used, for people who are comfortable on the command line:

git clone https://github.com/rootandrebound/roadmap-to-html.git
cd roadmap-to-html
python3 -m venv .    # create a python virtual environment
source bin/activate  # activate the virtual environment
make install         # install all node and python dependencies
make                 # build the output

1. Clone this repo to your computer

git clone https://github.com/rootandrebound/roadmap-to-html.git
cd roadmap-to-html

2. Get the latest version of the Word document (source.docx)

To get started, you need to download the original word document and put it in the root project folder. Download source.docx and put it in the root folder for this repository. Note that the preceding link should only be accessible to staff members at Root & Rebound or people who have been given specific access to the containing folder.

3. Create and activate a python virtual environment

This step ensures that any python dependencies will not interfere with other Python projects on your computer. This step is a common good practice when working on any project that uses Python.

python3 -m venv .    # create a python virtual environment
source bin/activate  # activate the virtual environment

3. Install dependencies

This command will install all the dependencies for both Node and Python.

make install

4. Run the script to make HTML

This command will:

  • Produce an output similar to what is described here.
  • Run the necesary gulp tasks to compile and minify CSS & Javascript
make

5. View the HTML locally

This command will fire up a development server and you will be able to see the site opening http://localhost:3000/ in your browser.

make server

The script

The Makefile includes one command for producing the HTML output:

node_modules/mammoth/bin/mammoth \  # the path to mammoth's executable
    ./source.docx \      # the path to the input word document
    --output-dir=roadmap \          # the output directory
    --style-map=stylemap.txt        # the stylemap
    mv output/source.html \  # rename the resulting html doc
        output/raw_index.html
    python main.py                  # chop up and output each chapter