juliacomputing / cobweb.jl Goto Github PK
View Code? Open in Web Editor NEW๐ธ๏ธ Cobble together web content in Julia
Home Page: https://JuliaComputing.github.io/Cobweb.jl/
License: Other
๐ธ๏ธ Cobble together web content in Julia
Home Page: https://JuliaComputing.github.io/Cobweb.jl/
License: Other
I want to integrate HTMX closely with Cobweb.jl.
I will do this anyway for my own needs - in one way or another - but I think it can be nice to have this in a public repo so other Julia users can benefit from it.
HTMX can already be used with Cobweb.jl (it is just a matter of adding attributes). However, I would like to add some dedicated types and functions to make the process smoother.
Would you consider a PR (given I don't touch the already implemented functionality)?
Or should I do it as a standalone extension wrapping the Cobweb.jl?
More about HTMX here: https://htmx.org/docs/
I was trying to test a package that depends on Cobweb (through PlotlyLight) and I seem to get an error on precompilation on Julia 1.6 (ubuntu).
Here is the error:
ERROR: The following 1 direct dependency failed to precompile:
Cobweb [ec354790-cf28-43e8-bb59-b484409b7bad]
Failed to precompile Cobweb [ec354790-cf28-43e8-bb59-b484409b7bad] to /home/amengali/.julia/compiled/v1.6/Cobweb/jl_AJQdNs.
ERROR: LoadError: UndefVarError: Pairs not defined
Stacktrace:
[1] getproperty(x::Module, f::Symbol)
@ Base ./Base.jl:26
[2] top-level scope
@ ~/.julia/packages/Cobweb/3Q4pp/src/Cobweb.jl:47
[3] include
@ ./Base.jl:384 [inlined]
[4] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
@ Base ./loading.jl:1235
[5] top-level scope
@ none:1
[6] eval
@ ./boot.jl:360 [inlined]
[7] eval(x::Expr)
@ Base.MainInclude ./client.jl:446
[8] top-level scope
@ none:1
in expression starting at /home/amengali/.julia/packages/Cobweb/3Q4pp/src/Cobweb.jl:1
(jl_1NOzag) pkg> st
Status `/tmp/jl_1NOzag/Project.toml`
[ec354790] Cobweb v0.5.1
It should be because in 1.6 Base.Pairs
was not defined. Probably it would be safer to use Base.Iterators.Pairs as that seems defined also in 1.6
I am not able to reference the field of a Node
. So using the example
using Cobweb: h, Page
page = h.html(
h.head(
h.meta(charset="UTF-8"),
h.meta(name="viewport", content="width=device-width, initial-scale=1.0"),
h.title("Page Title")
),
h.body(
h.h1("This is my page title."),
h.p("This is a paragraph."),
h.button("Click Me for an alert!", onclick="buttonClicked()"),
Cobweb.Javascript("const buttonClicked = () => alert('This button was clicked!')"),
)
)
I cannot for example perform
julia> for c in page.children
println(c)
end
ERROR: KeyError: key "children" not found
Stacktrace:
[1] getindex
@ ./dict.jl:484 [inlined]
[2] getproperty(node::Cobweb.Node, name::Symbol)
@ Cobweb ~/.julia/packages/Cobweb/29HXS/src/Cobweb.jl:51
[3] top-level scope
@ ./REPL[115]:1
However the following code works
julia> for c in getfield(page, :children)
println(c)
end
<head><meta charset="UTF-8"></meta><meta name="viewport" content="width=device-width, initial-scale=1.0"></meta><title>Page Title</title></head>
<body><h1>This is my page title.</h1><p>This is a paragraph.</p><button onclick="buttonClicked()">Click Me for an alert!</button><script>const buttonClicked = () => alert('This button was clicked!')</script></body>
Hyperscript.jl makes styles available one way. CSSUtil.jl, which is older and unattended afaik, does it another way. Cobweb should do it in whatever way is consonant with your approach to making JavaScript/TypeScript available. Just to make the project easier overall, following a pervasive logic.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.