mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
enhance(dev): Add more publish docs
enable linter now that namespaces are documented
This commit is contained in:
5
.github/workflows/deps-publish.yml
vendored
5
.github/workflows/deps-publish.yml
vendored
@@ -97,6 +97,5 @@ jobs:
|
||||
- name: Lint for vars that are too large
|
||||
run: bb lint:large-vars
|
||||
|
||||
# TODO: Add docstrings
|
||||
# - name: Lint for namespaces that aren't documented
|
||||
# run: bb lint:ns-docstrings
|
||||
- name: Lint for namespaces that aren't documented
|
||||
run: bb lint:ns-docstrings
|
||||
12
deps/publish/README.md
vendored
12
deps/publish/README.md
vendored
@@ -1,6 +1,6 @@
|
||||
## Description
|
||||
|
||||
Shared library for page publishing (snapshot payloads, SSR helpers, shared schemas, and storage contracts).
|
||||
Shared library for page publish features (snapshot payloads, SSR helpers, shared schemas, and storage contracts).
|
||||
|
||||
The Cloudflare Durable Object implementation is expected to use SQLite with the
|
||||
Logseq datascript fork layered on top. Page publish payloads are expected to
|
||||
@@ -15,7 +15,7 @@ Namespaces live under `logseq.publish`.
|
||||
|
||||
## Usage
|
||||
|
||||
This module is intended to be consumed by the Logseq app and the publishing worker.
|
||||
This module is intended to be consumed by the Logseq app and the publish worker.
|
||||
|
||||
## Dev
|
||||
|
||||
@@ -29,10 +29,14 @@ linting examples.
|
||||
|
||||
For one-time setup, install the [CloudFlare cli wrangler](https://developers.cloudflare.com/workers/wrangler/) with `npm install -g wrangler@latest`.
|
||||
|
||||
To test the publish feature locally, follow these steps:
|
||||
To test the publish features locally, follow these steps:
|
||||
|
||||
* Run `yarn watch` or `yarn release` to build the publish worker js asset.
|
||||
* Run `wrangler dev` in worker/ to start a local cloudflare worker server.
|
||||
* In `frontend.config`, enable the commented out `PUBLISH-API-BASE` which points to a localhost url.
|
||||
* Login on the desktop app.
|
||||
* Go to any page and select `Publish` from its page menu.
|
||||
* Go to any page and select `Publish` from its page menu.
|
||||
|
||||
### Deploy
|
||||
|
||||
When changes are ready to be deployed, run `yarn deploy`.
|
||||
1
deps/publish/src/logseq/publish/assets.cljs
vendored
1
deps/publish/src/logseq/publish/assets.cljs
vendored
@@ -1,4 +1,5 @@
|
||||
(ns logseq.publish.assets
|
||||
"Handles publishing assets"
|
||||
(:require [clojure.string :as string]
|
||||
[logseq.publish.common :as publish-common])
|
||||
(:require-macros [logseq.publish.async :refer [js-await]]))
|
||||
|
||||
2
deps/publish/src/logseq/publish/async.clj
vendored
2
deps/publish/src/logseq/publish/async.clj
vendored
@@ -1,4 +1,4 @@
|
||||
(ns logseq.publish.async
|
||||
(ns ^:no-doc logseq.publish.async
|
||||
(:require [shadow.cljs.modern]))
|
||||
|
||||
(defmacro js-await
|
||||
|
||||
1
deps/publish/src/logseq/publish/common.cljs
vendored
1
deps/publish/src/logseq/publish/common.cljs
vendored
@@ -1,4 +1,5 @@
|
||||
(ns logseq.publish.common
|
||||
"Provides common util fns"
|
||||
(:require [clojure.string :as string]
|
||||
[cognitect.transit :as transit]
|
||||
[datascript.transit :as dt]
|
||||
|
||||
1
deps/publish/src/logseq/publish/index.cljs
vendored
1
deps/publish/src/logseq/publish/index.cljs
vendored
@@ -1,4 +1,5 @@
|
||||
(ns logseq.publish.index
|
||||
"Builds indices from payloads for features like tagged nodes"
|
||||
(:require [clojure.string :as string]
|
||||
[logseq.publish.model :as publish-model]))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
(ns logseq.publish.meta-store
|
||||
"Handles storing Durable Object in SQLite"
|
||||
(:require [clojure.string :as string]
|
||||
[logseq.publish.common :as publish-common])
|
||||
(:require-macros [logseq.publish.async :refer [js-await]]))
|
||||
|
||||
3
deps/publish/src/logseq/publish/model.cljs
vendored
3
deps/publish/src/logseq/publish/model.cljs
vendored
@@ -1,4 +1,5 @@
|
||||
(ns logseq.publish.model)
|
||||
(ns logseq.publish.model
|
||||
"Handles entity/model operations like conversion from datoms")
|
||||
|
||||
(defn merge-attr
|
||||
[entity attr value]
|
||||
|
||||
1
deps/publish/src/logseq/publish/render.cljs
vendored
1
deps/publish/src/logseq/publish/render.cljs
vendored
@@ -1,4 +1,5 @@
|
||||
(ns logseq.publish.render
|
||||
"Renders published content as HTML"
|
||||
(:require-macros [hiccups.core])
|
||||
(:require [clojure.string :as string]
|
||||
[hiccups.runtime]
|
||||
|
||||
1
deps/publish/src/logseq/publish/routes.cljs
vendored
1
deps/publish/src/logseq/publish/routes.cljs
vendored
@@ -1,4 +1,5 @@
|
||||
(ns logseq.publish.routes
|
||||
"Handles routing and responses for worker"
|
||||
(:require [cljs-bean.core :as bean]
|
||||
[clojure.string :as string]
|
||||
[logseq.publish.assets :as publish-assets]
|
||||
|
||||
1
deps/publish/src/logseq/publish/worker.cljs
vendored
1
deps/publish/src/logseq/publish/worker.cljs
vendored
@@ -1,4 +1,5 @@
|
||||
(ns logseq.publish.worker
|
||||
"Main public ns for worker"
|
||||
(:require ["cloudflare:workers" :refer [DurableObject]]
|
||||
[logseq.publish.meta-store :as meta-store]
|
||||
[logseq.publish.routes :as publish-routes]
|
||||
|
||||
6
deps/publish/worker/README.md
vendored
6
deps/publish/worker/README.md
vendored
@@ -34,6 +34,12 @@ metadata in a Durable Object backed by SQLite.
|
||||
- Deletes all pages for a graph
|
||||
- `GET /pages`
|
||||
- Lists metadata entries (from the index DO)
|
||||
- `GET /tag/:tag-name`
|
||||
- List all pages tagged with `:tag-name`
|
||||
- `GET /ref/:page-name`
|
||||
- List all pages that reference `:page-name`
|
||||
- `GET /user/:user-name`
|
||||
- List all pages for `:user-name`
|
||||
|
||||
### Notes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user