Git Product home page Git Product logo

jade-mode's Introduction

sws-mode

MELPA MELPA Stable

major mode for jade-mode and stylus-mode

__S__ignificant __W__hitespace __M__ode. Because Jade and Stylus are both 'significant white space' languages, sws-mode can be used to edit both types of files

Lines can be indented or un-indented (is that a word?) with tab, shift-tab respectively. Indentation will look at the proceeding line and not indent more than 1 level of nesting below it.

html
  body
    #container
    .content
  ^
  |----cursor anywhere on this line except at beginning of text, press tab or S-tab

html
  body
    #container
    .content
    ^
    |---- cursor moves to beginning of text...once cursor is at beginning of text, press tab

html
  body
    #container
      .content
      ^
      |---- now line is maximum indented, press tab again

html
  body
    #container
.content
^
|---- line moves to minimum indentation level (no indentation)

Regions can be indentend in a similar way; however, this is still buggy...

Since jade and stylus nesting is somewhat related to sexp layout I hope to have sexp related selection & manipulation working in the future. See jade-highlight-sexp for an example

key bindings

  • [tab] if region is active, do 'smart indent' on region. otherwise, move cursor to beginning of line text. If cursor already at beginning of line text, do 'smart indent' on line.
  • [shift-tab] if region is active, do 'smart dedent' on region. otherwise, move cursor to beginning of line text. If cursor already at beginning of line text, do 'smart dedent' on line.

jade-mode

Emacs major mode for jade template highlighting. This mode extends sws-mode to provide some rudimentary syntax highlighting.

Still in very early stages. Some simple highlighting of tags, ids, and classes works; however, it highlights incorrectly into the javascript code and plain text code as well.

I would like to get the highlighting working better. Also note javascript highlighting with either js2-mode or espresso-mode should be possible...I'm a major major-mode writing noob so it'll take a while.

stylus-mode

I'm not sure yet how to highlight .styl files, so for now, just use sws-mode when editing stylus mode.

Installation instructions

Copy the jade-mode.el and sws-mode.el to some directory on your computer. I put mine under ~/code/jade-mode and sym-link the jade-mode folder into ~/.emacs.d/vendor/. You can just as easily put the folder itself under '~/.emacs.d/vendor/`

Add the following lines to any of your initialization files

