Skip to content

Commit 3d1fa66

Browse files
authored
Merge pull request #213 from orgapp/editor
Editor!
2 parents 8af3941 + 4d8efbb commit 3d1fa66

File tree

120 files changed

+6728
-4606
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+6728
-4606
lines changed

.changeset/tidy-boxes-hug.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
'gatsby-transformer-orga': minor
3+
'gatsby-plugin-orga': minor
4+
'@orgajs/example-next-app-dir': minor
5+
'@orgajs/getting-started': minor
6+
'@orgajs/cm-lang': minor
7+
'oast-to-prose': minor
8+
'oast-to-hast': minor
9+
'@orgajs/rehype-latex': minor
10+
'@orgajs/reorg-rehype': minor
11+
'@orgajs/reorg-parse': minor
12+
'@orgajs/reorg-prose': minor
13+
'@orgajs/estree-jsx': minor
14+
'orga-posts': minor
15+
'@orgajs/playground': minor
16+
'@orgajs/metadata': minor
17+
'text-kit': minor
18+
'@orgajs/example-webpack': minor
19+
'@orgajs/example-editor': minor
20+
'@orgajs/editor': minor
21+
'@orgajs/loader': minor
22+
'@orgajs/rollup': minor
23+
'@orgajs/astro': minor
24+
'@orgajs/lezer': minor
25+
'@orgajs/react': minor
26+
'@orgajs/reorg': minor
27+
'@orgajs/example-next': minor
28+
'@orgajs/next': minor
29+
'orga': minor
30+
'@orgajs/orgx': minor
31+
'website': minor
32+
---
33+
34+
Add increamental parsing ability for the editor.

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ insert_final_newline = true
99
[vcbuild.bat]
1010
end_of_line = crlf
1111

12-
[*.{js,cjs,mjs,jsx,ts,tsx,css,json,astro}]
12+
[*.{js,cjs,mjs,jsx,ts,tsx,css,json,astro,html}]
1313
indent_style = space
1414
indent_size = 2
1515

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Use Node.js
2323
uses: actions/setup-node@v3
2424
with:
25-
node-version: 18.x
25+
node-version: 20.x
2626
- uses: pnpm/action-setup@v2
2727
with:
2828
version: 8.x.x

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2020
fetch-depth: 0
2121

22-
- name: Setup Node.js 18.x
22+
- name: Setup Node.js 20.x
2323
uses: actions/setup-node@v3
2424
with:
25-
node-version: 18.x
25+
node-version: 20.x
2626

2727
- uses: pnpm/action-setup@v2
2828
with:

examples/editor/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

examples/editor/content.org

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#+title: Example Org File
2+
#+author: TEC
3+
#+date: 2020-10-27
4+
5+
Org uses single characters to markup *bold* /italic/ _underline_ +strike through+ ~code~ and =verbatim=. Links also use minimal
6+
markup in [[https://orgmode.org][Org]].
7+
8+
* Blocks
9+
10+
#+begin_src js
11+
console.log('hello')
12+
#+end_src
13+
14+
* Lists
15+
16+
- one
17+
- two
18+
- three
19+
20+
21+
* Tasks
22+
23+
** DONE buy milk
24+
** TODO drink it

examples/editor/index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + TS</title>
8+
</head>
9+
<body>
10+
<div id="container">
11+
<h1>Org Editor</h1>
12+
<div id="editor"></div>
13+
</div>
14+
<script type="module" src="/src/main.ts"></script>
15+
</body>
16+
</html>

examples/editor/package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "@orgajs/example-editor",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite --port 3000 --force",
8+
"build": "tsc && vite build",
9+
"preview": "vite preview"
10+
},
11+
"devDependencies": {
12+
"typescript": "^5.2.2",
13+
"vite": "^4.4.9"
14+
},
15+
"dependencies": {
16+
"@orgajs/editor": "workspace:^"
17+
}
18+
}

examples/editor/public/vite.svg

Lines changed: 1 addition & 0 deletions
Loading

examples/editor/src/main.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { makeEditor } from '@orgajs/editor'
2+
import content from '../content.org?raw'
3+
import './style.css'
4+
5+
const target = document.querySelector('#editor')
6+
if (target !== null) {
7+
makeEditor({ target, content })
8+
}

0 commit comments

Comments
 (0)