Comments (10)
I started on this, but I think I decided it’s beyond my abilities since it wouldn’t just be a preprocesor. It would have to support harp.cson
, _data.cson
, etc. But there are failing tests in that branch if someone else wants to take a crack at it.
from terraform.
I would hold off on CSON. I think HJSON suits our needs much better.
http://laktak.github.io/hjson/
from terraform.
@kennethormandy I got all the valid CSON tests passing in my branch. It doesn't support harp.cson yet, but wouldn't you simply be able to edit harp to use terraform to parse it's own config file? Hopefully this helps!
from terraform.
@sintaxi CSON is currently switching their parser (coffescript) for a static one (cson-safe). Is there any reason to not finish the CSON one and then add HJSON as a 'data' parser too? After that YAML could probably be plugged in as well. YAML isn't really a pre-processor.
from terraform.
Woah, looks promising! Failing tests 1–3 are because I thought CSON would need to error like the other preprocessors: by showing something in the browser. (This stuff happens in lib/javascript
etc.)
I supposed you could argue that it should follow what JSON does right now and just fail and throw an error outright. In that case, those tests would need to be different. Otherwise, CSON would kind of need to be implemented in two places: once as a preprocessor and once for the _data.json
files, etc.
The last failing test looks related to that. Because you can go examplefile.json.jade
to output a JSON file, some part of this implementation is conflicting with that (I think exports.isDataFile
is too aggressive)
I’m glad you’re working on this, we seem to have a pretty solid group of people who want whitespace significant everything. I’m definitely onboard, and personally I think adding comments or not breaking when JSON doesn’t have comments doesn’t conflict with adding CSON.
from terraform.
@kennethormandy OK, I'll probably be able to take another stab at this sometime later this weekend. Feel free to run with some of the work I did if you want to poke around some more.
I've got CSON in 2 places right now, where it's used for _data.json I'm just running it through the regular CSON parser, instead of the render
function. Kind of a stop gap to just see if I could get it working. Ideally every parsed file could just be requested through the normal render.
Re: isDataFile
, yeah, you're right, I'll clean that up to only match the extension.
from terraform.
@drbrts https://github.com/atom/season I think, this should be simple enough to read a file, then export it as .json
. Hope it helps.
from terraform.
What's the state of this. I have a course catalog organized as an _data directory that currently I build into _data.json so that Harp serves it properly. Harp handles the .coffeescript and I wonder if building directly into a single .coffee would be better since it gets served up as a single .js file. The goal for me is to just save edits to the individual .cson files and have them be compiled, cached, etc automatically (without any db saves of course).
from terraform.
+1, since CSON is essentially CoffeeScript, it shouldn't be an issue? Or?
from terraform.
HJSON sounds like a great idea! I'll give it a try this weekend, I think.
from terraform.
Related Issues (20)
- Foundation cannot be processed with harp HOT 1
- Sass Library Support HOT 1
- helpers.dataTree *very* slow
- Can write plugins? HOT 1
- Jade 'block unbuffered code' syntax fails—update Jade? HOT 4
- Enable PR webhook for Windows tests
- Duplicate minification of Browserified files, prevents JSX, other Browserify transforms
- Proposal Add: PUG Support because jade is depricated
- FYI: Name conflict with devops tool HOT 1
- query `@supports` not supported
- Bump node-sass to latest version. HOT 5
- Upgrading coffeescript? HOT 2
- Inlining Javascript/Stylesheets HOT 4
- Bump autoprefixer dependency. Also, an option to configure and/or disable it? HOT 4
- Unable to install it on windows 8 HOT 10
- Allow customization of processor HOT 1
- Remove dependency on node-sass HOT 4
- Update node-sass dep to 3.0.0-beta HOT 3
- support typescript
- Optional minification & uglification HOT 1
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 terraform.