(add-to-list 'load-path "~/.emacs.d/vendor/jade-mode")
(require 'sws-mode)
(require 'jade-mode)
(add-to-list 'auto-mode-alist '("\\.styl\\'" . sws-mode))

Flycheck support.

Flycheck now has support for jade files. It currently only handles errors.

jade-mode's People

Contributors

abutcher avatar brianc avatar he-la avatar jkpl avatar mc-escherichia avatar ntotani avatar phikal avatar purcell avatar robbyoconnor avatar shanderlam avatar sterlingg avatar thomas-riccardi avatar wasamasa avatar zonuexe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jade-mode's Issues

Support for renaming of jade -> pug

Due to a trademark of another company named jade, the jade language is undergoing a transition to pug. See Renaming jade -> Pug.

I would be happy to help in the code aspects, but I don't know much about how melpa packages are managed and what the best way to make the transition for this is.

fill-paragraph doesn't respect new-lines in comments

Example:

//- First paragraph.
//-
//- Second paragraph.

Now, when I execute fill-paragraph (M-q) on the comment, then the result is:

//- First paragraph. Second paragraph.

In this case, however, I expect no change at all.

Highlight mixin syntax

Could probably just highlight it as JS, but we need to at least get rid of the .class colors leaking into the params.

emacs hang when type in single quote `'` in jade-mode

I install jade-mode from emacs package-install, when I'm editing a jade file, adding attribute to a tag by ', emacs hangs and top shows it use 100% CPU.

$ emacs --version
GNU Emacs 24.3.1
Copyright (C) 2013 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

#jade info in emacs:
     Status: Installed in `/home/laputa/.emacs.d/elpa/jade-mode-20130220.1245/'.
    Version: 20130220.1245
   Requires: sws-mode-0
    Summary: Major mode for editing .jade files [github]

Does anyone met the same problem?

Make JS fontification more jade-friendly

I'm thinking:

  • Add some jade keywords to the js-mode syntax table (maybe remove some JS ones! I'm looking at you, class)
  • Pick some JS/jade 'special' keywords to receive font-lock-builtin-face
  • Make two slightly different sets of keywords/syntax tables for the two main types of JS highlighting (inside paren () blocks and lines opening with -)

Unindented Tag Text Not Highlighting

I'm having an issue with a jade docpad document file, basically a partial. All elements after the first level are highlighted correctly, however the first level elements (in this case "section" tags) are not highlighted.

An example section of the file is:

section.slide
  h2 Other supported entities:
  ul
    li comments
    li users
    li taxonomy terms

The h2, ul and li elements are all highlighted. The initial section element is not, though a class or id element appended to the section tag is colored correctly.

I'm running the latest MELPA version (20120730) and Emacs 24.

Tab vs. spaces and maximum indent issues

Not sure if it's an emacs config issue or jade-mode issue.

First should jade mode be using tabs or spaces. I noticed that my space indented files should all element names in red, but even your example.jade mixes spaces and tabs.

Second while Shift-Tab works great, Tab always only indents to the very first level and with leading # inserts a space, i.e. in the example.jade file if i hit tab at the beginning of the #container line i get this

    #container
^

[tab]

    #container
     ^

[tab]

#container
^

[tab]

  #container
  ^

[tab]

  #container
   ^

[tab]

  # container
    ^

And after that all the [tab] hitting will not move it further

Unit tests!

Focus on catching regressions in highlighting (and indentation/comment functions)

Add .el file headers to enable automatic packaging

Hey Brian! I run the "Melpa" emacs package archive with a friend, and it's getting really popular. (http://melpa.milkbox.net) It builds package.el-compatible packages automatically from upstream .el source code.

We received a pull request containing a recipe for packaging up the files in this repo, but we couldn't accept it because the files don't have the standard headers that are required by the package.el system. If you were to put something like the following in the files, at a minimum, that'd be really helpful:

;;; jade-mode.el --- Brief description of mode
;;; URL: ....
;;; Author: Brian M Carlson

....

;;;; jade-mode.el ends here

I'd work up a pull request myself, but I don't use these modes directly, so I thought I'd just make a quick appeal to your community spirit instead. :-)

Cheers,

-Steve

Version information

Hi, i have seen there are jade-mode in marmalade repo. (http://marmalade-repo.org/packages/jade-mode)
It is written, marmalade use the 0.1 version of jade-mode.

But i don't know witch version is use on github . Perhaps we could creat a file or anything to indicate the github version.

(Sorry for my bad english)

Hiding sections

Was using org-mode, and it reminded me of how helpful it would be to be able to "hide" nested elements from time-to-time. Just an idea.

recent melpa update broke single-quoted strings

I have:

doctype html
html
  head
    meta(charset='utf-8')
    link(rel='stylesheet', type='text/css', href='main.css')

It used to highlight OK, but with version 20150313.812 from MELPA the highlighting does not work. Double-quoted strings still work:

doctype html
html
  head
    meta(charset="utf-8")
    link(rel="stylesheet", type="text/css", href="main.css")

Apostrophe not parsed correctly

example:

p= 'i should be parsed as string delimiter'
p i shouldn't be parsed as the beginning of a string 

i am seeing the second line being parsed incorrectly

stylus-mode: Smart indent malfunctioning

When I navigate to the end of a line in a Stylus file, and try to make a new section inside it, pressing TAB just indents to my tab-width; it never indents to the correct position.

license

jade/sws-mode doesn't specify a license.

I'm creating a package for NixOS and I need to specify one.
Can I assume GPL2+, as most emacs packages use?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.