Skip to content

Commit

Permalink
fix doc errors, part II
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Oct 17, 2023
1 parent 7b72745 commit 7763fc2
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Documenter

push!(LOAD_PATH, "../../src")

using Stipple, Stipple.Elements, Stipple.Layout, Stipple.Typography
using Stipple, Stipple.Elements, Stipple.Layout, Stipple.Typography, Stipple.NamedTuples

makedocs(
sitename = "Stipple - data dashboards and reactive UIs for Julia",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/API/elements.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = Elements
CurrentModule = Stipple.Elements
```

```@docs
Expand Down
3 changes: 2 additions & 1 deletion docs/src/API/layout.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
```@meta
CurrentModule = Layout
CurrentModule = Stipple.Layout
```

```@docs
layout
page
row
column
cell
theme
```
2 changes: 1 addition & 1 deletion docs/src/API/namedtuples.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ CurrentModule = Stipple.NamedTuples
```

```@docs
Core.NamedTuple
# Core.NamedTuple
```
20 changes: 10 additions & 10 deletions docs/src/API/stipple.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ CurrentModule = Stipple
```@docs
Reactive
ReactiveModel
@reactors
@reactive
@reactive!
Settings
MissingPropertyException
# @reactors
# @reactive
# @reactive!
# Settings
# MissingPropertyException
render
update!
watch
Expand All @@ -23,21 +23,21 @@ register_components
components
setindex_withoutwatchers!
setfield_withoutwatchers!
convertvalue
stipple_parse
# convertvalue
# stipple_parse
init
stipple_deps
# stipple_deps
setup
Base.push!(m::M, vals::Pair{Symbol, T}; kwargs...) where {T, M <: ReactiveModel}
rendering_mappings
julia_to_vue
parse_jsfunction
replace_jsfunction!
replace_jsfunction
deps_routes
# deps_routes
deps
@R_str
on
# on
onbutton
@js_str
@kwredef
Expand Down
2 changes: 1 addition & 1 deletion docs/src/API/typography.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = Typography
CurrentModule = Stipple.Typography
```

```@docs
Expand Down
16 changes: 16 additions & 0 deletions src/Stipple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,22 @@ end

@specialize

"""
Create a js expression that is bound to a field of a vue component.
Internally this is nothing than conversion to a Symbol, but it's a short version for creating symbols with spaces.
### Example
```
julia> btn("", @click("toggleFullscreen"), icon = R"is_fullscreen ? 'fullscreen_exit' : 'fullscreen'")
"<q-btn label v-on:click=\"toggleFullscreen\" :icon=\"is_fullscreen ? 'fullscreen_exit' : 'fullscreen'\"></q-btn>"
```
Note: For expressions that contain only variable names, we recommend the Symbol notation
```
julia> btn("", @click("toggleFullscreen"), icon = :fullscreen_icon)
"<q-btn label v-on:click=\"toggleFullscreen\" :icon=\"fullscreen_icon\"></q-btn>"
```
"""
macro R_str(s)
:(Symbol($s))
end
Expand Down
14 changes: 14 additions & 0 deletions src/stipple/reactivity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ mutable struct Reactive{T} <: Observables.AbstractObservable{T}
Reactive{Any}(@nospecialize(o)) = new{Any}(Observable{Any}(o), PUBLIC, false, false, "")
end

"""
mutable struct Reactive{T} <: Observables.AbstractObservable{T}
`Reactive` is a the base type for variables that are handled by a model. It is an `AbstractObservable` of which the content is
obtained by appending `[]` after the `Reactive` variable's name.
For convenience, `Reactive` can be abbreviated by `R`.
There are several methods of creating a Reactive variable:
- `r = Reactive(8)`
- `r = Reactive{Float64}(8)`
- `r = Reactive{Float64}(8, READONLY)`
- `r = Reactive{String}("Hello", PRIVATE)`
- `r = Reactive(jsfunction"console.log('Hi')", JSFUNCTION)`
"""
Reactive(r::T, arg1, args...) where T = convert(Reactive{T}, (r, arg1, args...))
Reactive(r::T) where T = convert(Reactive{T}, r)

Expand Down

0 comments on commit 7763fc2

Please sign in to comment.