Git Product home page Git Product logo

temme's People

Contributors

feichao93 avatar greenkeeper[bot] avatar mwindson 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  avatar  avatar  avatar

temme's Issues

Support Lodash filters in the CLI?

It would be great if we could use Lodash functions as filters rather than (or in addition to) the current builtins, which are a useful but limited subset of the functionality available in Lodash.

I realise they can be added when using temme as a library, but that doesn't help with the CLI tool and requires anyone who wants to add those filters to write their own CLI frontend.

Several CLI tools use Lodash to enhance and extend the standard library e.g.:

新版网站更新进度

新版网站 https://temmejs.org 目前处于 beta 版本,欢迎大家进行体验。在新版网站正式发布之前,仍需要完成下列工作。

  • 部署示例项目
  • 添加/完善 project 导入/导出功能
    • 基本的导入导出功能
    • 导出 project 时使用 meta.json 记录 project 元数据(描述以及页面列表信息)
  • 编辑器中 temme 语法/执行错误提示
  • 完善未登录用户在 project-page 页面中的交互
  • 允许使用 markdown 来书写 project 的描述
    • 优化 markdown 渲染结果的样式
  • 在网站主页中添加示例 projects/pages
  • 用户离开页面时,对未保存的内容进行弹窗提示
  • project 收藏功能
  • 为 temme 实现一套编辑器主题,增强语法高亮效果
  • 将文档部署在网站中
  • 网站中英文切换功能
  • 网站管理页面

一些可选完成的工作:

  • 网站后台管理页面
  • 亮色/暗色主题切换
  • 为用户保存 monaco 编辑器的配置,并允许用户在网站中修改配置

Refine scripts for development and deployment.

开发和打包的脚本完善:

  • 开发时, 运行jest来自动化测试, 使用fs来载入语法; 直接使用源代码进行测试
  • 运行yarn run build时, 使用webpack pegjs-loader来载入语法
  • 将pegjs放到devDependencies中
  • 运行yarn run build-playground来编译playground

Enhance selector syntax.

  • Change filter syntax from : to |
  • Support for pseudo-class like :root, :first-child
  • Support multiple selectors at root level.
  • Support for filter arguments, e.x. $foo|split(',')|slice(0, 10).
  • Support for JavaScript comment syntax within selecotr.
  • Add support for empty selector whose result is always null.
  • Add support for value assignment, e.x., $a = 'abc'.
  • Add support for JavaScript literals, which includes null, boolean, numeric, string and RegExp.
  • Add support for using JS literals as filter arguments or as the right part of assignments.
  • Allow ; to be selector seprator.
  • Refactor content capture syntax.
  • Change children selector brackets from () to {}.
  • Use css.pegjs to enhance grammar.
    • Add support for universal element selector *.
    • Add support for css combinator syntax which includes > , + and ~.
    • Add support for all attribute operators which includes =, ~=, |=, *=, ^=, $=.
    • Add tests
  • Add support for multiple attribute qualifiers in one pair of brackets..
  • Add support for customized content function.

建议提供从多个选择器捕获的功能

感谢作者提供了这么有趣 & 好用的功能。

我在把之前 cheerio 写的逻辑改成 temme 文件时,遇到了这么一个问题:

let title = $el.find('.res-title').text() || $el.find('.mh-title').text() || $el.find('.os-title').text() || 'no title';

我的 title 需要从三个元素中查找,以第一个非空值为准,如果都找不到就用默认值。以 temme 现有的功能,目前不太好实现。

请作者帮忙看下。

Version 0.5

  • experimental Add support for snippets.
    • Snippets define.
    • Snippets expand.
    • Circular expansion detection.
  • experimental Content functions
  • Add support for pseudo-qualifiers.
  • Array-filters ||
  • Inline filter definition
  • More tests

Version 0.7

  • VSCode 拓展
    • 语法高亮
    • 语法错误检查和提示
    • 在 VSCode 编辑器中运行选择器
  • 允许在自定义选择器中使用 require
  • 新增可用于浏览器环境的 build
  • 相关 BUG 修复
    • 修复无法解析 JS 负数字面量的 BUG
    • parent reference & 相关语法错误

已移除:在线版本中使用 VSCode 编辑器(Monaco Editor)
原因:Monaco 编辑器无法使用 textmate 语法

已移除:在解析结果中提供符号位置
原因:嫌麻烦

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

version 0.8

v0.8 将带来若干更新,主要包括 modifier 机制和 CaptureResult 的简化。下面是距离发布 v0.8 仍要完成的工作列表:

  • modifier ( #34 )
  • 简化 content,简化之后 content 中只允许出现一个 capture/assignment/call(已经在 #34 中实现)
  • 项目结构调整
  • 调整单元测试:去掉过于复杂的用例,去掉重复的用例,调整目录结构
  • 文档更新:介绍 modifier 机制与内置的 modifier
  • 文档更新:介绍简化之后的 content 机制(已经更名为 procedure)与类 CaptureResult
  • API 文档更新:
    • 移除了 contentFunctions;
    • 新增 defineContentFunction 来设置自定义内容函数;
    • temme 函数参数更新
  • playground:添加对 modifier 的支持
  • vscode-temme:添加对 modifier 的支持

:first-child

关于:first-child无法使用 希望可以得到一个解决方案 例如出现

<div class="left">
  <h3>北京市</h3>
  <p>已接入<em class="data-margin-s">23</em></p>
  <p>未接入<em class="data-margin-s">0</em></p>
  <p>累计直播<em class="data-margin-b">1449</em></p>
</div>

需要得到已接入量未接入量

建议新增scss语法和对象合并支持

类似于:
form .mainbox.viewthread@list{
.postauthor@@author{
cite a[id^=userinfo]{$name};
p:nth-of-type(1){$level};
}
.postcontent{$content|html}
}

output:
[
{
author: { name: "111", level: "222" },
content: "fdjsfkfdf"
}
]

Allow spaces around the pipe operator

Please allow spaces to be used around the pipe operator (|). They make filters much easier to read.

Before:

div.movies@ {
    .title { $title };
    .date { $date };
    .duration { $duration|match("\\d+")|get(0)|Number };
}

After:

div.movies@ {
    .title { $title };
    .date { $date };
    .duration { $duration | match("\\d+") | get(0) | Number };
}

逻辑判断

你好,如果有一个类似如这样的html片段,内容不同,如何抓取这个list呢
能提供一下思路吗,感谢(・ω・)ノ

  <li class="t"><p>2132</p></li>
  <li class="t"><p>2132</p></li>
  <li class="p"><img></img></li>
  <li class="f"><h2><h2><p></p></li>

    An in-range update of prettier is breaking the build 🚨

    The devDependency prettier was updated from 1.15.2 to 1.15.3.

    🚨 View failing branch.

    This version is covered by your current version range and after updating it in your project the build failed.

    prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

    Status Details
    • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

    Release Notes for 1.15.3

    🔗 Changelog

    FAQ and help

    There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


    Your Greenkeeper Bot 🌴

    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.