retrogradeorbit / bootleg Goto Github PK
View Code? Open in Web Editor NEWSimple template processing command line tool to help build static websites
License: Eclipse Public License 2.0
Simple template processing command line tool to help build static websites
License: Eclipse Public License 2.0
Enlive encodes it's internally generated hickory with missing :type fields. eg {:tag :blink, :attrs nil, :content ["FOO"]}
instead of {:type :element :tag :blink, :attrs nil, :content ["FOO"]}
This then explodes when passing through hickory's conversion utilities.
See #2
Somehow this works:
bootleg -e '(doseq [f (glob "content/posts/*.markdown")] (println f))'
but this fails on my machine (MacOS 10.14.6), bootleg Version: 0.1.7
:
cat '(doseq [f (glob "content/posts/*.markdown")] (println f))' >> bootlegrepro.clj
bootleg bootlegrepro.clj
Exception in thread "main" java.lang.NullPointerException
at bootleg.file$relativise.invokeStatic(file.clj:57)
at bootleg.file$relativise.invoke(file.clj:53)
at clojure.core$partial$fn__5824.invoke(core.clj:2624)
at clojure.core$map$fn__5851.invoke(core.clj:2755)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:531)
at clojure.core$seq__5387.invokeStatic(core.clj:137)
at clojure.core$seq__5387.invoke(core.clj:137)
at sci.impl.interpreter$fn_call.invokeStatic(interpreter.cljc:428)
at sci.impl.interpreter$fn_call.invoke(interpreter.cljc:428)
at sci.impl.interpreter$eval_call.invokeStatic(interpreter.cljc:474)
at sci.impl.interpreter$eval_call.invoke(interpreter.cljc:460)
at sci.impl.interpreter$interpret.invokeStatic(interpreter.cljc:503)
at sci.impl.interpreter$interpret.invoke(interpreter.cljc:492)
at sci.impl.interpreter$fn_call.invokeStatic(interpreter.cljc:428)
at sci.impl.interpreter$fn_call.invoke(interpreter.cljc:428)
at sci.impl.interpreter$eval_call.invokeStatic(interpreter.cljc:474)
at sci.impl.interpreter$eval_call.invoke(interpreter.cljc:460)
at sci.impl.interpreter$interpret.invokeStatic(interpreter.cljc:503)
at sci.impl.interpreter$interpret.invoke(interpreter.cljc:492)
at sci.impl.interpreter$eval_form.invokeStatic(interpreter.cljc:547)
at sci.impl.interpreter$eval_form.invoke(interpreter.cljc:538)
at sci.impl.interpreter$eval_string_STAR_.invokeStatic(interpreter.cljc:557)
at sci.impl.interpreter$eval_string_STAR_.invoke(interpreter.cljc:550)
at sci.impl.interpreter$eval_string$fn__1514.invoke(interpreter.cljc:570)
at sci.impl.interpreter$eval_string.invokeStatic(interpreter.cljc:567)
at sci.impl.interpreter$eval_string.invoke(interpreter.cljc:563)
at sci.core$eval_string.invokeStatic(core.cljc:169)
at sci.core$eval_string.invoke(core.cljc:137)
at bootleg.hiccup$process_hiccup_data.invokeStatic(hiccup.clj:90)
at bootleg.hiccup$process_hiccup_data.invoke(hiccup.clj:22)
at bootleg.hiccup$process_hiccup.invokeStatic(hiccup.clj:106)
at bootleg.hiccup$process_hiccup.invoke(hiccup.clj:97)
at bootleg.core$process.invokeStatic(core.clj:37)
at bootleg.core$process.invoke(core.clj:35)
at bootleg.core$_main.invokeStatic(core.clj:77)
at bootleg.core$_main.doInvoke(core.clj:57)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at bootleg.core.main(Unknown Source)
yaml
and json
missing :data
flag option
$ lein run -d -e '(System/getenv "FOO")'
nil
$ ./bootleg -d -e '(System/getenv "FOO")'
bootleg: script error at line , column : Illegal argument: No matching method getenv found taking 1 args
Going to be a reflection issue
$ bootleg -d -e '(convert-to "<p>1</p>" :hiccup)'
[:p {} "1"]
could output
[:p "1"]
Add the clojure.walk namespace to the sci environment. It will be useful.
refactor the old functions to use the new thread local from bootleg.context
see #35
I want to process a bunch of yaml description files in different directories into a single overview that will be used to create a overview page.
I think https://github.com/jkk/clj-glob could really help.
Exception in thread "main" clojure.lang.ExceptionInfo: The map literal starting with :class contains 3 form(s). Map literals must contain an even number of forms. [at line 43, column 32] {:row 43, :col 32}
at edamame.impl.parser$throw_reader.invokeStatic(parser.cljc:62)
at edamame.impl.parser$throw_reader.invoke(parser.cljc:50)
at edamame.impl.parser$throw_odd_map.invokeStatic(parser.cljc:261)
at edamame.impl.parser$throw_odd_map.invoke(parser.cljc:259)
at edamame.impl.parser$parse_map.invokeStatic(parser.cljc:279)
at edamame.impl.parser$parse_map.invoke(parser.cljc:272)
at edamame.impl.parser$dispatch.invokeStatic(parser.cljc:350)
...
I'm probably doing something dumb here.
site.clj
(-> (html "index.template.html") (enlive/at [:section#content] (enlive/content (markdown "README.md"))))
README.md
is a standard markdown.index.template.html
is a standard HTML file with <section id="content"></section>
in it.Exception in thread "main" java.lang.NullPointerException
at bootleg.utils$convert_to.invokeStatic(utils.clj:153)
at bootleg.utils$convert_to.invoke(utils.clj:150)
at bootleg.namespaces$at__2990.invokeStatic(namespaces.clj:135)
at bootleg.namespaces$at__2990.doInvoke(namespaces.clj:125)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invokeStatic(core.clj:665)
at clojure.core$apply.invoke(core.clj:660)
at sci.impl.interpreter$do_recur_BANG_.invokeStatic(interpreter.cljc:123)
at sci.impl.interpreter$do_recur_BANG_.doInvoke(interpreter.cljc:121)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$apply.invoke(core.clj:660)
at sci.impl.interpreter$apply_fn.invokeStatic(interpreter.cljc:132)
at sci.impl.interpreter$apply_fn.invoke(interpreter.cljc:130)
at sci.impl.interpreter$eval_call.invokeStatic(interpreter.cljc:306)
at sci.impl.interpreter$eval_call.invoke(interpreter.cljc:271)
at sci.impl.interpreter$interpret.invokeStatic(interpreter.cljc:320)
at sci.impl.interpreter$interpret.invoke(interpreter.cljc:310)
at sci.impl.interpreter$eval_do$fn__707.invoke(interpreter.cljc:62)
at sci.impl.interpreter$eval_do.invokeStatic(interpreter.cljc:62)
at sci.impl.interpreter$eval_do.invoke(interpreter.cljc:57)
at sci.impl.interpreter$eval_string.invokeStatic(interpreter.cljc:370)
at sci.impl.interpreter$eval_string.invoke(interpreter.cljc:352)
at sci.core$eval_string.invokeStatic(core.cljc:35)
at sci.core$eval_string.invoke(core.cljc:5)
at bootleg.hiccup$process_hiccup_data.invokeStatic(hiccup.clj:54)
at bootleg.hiccup$process_hiccup_data.invoke(hiccup.clj:22)
at bootleg.hiccup$process_hiccup.invokeStatic(hiccup.clj:68)
at bootleg.hiccup$process_hiccup.invoke(hiccup.clj:64)
at bootleg.core$process.invokeStatic(core.clj:34)
at bootleg.core$process.invoke(core.clj:32)
at bootleg.core$_main.invokeStatic(core.clj:66)
at bootleg.core$_main.doInvoke(core.clj:49)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at bootleg.core.main(Unknown Source)
Hi - I also had a problem with the stale io.forward/yaml and this issue:
https://github.com/owainlewis/yaml/issues/28
So, I wrote my own YAML wrapper to SnakeYAML 2.0. You can see it here:
https://github.com/cloojure/tupelo/blob/master/src/clj/tupelo/parse/yaml.clj
Feel free to either reference this or copy it into your own lib.
Alan
Alternatively / additionally a way to pass flags in. Maybe a -f someflag=12
or even allowing command line eval as well as file input.
Basically I want a way to call my script and set a conditional from outside.
$ bootleg -d -e '(convert-to "<p>1</p><p>2</p>" :hiccup)'
[:p {} "2"]
Should print the warning about the lost first form
In order to improve the data coercion problems experienced by new users (see #2), write some wrapper calls around enlive functions that auto-coerce the different datatypes to hickory.
Passing a non existent file to yaml
does not result in a file not found error, but instead returns nil
$ bootleg -d -e '(yaml "nonexistent.yml")'
nil
(enlive/at [:div [:p {:style {:margin-top "10px"}}]] [:div] (enlive/set-attr :style "margin-top:10px;"))
Class cast: clojure.lang.PersistentArrayMap cannot be cast to java.lang.String
$ bootleg -e '[:div {:style "color:red;"}]'
<div style="color:red;"></div>
$ bootleg -e '[:div {:style {:color "red"}}]'
Exception in thread "main" java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.lang.String
at quoin.text$html_escape.invokeStatic(text.clj:12)
at quoin.text$html_escape.invoke(text.clj:4)
at hickory.utils$html_escape.invokeStatic(utils.cljc:27)
at hickory.utils$html_escape.invoke(utils.cljc:25)
at hickory.render$render_hiccup_attrs$iter__367__371$fn__372.invoke(render.cljc:82)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:531)
at clojure.core$seq__5387.invokeStatic(core.clj:137)
at clojure.core$filter$fn__5878.invoke(core.clj:2809)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:58)
at clojure.lang.RT.seq(RT.java:531)
at clojure.core$seq__5387.invokeStatic(core.clj:137)
at clojure.core$sort.invokeStatic(core.clj:3113)
at clojure.core$sort.invokeStatic(core.clj:3102)
at clojure.core$sort.invoke(core.clj:3102)
at hickory.render$render_hiccup_attrs.invokeStatic(render.cljc:85)
at hickory.render$render_hiccup_attrs.invoke(render.cljc:69)
at hickory.render$render_hiccup_element.invokeStatic(render.cljc:102)
at hickory.render$render_hiccup_element.invoke(render.cljc:93)
at hickory.render$render_hiccup_form.invokeStatic(render.cljc:113)
at hickory.render$render_hiccup_form.invoke(render.cljc:106)
at hickory.render$hiccup_to_html$fn__394.invoke(render.cljc:141)
...
[:rss {:version "2.0"}
[:channel
[:title "Epiccastle Blog"]
[:description "Epiccastle.io Updates"]
[:link "https://epiccastle.io/blog/"]
[:lastBuildDate "Mon, 06 Sep 2010 00:01:00 +0000"]
[:pubDate "Sun, 06 Sep 2009 16:20:00 +0000"]
[:ttl "1800"]
[:item
[:title "Example Blog Post"]
[:description "This is some examples"]
[:link2 "https://epiccastle.io/blog/1/"]
[:gid "7bd204c6-1655-4c27-aeee-53f933c5395f"]
[:pubDate "Sun, 06 Sep 2009 16:20:00 +0000"]]
]
]
produces
<rss version="2.0"><channel><title>Epiccastle Blog</title><description>Epiccastle.io Updates</description><link><lastbuilddate>Mon, 06 Sep 2010 00:01:00 +0000</lastbuilddate><pubdate>Sun, 06 Sep 2009 16:20:00 +0000</pubdate><ttl>1800</ttl><item><title>Example Blog Post</title><description>This is some examples</description><link2>https://epiccastle.io/blog/1/</link2><gid>7bd204c6-1655-4c27-aeee-53f933c5395f</gid><pubdate>Sun, 06 Sep 2009 16:20:00 +0000</pubdate></item></channel></rss>
notice link
is mangled white link2
is intact
When slurping a local file a BufferedInputStream is returned rather than the file contents.
When trying to parse a template using Selmer builtin tags such as include and extends a Bootleg error is returned:
bootleg -e '(selmer "page.html”)’
bootleg: script error at line 1, column 1: : “unrecognized tag: :extends - did you forget to close a tag?”
Set-up:
Selemer tags used in page.html
:
{% extends “base.html" %}
{% include “partial.html” %}
—
yogthos : You can't use include in conjunction with render because render expects a string containing the complete template. You should use render-file instead and put both templates in separate files.
Hi,
When I use --output
option, the output file is created but is empty and I have this error:
$ bootleg -o test.html simple.clj
Exception in thread "main" java.lang.IllegalArgumentException: No matching method write found taking 1 args for class java.io.BufferedWriter
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:127)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:102)
at bootleg.core$output_result.invokeStatic(core.clj:46)
at bootleg.core$output_result.invoke(core.clj:39)
at bootleg.core$_main.invokeStatic(core.clj:72)
at bootleg.core$_main.doInvoke(core.clj:52)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at bootleg.core.main(Unknown Source)
Best regards.
Add documentation on how to build the binary
Starting bootleg
with no arguments should launch a REPL.
Currently a big fat stack trace. :)
$ bootleg goober
Exception in thread "main" java.io.FileNotFoundException: goober
at com.oracle.svm.core.posix.PosixUtils.fileOpen(PosixUtils.java:235)
at java.io.FileInputStream.open(FileInputStream.java:481)
...
./bootleg -d <<< '<html></html>'
A beginner coming to this for the first time and seeing the "quickstart" examples with -e
will probably get confused. What I want to see as a new user is basically the contents of examples/quickstart
and the clojure code that would be required to render that into a site. I'd want this in a conversational tone like:
Imagine you have an HTML template like this:
<bod>...some valid code here...</body>
You want to merge that with a JSON file like this:
...
Then you want to include some Markdown from a file called README.md which looks like this:
...
And so on.
Thanks for writing this package. I love the appeal of a small bash tool that spits html.
It does what it claims to do really well.
However most sites I work on need more than ability to convert a template->html.
For example:
What's your goto way to solve these problems?
Is it a part of bootleg philosophy or do you consider this as something external, maybe a set of babashka scripts.
Thank you
First of all, thanks for the great project.
When trying to build with graalvm-ce-java11-19.3.0
on OSX it seems to be error.
It works perfectly when trying with graalvm-ce-java8-19.3.0
.
I will add the stacktrace of the problem once I have test this again soon.
This is the result of running the following command:
My environment:
make clean all
The relevant error logs:
...
Printing initializer configuration to /Users/bchoomnuan/apps/retrogradeorbit--bootleg/reports/initializer_configuration_20191218_213958.txt
[Use -Dgraal.LogFile=<path> to redirect Graal log output to a file.]
[thread:24] scope: ForkJoinPool-2-worker-7
[thread:24] scope: ForkJoinPool-2-worker-7.ClosedWorldAnalysis
Context: StructuredGraph:4804{AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>}
Context: AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>
[thread:24] scope: ForkJoinPool-2-worker-7.ClosedWorldAnalysis.AnalysisGraphBuilderPhase.IntrinsifyMethodHandles
Context: StructuredGraph:4820{HotSpotMethod<Invokers$Holder.invoke_MT(Object, Object, Object, Object)>}
Exception raised in scope ForkJoinPool-2-worker-7.ClosedWorldAnalysis.AnalysisGraphBuilderPhase.IntrinsifyMethodHandles: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.Invokers$Holder.invoke_MT(Object, Object, Object, Object)
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The error is then reported at run time when the invoke is executed.
at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.processInvokeWithMethodHandle(IntrinsifyMethodHandlesInvocationPlugin.java:483)
at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.handleInvoke(IntrinsifyMethodHandlesInvocationPlugin.java:194)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.tryNodePluginForInvocation(BytecodeParser.java:2110)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.appendInvoke(BytecodeParser.java:1793)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genDynamicInvokeHelper(BytecodeParser.java:1682)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1630)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1615)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5168)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3286)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3093)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:977)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:871)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:197)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:221)
at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:340)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:310)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureParsed(MethodTypeFlow.java:300)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:107)
at com.oracle.graal.pointsto.flow.StaticInvokeTypeFlow.update(InvokeTypeFlow.java:346)
at com.oracle.graal.pointsto.BigBang$2.run(BigBang.java:511)
at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:171)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Context obj StructuredGraph:4820{HotSpotMethod<Invokers$Holder.invoke_MT(Object, Object, Object, Object)>}
Context obj com.oracle.svm.hosted.phases.AnalysisGraphBuilderPhase@7f0b3701
Context obj StructuredGraph:4804{AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>}
Context obj AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>
Context obj com.oracle.svm.hosted.analysis.flow.SVMMethodTypeFlowBuilder@19bd70c
Exception raised in scope ForkJoinPool-2-worker-7.ClosedWorldAnalysis.AnalysisGraphBuilderPhase: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.Invokers$Holder.invoke_MT(Object, Object, Object, Object)
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The error is then reported at run time when the invoke is executed.
at parsing clojure.lang.Reflector.canAccess(Reflector.java:49)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2475)
at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:93)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3291)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3093)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:977)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:871)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:197)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:221)
at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:340)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:310)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureParsed(MethodTypeFlow.java:300)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:107)
at com.oracle.graal.pointsto.flow.StaticInvokeTypeFlow.update(InvokeTypeFlow.java:346)
at com.oracle.graal.pointsto.BigBang$2.run(BigBang.java:511)
at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:171)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.Invokers$Holder.invoke_MT(Object, Object, Object, Object)
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The error is then reported at run time when the invoke is executed.
at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.processInvokeWithMethodHandle(IntrinsifyMethodHandlesInvocationPlugin.java:483)
at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.handleInvoke(IntrinsifyMethodHandlesInvocationPlugin.java:194)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.tryNodePluginForInvocation(BytecodeParser.java:2110)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.appendInvoke(BytecodeParser.java:1793)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genDynamicInvokeHelper(BytecodeParser.java:1682)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1630)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1615)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5168)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3286)
... 22 more
Context obj com.oracle.svm.hosted.phases.AnalysisGraphBuilderPhase@7f0b3701
Context obj StructuredGraph:4804{AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>}
Context obj AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>
Context obj com.oracle.svm.hosted.analysis.flow.SVMMethodTypeFlowBuilder@19bd70c
$ bootleg
Exception in thread "main" java.io.FileNotFoundException: /home/crispin/.bootleg/libs/libsunec.so
at com.oracle.svm.core.posix.PosixUtils.fileOpen(PosixUtils.java:235)
at java.io.FileOutputStream.open(FileOutputStream.java:580)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
at clojure.java.io$fn__11504.invokeStatic(io.clj:319)
at clojure.java.io$fn__11504.invoke(io.clj:319)
at clojure.lang.MultiFn.invoke(MultiFn.java:239)
at clojure.java.io$copy.invokeStatic(io.clj:406)
at clojure.java.io$copy.doInvoke(io.clj:391)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at bootleg.config$setup.invokeStatic(config.clj:21)
at bootleg.config$setup.invoke(config.clj:13)
at bootleg.config$init_BANG_.invokeStatic(config.clj:31)
at bootleg.config$init_BANG_.invoke(config.clj:23)
at bootleg.core$_main.invokeStatic(core.clj:52)
at bootleg.core$_main.doInvoke(core.clj:49)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at bootleg.core.main(Unknown Source)
🙏
In the readme, you mention hiccup can't represent sibling elements like:
<p>one</p><p>two</p>
But I'm pretty sure you can do this in Hiccup by wrapping it in a list like:
(list [:p "one"] [:p "two"])
Enlive requires hickory forms. Make that more explicit in the documentation. (see #2)
hiccup-seq conversion does not ignore nil elements like reagent.
$ bootleg -e '(convert-to [nil] :html)'
Exception in thread "main" java.lang.NullPointerException
at bootleg.utils$convert_to.invokeStatic(utils.clj:274)
at bootleg.utils$convert_to.invoke(utils.clj:271)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:665)
at clojure.core$apply.invoke(core.clj:660)
at sci.impl.interpreter$eval_call.invokeStatic(interpreter.cljc:286)
at sci.impl.interpreter$eval_call.invoke(interpreter.cljc:250)
at sci.impl.interpreter$interpret.invokeStatic(interpreter.cljc:302)
at sci.impl.interpreter$interpret.invoke(interpreter.cljc:292)
at sci.impl.interpreter$eval_do$fn__688.invoke(interpreter.cljc:64)
at sci.impl.interpreter$eval_do.invokeStatic(interpreter.cljc:64)
at sci.impl.interpreter$eval_do.invoke(interpreter.cljc:59)
at sci.impl.interpreter$eval_edn_vals.invokeStatic(interpreter.cljc:355)
at sci.impl.interpreter$eval_edn_vals.invoke(interpreter.cljc:354)
at sci.impl.interpreter$eval_string.invokeStatic(interpreter.cljc:363)
at sci.impl.interpreter$eval_string.invoke(interpreter.cljc:357)
at sci.core$eval_string.invokeStatic(core.cljc:37)
at sci.core$eval_string.invoke(core.cljc:5)
at bootleg.hiccup$process_hiccup_data.invokeStatic(hiccup.clj:60)
at bootleg.hiccup$process_hiccup_data.invoke(hiccup.clj:23)
at bootleg.core$_main.invokeStatic(core.clj:67)
at bootleg.core$_main.doInvoke(core.clj:52)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at bootleg.core.main(Unknown Source)
Not sure if this is a bug or not.
Same files as previous issue.
(mustache "index.template.html" {:content (markdown "README.md")})
Yields:
<section id="content">clojure.lang.LazySeq@7f4072bd45d0</section>
It appears sci has no doall
.
(enlive/at forms
[:pre] (enlive/set-attr "style" {:border-radius "8px"
:margin-bottom "32px"})
gives:
bootleg: script error at line 23, column 25: Class cast: clojure.lang.PersistentArrayMap cannot be cast to java.lang.String
$ bootleg -v
Version: 0.1.2
$ cat example-working.clj
(-> (mustache "example-working.html" {:heading "heading"})
(convert-to :hickory-seq))
$ cat example-working.html
<h1>{{ heading }}</h1>
$ bootleg -d example-working.clj
({:type :element, :attrs nil, :tag :h1, :content ["heading"]} "\n")
$ bootleg example-working.clj
<h1>heading</h1>
$ cat example-broken.clj
(-> (mustache "example-broken.html" {:heading "heading"})
(convert-to :hickory-seq))
$ cat example-broken.html
<html>
<body>
<h1>{{ heading }}</h1>
</body>
</html>
$ bootleg -d example-broken.clj
("\n ")
$ bootleg example-broken.clj
Conversion doesn't work when returned mustache markup is embedded in an html tag.
Expose enlives macros in evaluation namespaces
Hello, guys! May you can help me... I'm trying to use Bootleg 's (selmer ...) fn to generate some XML files where I need to replace some variables... I have a XML template file and it working, except for this: Selmer is changing all tag names to lower-case... (a tag "<Dimension ...>" has been replaced by "<dimension ...>") but I need to preserve the case. Do you know if thats is possible? How can I do?
<!-- Header -->
<head-bootleg-mungeder id="header">
<img alt="" src="images/logo.png">
<h1 id="logo">
<a href="/">EPIC CASTLE</a>
</h1>
</head-bootleg-mungeder>
fix guthub actions
Print a warning when a sequence to single form data conversion loses data. (see #2)
$ bootleg -d -e '(convert-to [:link "foo"] :xml)'
bootleg: script error at line , column : Factory configuration error: Provider com.sun.xml.internal.stream.XMLOutputFactoryImpl not found
$ lein run -- -d -e '(convert-to [:link "foo"] :xml)'
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><link>foo</link>"
Another reflection error?
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.