GithubHelp home page GithubHelp logo

simplate.vim's People

Contributors

chadwhitacre avatar patcoll avatar pjz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

6ug

simplate.vim's Issues

content pages should be highlighted per media type

Rendered simplates have one content page (the last page). It should be syntax highlighted according to the filename extension.

Negotiated simplates have multiple content pages. They should each be syntax highlighted according to the media type on the specline.

I wonder if the best way to do this isn't to somehow import aspen from within Vim and use aspen as a library to determine the media type per page.

What is it supposed to do?

I don't follow. Was the intention to create .spt file type that properly highlights the all the sections in the simplate? If not, can we make it so? ๐Ÿ˜ƒ

highlight speclines

Now that we've got highlighting going for the various sections, we should highlight the speclines themselves.

integrate @mattboehm's work

@mattboehm sent me a simplate.vim in private email following a conversation at PyOhio:

I thought I'd take a stab at getting a vim syntax file working for aspen, since you mentioned it to me during PyOhio.

The attached file seems to cover the basic case (2 Python sections and 1 other section. I used html for convenience, but I suppose the actual default is a different templating language.) It requires that the syntax files for python/html be in the same directory so that it can import them.

It's somewhat hackish and extending this to support all possible simplate files would be a non-trivial effort. Still, hopefully if you choose to revisit this problem, my example provides some help.

It's worth noting that even if the syntax did work perfectly, other vim behavior that is filetype-specific (abbreviations, snippets, filetype-specific plugins, etc.) would not work out of the box. When people do want all this functionality in a file of mixed types, I usually point them towards https://github.com/chrisbra/NrrwRgn .

let main_syntax='simplate'
syntax include @Py <sfile>:p:h/python.vim
syntax include @Html <sfile>:p:h/html.vim
syntax region thirdBlock start=_\[---]_ end=_\%$_ contains=@Html
syntax region firstBlock start=_\%^_ end=/^\[---]/me=e-5 contains=@Py
syntax region secondBlock start=_^\[---]_ end=_^\[---]_me=e-5 contains=@Py nextgroup=thirdBlock

"syntax region firstBlock start=_\%^_ end=/^\[---]/re=e-5 contains=@Py
"syntax region secondBlock start=_\[---]_ end=_^\ze\[---]_ contains=@Py nextgroup=thirdBlock

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.