Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt typedoc for API docs #66

Merged
merged 17 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eleventyignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/contributing.md
**/contributing.md
API.md
1 change: 1 addition & 0 deletions API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Index page for the API documentation
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<header class="home no-home-link">

<img src="logo.svg" width="100" alt="Logo showing a cloud presented as a tree" />
<img src="/logo.svg" width="100" alt="Logo showing a cloud presented as a tree" />

<h1 class="logo"><span class="ma">ma</span>data</h1>

Expand Down
3 changes: 3 additions & 0 deletions api.postcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*
Custom CSS for the API docs goes here...
*/
11 changes: 6 additions & 5 deletions backends/basic/element.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/**
* Save in an HTML element
* @class Element
*/

import Backend from "../../src/backend.js";
import {$} from "../../src/util.js";

/**
* Read and write data into an HTML element.
* @class Element
* @extends Backend
* @category Basic
*/
export default class Element extends Backend {
constructor (url, o) {
super(url, o);
Expand Down
10 changes: 6 additions & 4 deletions backends/basic/local.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/**
* Store data in localStorage
* @class Local
*/
import Backend from "../../src/backend.js";
import { localStorage } from "../../src/node-shims.js";

/**
* Store data in the browser's localStorage.
* @class Local
* @extends Backend
* @category Basic
*/
export default class Local extends Backend {
constructor (url, o) {
super(url, o);
Expand Down
8 changes: 5 additions & 3 deletions backends/basic/remote.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import Backend from "../../src/backend.js";

/**
* Load the URL as a remote resource. No save.
* @class Remote
* Load from a remote URL, no save
* @extends Backend
* @category Basic
*/
import Backend from "../../src/backend.js";

export default class Remote extends Backend {
constructor (url, o) {
super(url, o);
Expand Down
5 changes: 5 additions & 0 deletions backends/coda/api/coda-api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import Coda from "../coda.js";

/**
* @class CodaAPI
* @extends Coda
* @category Coda
*/
export default class CodaAPI extends Coda {
async get (ref = this.ref) {
return this.request(ref.url);
Expand Down
5 changes: 3 additions & 2 deletions backends/coda/coda.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import OAuthBackend from "../../src/oauth-backend.js";

/**
* @class Coda
* @extends OAuthBackend
* @category Coda
*/
import OAuthBackend from "../../src/oauth-backend.js";

export default class Coda extends OAuthBackend {
constructor (url, o) {
super(url, o);
Expand Down
5 changes: 5 additions & 0 deletions backends/coda/table/coda-table.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import Coda from "../coda.js";

/**
* @class CodaTable
* @extends Coda
* @category Coda
*/
export default class CodaTable extends Coda {
async get (ref = this.ref) {
if (!ref.tableId) {
Expand Down
5 changes: 3 additions & 2 deletions backends/dropbox/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import OAuthBackend from "../../src/oauth-backend.js";

/**
* Dropbox backend.
* @class Dropbox
* @extends OAuthBackend
*/
import OAuthBackend from "../../src/oauth-backend.js";

export default class Dropbox extends OAuthBackend {
static apiDomain = "https://api.dropboxapi.com/2/";
static oAuth = "https://www.dropbox.com/oauth2/authorize";
Expand Down
10 changes: 5 additions & 5 deletions backends/firebase/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* Firebase backend.
* @class Firebase
* @extends OAuthBackend
*/
import AuthBackend from "../../src/auth-backend.js";
import { readFile, toArray } from "../../src/util.js";

Expand All @@ -11,6 +6,11 @@ import { getAuth, onAuthStateChanged, signInWithPopup, signOut, GoogleAuthProvid
import { getFirestore, doc, collection, getDoc, getDocs, setDoc, addDoc, deleteDoc } from "https://www.gstatic.com/firebasejs/10.5.0/firebase-firestore-lite.js";
import { getStorage, ref, uploadString, getDownloadURL, deleteObject } from "https://www.gstatic.com/firebasejs/10.5.0/firebase-storage.js";

/**
* Firebase backend.
* @class Firebase
* @extends OAuthBackend
*/
export default class Firebase extends AuthBackend {
constructor (url, o) {
super(url, o);
Expand Down
6 changes: 6 additions & 0 deletions backends/github/api/github-api.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import Github from "../github.js";
// import hooks from "../../../src/hooks.js";

/**
* Backend for performing raw API calls with the REST or GraphQL API to GitHub repositories.
* @class GithubAPI
* @extends Github
* @category GitHub
*/
export default class GithubAPI extends Github {
update (url, o) {
super.update(url, o);
Expand Down
10 changes: 6 additions & 4 deletions backends/github/file/github-file.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/**
* @class GithubFile
* @extends Github
*/
import Github from "../github.js";
import hooks from "../../../src/hooks.js";
import {readFile, delay} from "../../../src/util.js";

/**
* Backend for reading and writing data and uploading files in GitHub repositories.
* @class GithubFile
* @extends Github
* @category GitHub
*/
export default class GithubFile extends Github {
static fileBased = true;

Expand Down
9 changes: 5 additions & 4 deletions backends/github/gist/github-gist.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import Github from "../github.js";
import hooks from "../../../src/hooks.js";

/**
* Github Gist backend
* Github Gist backend.
* @class GithubGist
* @extends Github
* @category GitHub
*/
import Github from "../github.js";
import hooks from "../../../src/hooks.js";

export default class GithubGist extends Github {
async get (file = this.ref) {
if (this.isAuthenticated()) {
Expand Down
6 changes: 4 additions & 2 deletions backends/github/github.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import OAuthBackend from "../../src/oauth-backend.js";

/**
* Base class for all Github backends, containing auth methods.
* @class Github
* @extends OAuthBackend
* @category GitHub
*/
import OAuthBackend from "../../src/oauth-backend.js";

export default class Github extends OAuthBackend {
constructor (url, o) {
super(url, o);
Expand Down
5 changes: 3 additions & 2 deletions backends/google/calendar/google-calendar.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Google from "../google.js";

/**
* Google Calendar backend. Read-only for now.
* @class GoogleCalendar
* @extends Google
* @category Google
*/
import Google from "../google.js";

export default class GoogleCalendar extends Google {
async get (ref = this.ref) {
let call = `${ref.calendarId}/events?key=${this.apiKey}`;
Expand Down
6 changes: 4 additions & 2 deletions backends/google/drive/google-drive.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import Google from "../google.js";

/**
* Google Drive backend.
* @class GoogleDrive
* @extends Google
* @category Google
*/
import Google from "../google.js";

export default class GoogleDrive extends Google {
static apiDomain = "https://www.googleapis.com/";
static scopes = ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/userinfo.email"];
Expand Down
7 changes: 4 additions & 3 deletions backends/google/google.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import OAuthBackend from "../../src/oauth-backend.js";

/**
* Base class for all Google backends, containing auth methods
* Base class for all Google backends, containing auth methods.
* @class Google
* @extends OAuthBackend
* @category Google
*/
import OAuthBackend from "../../src/oauth-backend.js";

export default class Google extends OAuthBackend {
constructor (url, o) {
super(url, o);
Expand Down
5 changes: 3 additions & 2 deletions backends/google/sheets/google-sheets.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Google from "../google.js";

/**
* Google Sheets backend.
* @class GoogleSheets
* @extends Google
* @category Google
*/
import Google from "../google.js";

export default class GoogleSheets extends Google {
/**
* Read data from the spreadsheet.
Expand Down
2 changes: 1 addition & 1 deletion backends/index-fn.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Export all backends without side effects.
* @module index-fn
* Export all backends without side effects
*/

export * from "./basic/index.js";
Expand Down
4 changes: 2 additions & 2 deletions backends/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @module index
* Export all backends and register them
* Export all backends and register them.
* @module Backends
*/
import Backend from "../src/backend.js";
import * as backends from "./index-fn.js";
Expand Down
4 changes: 4 additions & 0 deletions formats/csv/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import Format from "../../src/format.js";
import { parse, stringify } from "../../lib/csv/dist/esm/sync.js";

/**
* @class CSV
* @extends Format
*/
export default class CSV extends Format {
static defaultOptions = {
parse: {
Expand Down
2 changes: 1 addition & 1 deletion formats/index-fn.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Export all formats without side effects.
* @module formats/index-fn
* Export all formats without side effects
*/

export {default as JSON} from "./json/index.js";
Expand Down
4 changes: 2 additions & 2 deletions formats/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @module formats/index
* Export all formats and register them
* Export all formats and register them.
* @module Formats
*/
import Format from "../src/format.js";
import * as formats from "./index-fn.js";
Expand Down
4 changes: 4 additions & 0 deletions formats/json/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import Format from "../../src/format.js";

/**
* @class JSON
* @extends Format
*/
export default class JSON extends Format {
static defaultOptions = {
stringify: {
Expand Down
4 changes: 4 additions & 0 deletions formats/text/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import Format from "../../src/format.js";

/**
* @class Text
* @extends Format
*/
export default class Text extends Format {
static extensions = ["txt", "md"];
static mimeTypes = ["text/plain"];
Expand Down
4 changes: 4 additions & 0 deletions formats/yaml/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import Format from "../../src/format.js";
import { parse, stringify } from "../../lib/yaml/browser/index.js";

/**
* @class YAML
* @extends Format
*/
export default class YAML extends Format {
static extensions = ["yaml", "yml"];
static mimeTypes = ["application/yaml", "application/x-yaml", "text/yaml"];
Expand Down
Loading