npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mitodl/ocw-to-hugo

v1.47.0

Published

A command line utility for taking master.json output from ocw-data-parser and producing markdown for use with hugo-course-publisher

Downloads

352

Readme

ocw-to-hugo

Installation

These examples demonstrate installing ocw-to-hugo globally, as it is designed to be a command line utility that can be run from anywhere in the system. However, you may omit the global flag if you wish to install it into another project.

From source

$ cd ~/path/to/temp/dir
$ git clone [email protected]:mitodl/ocw-to-hugo.git
$ cd ocw-to-hugo
$ npm install -g .

From npm

$ npm install -g @mitodl/ocw-to-hugo

Usage

$ ocw-to-hugo -c <courses.json location> --download -i <input directory> -o <output directory>

This utility optionally takes a JSON file of OCW course ID's. Various examples of this can be found in the course_json_examples folder, but generally it is formatted as:

{
    "courses": [
        "12-001-introduction-to-geology-fall-2013",
        "14-01sc-principles-of-microeconomics-fall-2011"
    ]
}

If the -c option has been specified, processing will be filtered by the courses specified in the format above. If the --download flag is set, the courses listed will first be downloaded from AWS to the input directory specified with -i. When downlading courses, ocw-to-hugo automatically determines if it needs to re-download a file by comparing dates. If --download is not set, the source for the courses specified in the JSON must already exist in the input directory. If any of the courses are not there, an error will be thrown. If you wish to simply process an input directory of courses without downloading or filtering, use only the -i and -o arguments.

Arguments

| Argument | Required? | Valid values | Description | | :------- | :-------- | :------------ | :------------ | | -i, --input | Yes | /path/to/open-learning-course-data | Input folder of OCW course folders containing parsed.json files and optionally static content | | -o, --output | Yes | /path/to/hugo-markdown-output | Output path to place processed courses in | | -c, --courses | Only if download flag is true | /path/to/courses.json | If enabled, courses processed will be filtered based on the format above | | --download | No | true or false | Download parsed.json files from a configured S3 bucket and a list of courses passed in with -c | | --strips3 | No | true or false | Strip the s3 base URL from all OCW resources | | --staticPrefix | No | /path/to/static/assets | When --strips3 is set to true, replace the s3 base URL with this string | | --rm | No | true or false | Clear the contents of the path passed with -o before the conversion run |

Environment Variables

| Variable | Description | | :------- | :------------ | | AWS_REGION | The AWS region to connect to, i.e. us-east-1 | | AWS_BUCKET_NAME | The bucket to use, i.e. open-learning-course-data-ci | | AWS_ACCESS_KEY | Your AWS Access Key with access to said bucket | | AWS_SECRET_ACCESS_KEY | The secret access key that pairs with your access key |