Commit dc2924da authored by greg@1m's avatar greg@1m
Browse files

updating api doc

parent 71ea3e68
......@@ -2,9 +2,9 @@
An open-source, cross-platform markdown editor designed for extensibility & flexibility
🌐 website| 📘 documentation| ⬇️ downloads| 💬 forum | 📢 news|
-|-|-|-|-
[tiro-notes.org](https://dotgreg.github.io/tiro-notes)|[guides](https://dotgreg.github.io/tiro-notes/#/guide-custom-tags)|[download page](https://dotgreg.github.io/tiro-notes/#/downloads)|[forum](https://github.com/dotgreg/tiro-notes/discussions)|[twitter](https://twitter.com/NotesTiro)|
🌐 website| 📘 guides| ⬇️ downloads| 💬 forum | 📢 news| Version |
-|-|-|-|-|-
[tiro-notes.org](https://tiro-notes.org)|[guides](https://tiro-notes.org/#/guide-custom-tags)|[download](https://tiro-notes.org/#/downloads)|[forum](https://github.com/dotgreg/tiro-notes/discussions)|[twitter](https://twitter.com/NotesTiro)| 0.30 (beta)
![Tiro 0.30](https://user-images.githubusercontent.com/2981891/171833721-2acdc59d-8c21-4280-bd62-a78023731c22.png)
......@@ -12,9 +12,9 @@ An open-source, cross-platform markdown editor designed for extensibility & flex
Tiro Notes focus points are :
- 🏋 **Extensibility** : Tiro Notes uses a system of custom tags to extend its capabilities :
- Add [```[[latex]]```](https://dotgreg.github.io/tiro-notes/#/custom-tags?id=latex), [```[[uml]]```](https://dotgreg.github.io/tiro-notes/#/custom-tags?id=mermaid) or [```[[charts]]```](https://dotgreg.github.io/tiro-notes/#/custom-tags?id=mermaid), preview your pdf, mp4 or youtube links using [```[[view]]```](https://dotgreg.github.io/tiro-notes/#/custom-tags?id=view). Add [```[[spreadsheet]]```](https://dotgreg.github.io/tiro-notes/#/custom-tags?id=spreadsheet) logic to your markdown tables.
- Use Tiro as an app platform with a [```[[rss]]```](https://dotgreg.github.io/tiro-notes/#/custom-tags?id=rss) reader or a [```[[calendar]]```](https://dotgreg.github.io/tiro-notes/#/custom-tags?id=calendar) in it.
- [Create your own custom tags](https://dotgreg.github.io/tiro-notes/#/guide-custom-tags) and use the [Client API](https://dotgreg.github.io/tiro-notes/#/guide-custom-tags?id=using-tiro-client-api).
- Add [```[[latex]]```](https://tiro-notes.org/#/custom-tags?id=latex), [```[[uml]]```](https://tiro-notes.org/#/custom-tags?id=mermaid) or [```[[charts]]```](https://tiro-notes.org/#/custom-tags?id=mermaid), preview your pdf, mp4 or youtube links using [```[[view]]```](https://tiro-notes.org/#/custom-tags?id=view). Add [```[[spreadsheet]]```](https://tiro-notes.org/#/custom-tags?id=spreadsheet) logic to your markdown tables.
- Use Tiro as an app platform with a [```[[rss]]```](https://tiro-notes.org/#/custom-tags?id=rss) reader or a [```[[calendar]]```](https://tiro-notes.org/#/custom-tags?id=calendar) in it.
- [Create your own custom tags](https://tiro-notes.org/#/guide-custom-tags) and use the [Client API](https://tiro-notes.org/#/guide-custom-tags?id=using-tiro-client-api).
- 🎛️ **Flexibility** : multi-window interface to create a custom workspace. Create multiple workspaces organized by tabs. Keep these workspaces synced accross your devices.
......
import { tu } from '../../__tests__/testsUtils'
import { noteApi } from '../renderNote.manager';
import { noteApiFuncs } from '../renderNote.manager';
test('contentChunk : first el should be a tag', () => {
// const chunks = noteApi.chunks.get(textSeveralOneTag, true)
const chunks = noteApi.chunks.chunk(t2)
const chunks = noteApiFuncs.chunks.chunk(t2)
expect(chunks[0].type).toEqual("tag");
});
test('contentChunk : first el should be a text', () => {
// const chunks = noteApi.chunks.chunk(textSeveralOneTag, true)
const chunks = noteApi.chunks.chunk("starting text" + t2)
const chunks = noteApiFuncs.chunks.chunk("starting text" + t2)
expect(chunks[0].type).toEqual("text");
});
test('contentChunk : several unclosed tags => list nb', () => {
// const chunks = noteApi.chunks.chunk(textSeveralOneTag, true)
const chunks = noteApi.chunks.chunk(textSeveralOneTag)
const chunks = noteApiFuncs.chunks.chunk(textSeveralOneTag)
expect(chunks.length).toEqual(3);
});
test('contentChunk : one unclosed tags => output length', () => {
const chunks = noteApi.chunks.chunk(textOneTag)
const chunks = noteApiFuncs.chunks.chunk(textOneTag)
expect(chunks[0].content.length).toEqual(textOneTag.length);
});
......@@ -32,12 +29,12 @@ test('contentChunk : one unclosed tags => output length', () => {
test('contentChunk : no tags', () => {
const chunks = noteApi.chunks.chunk(textNoTags)
const chunks = noteApiFuncs.chunks.chunk(textNoTags)
expect(chunks.length).toEqual(1);
});
test('contentChunk : no tags => content size check', () => {
const chunks = noteApi.chunks.chunk(textNoTags)
const chunks = noteApiFuncs.chunks.chunk(textNoTags)
expect(chunks[0].content.length).toEqual(textNoTags.length);
});
......@@ -46,12 +43,12 @@ test('contentChunk : no tags => content size check', () => {
test('contentChunk : length result', () => {
const chunks = noteApi.chunks.chunk(t1)
const chunks = noteApiFuncs.chunks.chunk(t1)
expect(chunks.length).toEqual(13);
});
test('contentChunk : last object', () => {
const chunks = noteApi.chunks.chunk(t1)
const chunks = noteApiFuncs.chunks.chunk(t1)
expect(tu.equalObj(
chunks[chunks.length - 1],
{ type: 'text', content: '\n\n\nOUT8\nOUT9\n', start: 16, end: 17 }
......
......@@ -174,40 +174,6 @@ noteLink should be relative from tiro folder
## Api.call : note
#### <span class="render-code-wrapper">note.chunks.chunk</span>
- Type: <span class="render-code-wrapper">Function</span>
- Parameters:
1. fileContent: <span class="render-code-wrapper">string</span>
- Result: <span class="render-code-wrapper"><span class="render-code-wrapper"><a href="#client-api?id=icontentchunk">iContentChunk</a></span>[]</span>
- Example:
<div class="render-code-wrapper">api.call(<br/>&nbsp;&nbsp;&nbsp;"note.chunks.chunk",<br/>&nbsp;&nbsp;&nbsp; [<span class="render-code-wrapper">string</span> ], <br/>(res:<span class="render-code-wrapper"><span class="render-code-wrapper"><a href="#client-api?id=icontentchunk">iContentChunk</a></span>[]</span>) => {}<br/>)</div>
#### <span class="render-code-wrapper">note.chunks.merge</span>
- Type: <span class="render-code-wrapper">Function</span>
- Parameters:
1. chunks: <span class="render-code-wrapper"><span class="render-code-wrapper"><a href="#client-api?id=icontentchunk">iContentChunk</a></span>[]</span>
- Result: <span class="render-code-wrapper">string</span>
- Example:
<div class="render-code-wrapper">api.call(<br/>&nbsp;&nbsp;&nbsp;"note.chunks.merge",<br/>&nbsp;&nbsp;&nbsp; [<span class="render-code-wrapper"><span class="render-code-wrapper"><a href="#client-api?id=icontentchunk">iContentChunk</a></span>[]</span> ], <br/>(res:<span class="render-code-wrapper">string</span>) => {}<br/>)</div>
#### <span class="render-code-wrapper">note.render</span>
- Type: <span class="render-code-wrapper">Function</span>
- Parameters:
1. p: <span class="render-code-wrapper">{<br/>&nbsp;&nbsp;&nbsp;file: <span class="render-code-wrapper"><a href="#client-api?id=ifile">iFile</a></span>, <br/>&nbsp;&nbsp;&nbsp;raw: <span class="render-code-wrapper">string</span>, <br/>&nbsp;&nbsp;&nbsp;windowId: <span class="render-code-wrapper">string</span><br/>}</span>
- Result: <span class="render-code-wrapper">string</span>
- Example:
<div class="render-code-wrapper">api.call(<br/>&nbsp;&nbsp;&nbsp;"note.render",<br/>&nbsp;&nbsp;&nbsp; [<span class="render-code-wrapper">{<br/>&nbsp;&nbsp;&nbsp;file: <span class="render-code-wrapper"><a href="#client-api?id=ifile">iFile</a></span>, <br/>&nbsp;&nbsp;&nbsp;raw: <span class="render-code-wrapper">string</span>, <br/>&nbsp;&nbsp;&nbsp;windowId: <span class="render-code-wrapper">string</span><br/>}</span> ], <br/>(res:<span class="render-code-wrapper">string</span>) => {}<br/>)</div>
## Api.call : popup
......@@ -225,9 +191,9 @@ noteLink should be relative from tiro folder
#### <span class="render-code-wrapper">popup.prompt</span>
- Type: <span class="render-code-wrapper">Function</span>
- Parameters:
1. p: <span class="render-code-wrapper">{<br/>&nbsp;&nbsp;&nbsp;text: <span class="render-code-wrapper">string</span>, <br/>&nbsp;&nbsp;&nbsp;onAccept?: <span class="render-code-wrapper">Function</span>, <br/>&nbsp;&nbsp;&nbsp;onRefuse?: <span class="render-code-wrapper">Function</span>, <br/>&nbsp;&nbsp;&nbsp;title?: <span class="render-code-wrapper">string</span><br/>}</span>
1. p: <span class="render-code-wrapper">{<br/>&nbsp;&nbsp;&nbsp;text: <span class="render-code-wrapper">string</span>, <br/>&nbsp;&nbsp;&nbsp;onAccept?: <span class="render-code-wrapper">Function</span>, <br/>&nbsp;&nbsp;&nbsp;onRefuse?: <span class="render-code-wrapper">Function</span>, <br/>&nbsp;&nbsp;&nbsp;title?: <span class="render-code-wrapper">string</span>, <br/>&nbsp;&nbsp;&nbsp;userInput?: <span class="render-code-wrapper">boolean</span><br/>}</span>
- Example:
<div class="render-code-wrapper">api.call(<br/>&nbsp;&nbsp;&nbsp;"popup.prompt",<br/>&nbsp;&nbsp;&nbsp; [<span class="render-code-wrapper">{<br/>&nbsp;&nbsp;&nbsp;text: <span class="render-code-wrapper">string</span>, <br/>&nbsp;&nbsp;&nbsp;onAccept?: <span class="render-code-wrapper">Function</span>, <br/>&nbsp;&nbsp;&nbsp;onRefuse?: <span class="render-code-wrapper">Function</span>, <br/>&nbsp;&nbsp;&nbsp;title?: <span class="render-code-wrapper">string</span><br/>}</span> ]<br/>)</div>
<div class="render-code-wrapper">api.call(<br/>&nbsp;&nbsp;&nbsp;"popup.prompt",<br/>&nbsp;&nbsp;&nbsp; [<span class="render-code-wrapper">{<br/>&nbsp;&nbsp;&nbsp;text: <span class="render-code-wrapper">string</span>, <br/>&nbsp;&nbsp;&nbsp;onAccept?: <span class="render-code-wrapper">Function</span>, <br/>&nbsp;&nbsp;&nbsp;onRefuse?: <span class="render-code-wrapper">Function</span>, <br/>&nbsp;&nbsp;&nbsp;title?: <span class="render-code-wrapper">string</span>, <br/>&nbsp;&nbsp;&nbsp;userInput?: <span class="render-code-wrapper">boolean</span><br/>}</span> ]<br/>)</div>
......@@ -391,6 +357,18 @@ noteLink should be relative from tiro folder
<div class="render-code-wrapper">api.call(<br/>&nbsp;&nbsp;&nbsp;"ui.lightbox.open",<br/>&nbsp;&nbsp;&nbsp; [<span class="render-code-wrapper">number</span>, <span class="render-code-wrapper">"undefined" | "undefined"</span> ]<br/>)</div>
#### <span class="render-code-wrapper">ui.note.lineJump.get.line</span>
- Type: <span class="render-code-wrapper">number</span>
- Example:
<div class="render-code-wrapper">api.call("ui.note.lineJump.get.line", [], (res:number) => {})</div>
#### <span class="render-code-wrapper">ui.note.lineJump.get.windowId</span>
- Type: <span class="render-code-wrapper">string</span>
- Example:
<div class="render-code-wrapper">api.call("ui.note.lineJump.get.windowId", [], (res:string) => {})</div>
#### <span class="render-code-wrapper">ui.search.term.get</span>
- Type: <span class="render-code-wrapper">string</span>
- Example:
......@@ -537,12 +515,6 @@ noteLink should be relative from tiro folder
<div class="render-code-wrapper"><span class="render-code-wrapper">{<br/>&nbsp;&nbsp;&nbsp;content: <span class="render-code-wrapper">string</span>, <br/>&nbsp;&nbsp;&nbsp;path: <span class="render-code-wrapper">string</span>, <br/>&nbsp;&nbsp;&nbsp;picture?: <span class="render-code-wrapper">string</span><br/>}</span></div>
#### <span class="render-code-wrapper">iContentChunk</span>
- Type: <span class="render-code-wrapper">object</span>
- Details:
<div class="render-code-wrapper"><span class="render-code-wrapper">{<br/>&nbsp;&nbsp;&nbsp;content: <span class="render-code-wrapper">string</span>, <br/>&nbsp;&nbsp;&nbsp;end: <span class="render-code-wrapper">number</span>, <br/>&nbsp;&nbsp;&nbsp;start: <span class="render-code-wrapper">number</span>, <br/>&nbsp;&nbsp;&nbsp;type: <span class="render-code-wrapper">"text" | "tag"</span>, <br/>&nbsp;&nbsp;&nbsp;tagName?: <span class="render-code-wrapper">string</span><br/>}</span></div>
#### <span class="render-code-wrapper">iSearchWordRes</span>
- Type: <span class="render-code-wrapper">object</span>
- Details:
......
This diff is collapsed.
{
"name": "tiro-notes",
"version": "0.30.40-dev",
"version": "0.30.41-dev",
"description": "Tiro Notes CLI to start Tiro Notes from the command line!",
"scripts": {
"dev": "ISDEV=true node cli.js",
......
......@@ -30,7 +30,7 @@ export const sharedConfig = {
eventManager: true,
upload: false,
},
version: '0.30.3',
version: '0.30.4',
params: {
previewArea: {
scrollSpeed: 1.3
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment