git clone ⇒ page creation

TL;DR: Rough idea: make it possible to interact with Encycla by entirely using the git workflow.

  1. User is cloning the yet non-existant page @user/Page_name.
  2. The clone contains the skeleton files content.md, CONTRIBUTORS.yml, et cetera.
  3. User edits content.md, commits their changes, then pushes the local commit(s) back to Encycla.
  4. The page /@user/Page_name is now visible on Encycla.

Authentication — whether by username/password, certificate, or ssh-key — is a necessity in order to prevent spoofing.

I don't know how Encycla works behind the curtains, but perhaps it is easier to implement git interactions via two protocols:

  1. git clone https://encycla.com/*
    • User can clone whichever page from Encycla they want.
    • User can only clone already existant pages.
  2. git clone ssh://encycla.com/@user/*
    • User can only clone pages in their own name space.
    • Cloning a non-existant page will “create” the page as a draft and populate the local directory with the necessary skeleton files, as per the initial description.

Would that work?

PS: If it's easier, implementation-wise, to just let the user clone an empty directory, I'm not opposed to a separate CLI utility that can populate said directory with the necessary skeleton files, but from a usability perspective it would be better if a newly cloned directory/page is automatically populated with the necessary files in the right format. Once it is implemented, such files need only to be maintained in one place, rather than also maintaining a separate CLI utility.

That way the user only needs git and their favourite editor, as their is no need to install a separate “repo populator” utility.

Comments

This is a really fantastic idea! I went ahead and implemented it, some details here: Encycla Git Documentation. -philipn

It's fantastic that you liked the idea and implemented it! :) —kas