add priorities to all space-lua scripts in Std (#1992)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
Adds commands and an action button (on mobile) for toggling read-only mode.
|
||||
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
function toggleReadOnlyMode()
|
||||
local ro = editor.getUiOption("forcedROMode")
|
||||
ro = not ro
|
||||
|
||||
@@ -6,6 +6,7 @@ Implements utilities for working with Markdown tables
|
||||
## Commands
|
||||
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
command.define {
|
||||
name = "Table: Format",
|
||||
run = function()
|
||||
@@ -24,6 +25,7 @@ command.define {
|
||||
## Implementation
|
||||
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
-- Find outermost node of given type that contains the position
|
||||
-- similar to plug-api/lib/tree.ts nodeAtPos
|
||||
function nodeParentOfType(tree, position, nodeType)
|
||||
@@ -45,6 +47,7 @@ end
|
||||
```
|
||||
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
function formatMarkdownTable(tree)
|
||||
|
||||
-- First find the desired length for each column
|
||||
|
||||
@@ -5,6 +5,7 @@ tags: meta
|
||||
Defined via [[^Library/Std/APIs/Tag]].
|
||||
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
local function readOnlyType(type)
|
||||
return {
|
||||
type = type,
|
||||
@@ -362,4 +363,4 @@ tag.define {
|
||||
},
|
||||
}
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
@@ -18,6 +18,7 @@ Flow:
|
||||
|
||||
# Implementation
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
command.define {
|
||||
name = "Export: Page Or Selection",
|
||||
key = "Ctrl-e",
|
||||
@@ -52,6 +53,7 @@ Implements two exporters:
|
||||
* Copy clean markdown
|
||||
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
service.define {
|
||||
selector = "export",
|
||||
match = {
|
||||
|
||||
@@ -63,6 +63,7 @@ config.define("github", {
|
||||
|
||||
## Github Repo Files
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
-- returns (something/bla, branch, path)
|
||||
function github.extractData(url)
|
||||
if url == nil then
|
||||
@@ -297,6 +298,7 @@ service.define {
|
||||
|
||||
## Gists
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
local function extractGistId(url)
|
||||
if not url:startsWith("https://gist.github.com/") then
|
||||
return nil
|
||||
|
||||
@@ -5,6 +5,7 @@ tags: meta
|
||||
A work-in-progress library of generally useful templates for rendering queries.
|
||||
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
-- Renders a page object as a linked list item
|
||||
templates.pageItem = template.new([==[
|
||||
* [[${name}]]
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
# Implementation
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
share = {}
|
||||
|
||||
local shareSchema = {
|
||||
|
||||
@@ -31,6 +31,7 @@ ${query[[
|
||||
# Implementation
|
||||
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
tag.define {
|
||||
name = "meta/template/slash",
|
||||
schema = {
|
||||
|
||||
@@ -5,6 +5,7 @@ tags: meta
|
||||
|
||||
# Implementation
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
-- Virtual page (uri:URI)
|
||||
virtualPage.define {
|
||||
pattern = "uri:.+",
|
||||
|
||||
@@ -59,6 +59,7 @@ config.define("journal", {
|
||||
# API
|
||||
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
function journal.openOrCreate(dateStr)
|
||||
local pageName = config.get("journal.prefix") .. dateStr
|
||||
if space.pageExists(pageName) then
|
||||
|
||||
@@ -16,6 +16,7 @@ ${embed.vimeo "https://vimeo.com/1084537"}
|
||||
|
||||
# Implementation
|
||||
```space-lua
|
||||
-- priority: 10
|
||||
-- Schema
|
||||
local embedVideoSpecSchema = {
|
||||
type = "object",
|
||||
|
||||
Reference in New Issue
Block a user