Giter VIP home page Giter VIP logo

fargopublisher's Introduction

What is Fargo Publisher?

Fargo Publisher is a node.js app that connects to Fargo to publish a folder of HTML docs.

Fargo 2, released in February 2014, has a new built-in content management system that creates static HTML files. All that's needed is a way to flow those files to a static HTTP server. That's what Fargo Publisher does.

It defines an open protocol that any app can use to connect to static storage, no matter where the content originates. This implementation stores the files in Amazon S3, but a fork of this project could store them in files, or in another content server.

It's open source, using the MIT License.

This document includes information you need to install a server, and technical information for implementers.

How names work

Each outline can be given a public name.

Rather than invent our own naming system, we're using the Internet's -- DNS.

So if I call my outline "dave" -- you can refer to it as dave.smallpict.com.

When you go to that address, you get the rendered content.

There's only one element of the <head> section of that outline that we care about, <linkHosting>. It's automatically maintained by Fargo.

The rest of the outline contents is up to the user.

User experience (set up)

The Fargo user brings the outline he or she wants to make public to the front.

Choose the Name Outline command in the File menu.

A dialog appears.

Type a name. As you type the software tells you whether the name is taken. It does this with a call to Fargo Publisher.

When you click OK, a message is sent to Fargo Publisher to associate that name with the public URL of the outline. Getting a public URL for a file is a feature of Dropbox.

User experience (publishing)

When the user publishes an outline, or a portion of an outline, it could cause many files to be rendered.

The text of those files is saved to a package file, which is linked into the user's outline, automatically by the CMS.

When the text is fully rendered, it sends a message to the Publisher server with the name of the outline.

Publisher then reads the outline (it was registered in the previous step) locates the package file, reads it, breaks the package up into its component files and saves them to the user's folder in the S3 bucket.

Publisher sends back to Fargo the base URL of the folder, which is then hooked into the Eye icon, which can be used to view the headline the cursor points to.

User experience (viewing rendered content)

The Eye icon in the left margin of Fargo is super-important.

It connects the editing context with the viewing context.

Put the cursor on any headline in a public outline, and click the Eye.

A new tab opens with the rendered view of that section of the outline.

Before deploy

You're going to need to make a few decisions before you deploy.

  1. The user files will be stored in an S3 bucket. There is an S3 path for that location. What should it be?

  2. Where do you want to store the FP data? This includes information about the user's outlines, and stats generated by Fargo Publisher. It's also an S3 path. You might not want this to be public, although there is no personal information stored about the user outlines. It's all designed for publishing. These are public outlines, by definition.

  3. What domain for the user names? You have to own the domain and the DNS should point to the node server so it can redirect to the user's content when subdomains are accessed.

  4. What port do you want the server to run on? If you don't specify it, the server will boot on port 80.

  5. Do you want Fargo Publisher to redirect to the content or serve it directly? (The default is to redirect.)

For my deployment I went with (Unix shell commands):

     1. export fpHostingPath=/beta.fargo.io/users/

     2. export fpDataPath=/beta.fargo.io/data/

     3. export fpDomain=smallpict.com

     4. export fpServerPort=80

     5. export fpRedirect=false

How to deploy

You must have a current node.js installation.

Install request, AWS and if necessary url.

Set environment variables for AWS.

     AWS_ACCESS_KEY_ID

     AWS_SECRET_ACCESS_KEY

Set environment variables with your S3 paths and the domain you're using.

     fpHostingPath -- where the users' files will be stored.

     fpDataPath -- where you want names and stats to be stored.

     fpDomain -- the domain we're allocating.

The app is in package.js. package.json already contains all the info that node needs to run it.

Heroku howto

I'm running my server on Heroku, and with the help of Eric Kidd, have written a howto specific for that service.

Notes

There's a folder of OPML files in the repository that contains the outlines that the JavaScript and Markdown come from.

We use the MIT License. Nothing proprietary about the protocol or the code. You are encouraged to clone, innovate, enjoy.

I love programming in this mode. The tools are great, and node is a wonderful environment, made that way by programmers who share their work so generously. The quality of the work is very impressive. And the commitment to no breakage also refreshing in this day and age.

Thanks to Brent Simmons for his Hello World server example. It helped this node newbie get started. He says his example is for Cocoa developers, but that's not true. I understood it, and I've never written a line of Cocoa in my life, and think it's a silly name for a programming environment. ;-)

fargopublisher's People

Contributors

scripting avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar Peter A. McKay avatar  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.