Comments (7)
This was a new feature request someone put in: flag all inappropriate commands as errors, to prevent typos like $for all
. When I run your code, I get the more descriptive error message:
Received a command I did not understand. If you wanted a literal $, start the line with a backslash.
Code: Language.Haskell.TH.Quote.quoteExp
shamlet
"\r\n<script>\r\n$(function() {\r\n $ (".accordion").accordion({\r\n collapsible: true,\r\n
autoHeight: false,\r\n active: false\r\n });\r\n });\r\n\r\n"
Having this feature also allows us to add new commands in the future without worries of breaking people's code.
from shakespeare.
The way that this is handled in HAML & Slim is to allow switching to other parsers within html. :javascript
indicates js. We could instead pass through all <script>
tag content (there would still be a question as to variable insertion)
from shakespeare.
Sounds like a can of worms to me, I'm not in favor of this. We should just make it easier to embed Julius and Lucius results into Hamlet. Which reminds me: we should switch over to blaze-builder instead of Data.Text.Lazy.Builder for the 1.0 release of shakespeare-(css|js).
from shakespeare.
I had a few use cases that are easy & obvious to satisfy by passing through script/style content, but it isn't as obvious how to satisfy with an alternative technique.
<head>
# put older browsers back to the root
<script type="text/javascript">
\top.noSVG = false;
\if (!('pushState' in top.history)) {
\if( 0 == location.pathname.indexOf('/sources/sr23/') ) {
\top.location.href = '@{SearchR}#-' + location.pathname;
\}
\}
\<!--[if lt IE 9]>
<script src=http://html5shim.googlecode.com/svn/trunk/html5.js>
<script src=@{StaticR js_sie_js}>
<script>
\top.noSVG = true;
<style type="text/css">
div#energy-canvas { height: auto; }
\<![endif]-->
I think my usage could be moved out of the template. They are little snippets, and in this case there is a global variable reference that is nice to have in the same file - it would be annoying to dedicate a file to each snippet. I could instead try to put functions using the julius quasi-quoter in one file and export them all to be available for the template.
from shakespeare.
I don't know what the complication here is. If we have a "juliusToHamlet" or something along those lines, wouldn't it solve the problem?
from shakespeare.
yes, and I also want to be able to have multiple julius snippets in one file- I may try to set this up in the scaffolding.
from shakespeare.
I'm not sure what the status is of this issue currently. Can it be closed?
from shakespeare.
Related Issues (20)
- Caret Interpolation with justVarInterpolation HOT 1
- cli
- Lucius and Cassius `&` not documented
- Lucius Cassius Comment syntax not documented HOT 5
- CSS Math HOT 1
- Hamlet puts <title> to <body> HOT 5
- Julius: async function cannot be parsed HOT 6
- shakespeare escape bug in #\" HOT 2
- [lucius] @supports mixing problem? HOT 4
- Test failure with GHC 9 HOT 6
- Build error with aeson-2 HOT 1
- `$maybe` and `$forall` unsupported in `Text.Shakespeare.Text` HOT 2
- fails to build with aeson-2.0 HOT 5
- Mixins should respect rule order HOT 1
- I18N, allow multiline messages in translation files
- Support lens operators in templates
- Julius arrow function with curly brace body is compiled to expression even if it's not an expression HOT 2
- Surprising behaviour of Scientific arithmetic inside a template HOT 1
- Cannot have two messages with the same parameter name of different types HOT 3
- Inconsistency between `textfile` and `stextfile` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shakespeare.