Skip to main content

OpenStax Nebu publishing utility

Project description

CNX Nebu Publishing Utility

This is a command-line interface for interacting with connexions content. The tools is primarily used to publish content to the cnx.org website.

This software requires:

  • Python >= 3.6 <= 3.8

  • libmagic(libmagic1 on Linux)

  • JRE >= 6

Install

  1. Install python3 (on OSX you can run brew install python3)

  2. Run pip3 install --upgrade pip setuptools in a terminal to upgrade python tools

  3. Make sure libmagic is installed (default on Linux, on OSX use brew install libmagic)

  4. Run pip3 install nebuchadnezzar in a terminal

  5. Run neb --help to verify the application is installed

Development

Install

  1. Install python3 (on OSX you can run brew install python3)

  2. Make sure libmagic is installed (default on Linux, on OSX use brew install libmagic)

  3. Install virtualenv (on OSX you can run pip3 install virtualenv)

  4. Initialize the python virtual environment:

    1. virtualenv ./venv/ --python=python3.5

    2. source ./venv/bin/activate

    3. pip3 install --upgrade pip setuptools

    4. python setup.py develop or (preferably) pip3 install -e .

Developer Run

  1. Open up a new terminal

  2. source ./venv/bin/activate

  3. Now you can run various commands:

    • neb --help for help with the various commands

Testing

To run all tests: make test

To run a single test called test_main: make test -- -k test_main

Configuring an Editor

Preparation

  1. Install https://atom.io

Install (with automatic Atom config)

  1. Start up Atom

  2. Install the linter-autocomplete-jing package

  3. Type <kbd>⌘</kbd>+<kbd>,</kbd> (for Mac) to open Settings (or click Atom, Preferences… in the menu bar)

    1. Click Install in the left-hand-side

    2. Enter linter-autocomplete-jing and click Install

    3. Alternative: run apm install linter-autocomplete-jing from the commandline

  4. Run neb atom-config (NOTE: This will overwrite your Atom config file. If you’d prefer updating the config file yourself, see ‘Manual Atom config’ below.)

  5. Restart Atom

  6. Open an unzipped complete-zip. (I run atom ~/Downloads/col1234_complete From a terminal)

  7. Verify by opening an index.cnxml file and typing in <figure> somewhere in the file. You should see a red flag near the tag that says RNG: element "figure" missing required attribute "id".

Manual Atom config

This step is only necessary if you didn’t run neb atom-config above. After completing this step, resume the instructions above from the ‘Restart Atom’ step.

Add the following to your Atom configuration by clicking Atom, Config in the menu bar and copying and pasting the below (NOTE: indentation is important):

"*":
  core:
    customFileTypes:

      # Add this to the bottom of the customFileTypes area.
      # Note: Indentation is important!
      "text.xml": [
        "index.cnxml"
      ]


  # And then this to the bottom of the file
  # 1. Make sure "linter-autocomplete-jing" only occurs once in this file!
  # 1. make sure it is indented by 2 spaces just like it is in this example.

  "linter-autocomplete-jing":
    displaySchemaWarnings: true
    rules: [
      {
        priority: 1
        test:
          pathRegex: ".cnxml$"
        outcome:
          schemaProps: [
            {
              lang: "rng"
              path: "~/.neb/cnxml-validation/cnxml/xml/cnxml/schema/rng/0.7/cnxml-jing.rng"
            }
          ]
      }
    ]

License

This software is subject to the provisions of the GNU Affero General Public License Version 3.0 (AGPL). See LICENSE.txt for details. Copyright (c) 2016-2018 Rice University

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

nebuchadnezzar-9.6.0-py3-none-any.whl (99.5 kB view details)

Uploaded Python 3

File details

Details for the file nebuchadnezzar-9.6.0-py3-none-any.whl.

File metadata

  • Download URL: nebuchadnezzar-9.6.0-py3-none-any.whl
  • Upload date:
  • Size: 99.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.1

File hashes

Hashes for nebuchadnezzar-9.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46b27d05a6d6943d946f94cdbfa7c965842ab20008d2f27e9445af2988f7f63b
MD5 adfa1736e3d9fc10c6dcccfc14572813
BLAKE2b-256 0bca2235578c81ed250b4d0c47beaa737f8f79f0c21dfe3ea71ee61330b65597

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page