Skip to content

Commit

Permalink
Merge pull request #11 from zen-lang/refactor-async
Browse files Browse the repository at this point in the history
Refactor async
  • Loading branch information
carbon-hvze authored Aug 30, 2023
2 parents 227aa06 + bca273a commit e5629aa
Show file tree
Hide file tree
Showing 324 changed files with 7,885 additions and 1,065 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
.lsp
.vscode
keystore/
.tmp
3 changes: 0 additions & 3 deletions customers-x/needs.zd

This file was deleted.

14 changes: 0 additions & 14 deletions customers-x/orgs.zd

This file was deleted.

18 changes: 0 additions & 18 deletions customers-x/orgs/o1.zd

This file was deleted.

16 changes: 0 additions & 16 deletions customers-x/orgs/o2.zd

This file was deleted.

122 changes: 122 additions & 0 deletions docs/Modeling.zd
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
:title "Modeling Docs"
:icon [:fa-duotone :fa-face-cowboy-hat]
:menu-order 3

:desc /

:absolute-names /

There is a special document Resource, where you can define
attributes which should not be prefixed with namespace

```zd
:zd/docname Resource

&name
:zd/type zd.Property
:zd/data-type zd.string

```

Property `Resource.name` can be used as

```zd
:zd/docname mydoc
:name "Just a name"
```

:intro /
How to model with zendoc?

In zendoc everything is a resource or document. Some docs may represent
entities from real world and others are abstract concepts.

Every doc may have multiple types - `:type` property, which is reference to
other doc.

It's recommended for concepts to have a `:type Class`
For class you can define a properties with nested docs of type `Property`

```zd
:zd/docname person
:zd/type zd.Class
:zd/required #{ .name, .telegram }

&name
:zd/type zd.Property
:zd/data-type zd.string
:zd/annotation zd.badge

&telegram
:zd/type zd.Property
:zd/data-type zd.string
:zd/annotation zd.badge

&male
:zd/type zd.Class

&female
:zd/type zd.Class

&gender
:zd/type zd.Property
:zd/enum #{ .male .female }
:zd/annotation zd.badge

```


```zd
:zd/docname person.ivan
:zd/type person
:person/name "Ivan"
:person/telegram "ivantelega"
:person/gender person.male

```

Attribute of name `namespace/name` will look for definition in `namespace.name`.

:subclasses /

While defining Class you may state that this is a subclass of another class.
That means all instances of this class are instances of superclass.
Zendoc will be able to use this for inference.

```zd
:zd/type zd.Class
:zd/subclass person

```

```zd
:zd/type Samurai
```

Now you can search "Nikolai" like a `person`

```datalog
e :zd/type person
> e
```

:same-as /

If property has a `zd.same-as` zendoc will do the inference of this attributes.

```zd
:zd/type zd.Property
:zd/same-as :foaf/name

```

```zd
:person.name Nikolai
```

You may search it as

```zd
e :foaf/name "Nikolai"
> e
```
5 changes: 5 additions & 0 deletions docs/_.zd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:title "Global Schema"


&date zd.prop
:zd/data-type zd.date
8 changes: 8 additions & 0 deletions docs/artists.zd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
:zd/menu-order 201
:title "Artists"

:number-of-songs ?/

s :music/written-by a
> a
> (count s)
3 changes: 3 additions & 0 deletions docs/artists/bethoven.zd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:zd/type music.artist
:title "Bethoven"
:music/artist-name "Bethoven"
4 changes: 4 additions & 0 deletions docs/artists/john-lenon.zd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:zd/type music.artist

:music/artist-name "John Lenon"
:title "John Lenon"
52 changes: 52 additions & 0 deletions docs/backlog.zd
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
:menu-order 20
:icon [:fa-solid :fa-rectangle-list]

^link-badge
:repo "https://github.com/zen-lang/zendoc"
:section "first"

:title "Backlog"
:desc /

features and issues

:backlog /

* [x] rename parent should rename directory and all children
* [x] delete parent should delete directory of children
* [x] implement zd.summary on backlinks
* [x] unnamespaced keys as _.keyname
* [x] zd.props for autocomplete
* [ ] refactor errors to separate page (not doc)
* [x] validation of optional set/array
* [ ] do not allow to override existing doc with new document
* [ ] implement git pull (automatic) and push
* [ ] work on documentation
* [ ] zd.annotations
* [ ] do not suggest + if exact symbol exists
* [ ] fix ctrl-l conflict with browser for autocomplete
* [ ] create an example sematic knowledge base - about semantic technologies
* [ ] build jar
* [ ] code highlight for zd/, end and code
* [ ] paging/search on backlinks
* [ ] track local changes untill commit
* [ ] structured write api
* [ ] fix macros
* [ ] nested navigation
* [ ] menu subsections
* [ ] validate subdocs while edit
* [ ] :zd/type inference with :zd/child-type and :zd/subclass
* [ ] implement file upload
* [ ] subdoc in-the-middle of doc (close with? &&?)


```zd
:title "Bla bla"

&subdoc Class
:title "Subdoc"
&

:another attribute

```
Empty file added docs/backlogs.zd
Empty file.
Empty file added docs/backlogs/tags.zd
Empty file.
4 changes: 4 additions & 0 deletions docs/city.zd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:title "Cities"
:desc /

cities dictionary
6 changes: 6 additions & 0 deletions docs/city/Estoril.zd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:title "Estoril"
^badge
:type loc.City
^badge
:loc.in country.Portugal
:desc /
7 changes: 7 additions & 0 deletions docs/city/Lisboa.zd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

:title "Lisboa"
^badge
:type loc.City
^badge
:loc.in country.Portugal
:desc /
3 changes: 3 additions & 0 deletions docs/contract.zd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:zd/type zd.class
:zd/require #{:contract/start :contract/organization }
:zd/summary [:contract/start :contract/end]
Empty file added docs/country.zd
Empty file.
3 changes: 3 additions & 0 deletions docs/country/Portugal.zd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:title "Portugal"
:type loc.Country
:desc /
2 changes: 2 additions & 0 deletions docs/country/US.zd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:title "US"
:desc /
1 change: 0 additions & 1 deletion docs/features.zd
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
:title "Features"
4 changes: 2 additions & 2 deletions docs/features/zentext.zd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
:title "zentext"
:authror team.vganshin
:features/maturity 5
:title "Zentext"
File renamed without changes.
20 changes: 20 additions & 0 deletions docs/getting-started.zd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
:title "Getting Started"
:section "first"
:icon [:fa-brands :fa-dochub]
:menu-order 1

:desc /

In this tutorial we will create a simple knowlege base for music

:Install /

:Create /

:Edit /

:Delete /

:Vaidate /

:Query /
Loading

0 comments on commit e5629aa

Please sign in to comment.