Git Product home page Git Product logo

super-tag's Introduction

English | 中文

SuperTag plugin for TiddlyWiki5

Auto generate input form on a tiddler by simply adding a SuperTag to it. Create a SuperTag by compositing existing TraitTags.

See following resources to learn how to use:

Acknowledgement

Use json-editor/json-editor for form rendering. AFAIK joshuafontany/TW5-jsoneditor is using it too.

(Not using eclipsesource/jsonforms because we need vanilly js renderer, without ReactJS).

During development

There are some scripts you can run to boost your development.

After npm i --legacy-peer-deps:

  • npm run dev to pack the plugin in the dist/ directory, this will setup a site that will auto reload when you have changes. But this is development mode, will produce a much larget bundle than the final version, so only for dev.
  • npm run dev-html to setup the demo site locally. Re-run this command and refresh browser to see changes. In this way you can see the real bundle size same as your user will get.

You will need --legacy-peer-deps when npm i if you are using latest nodejs. This is a bug in npm.

Add a second ts file

Add new file name (without .ts) to package.json's tsFiles field. And build script will read it and compile files in it.

After the plugin is complete

Publish

Enable github action in your repo (in your github repo - setting - action - general) if it is not allowed, and when you tagging a new version vx.x.x in a git commit and push, it will automatically publish to the github release.

super-tag's People

Contributors

dongrentianyu avatar linonetwo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

dongrentianyu

super-tag's Issues

对字段排序、设置常用字段

比如把自己常用的排在上面,或者默认显示。

如果是条目维度,应该需要用一两个额外的字段来保存这个信息。当然也可以用设置条目,对所有加了标签的条目都生效。

支持多选

多选还是很常用的。但多选在形式上可能比较难处理。

不能嵌套数据

也不知道是bug还是没开发出来。

image

如果像上面一样嵌套了,就无法点击也无法编辑。

{
  "type": "object",
  "title": "title",
  "properties": {
    "购书时间": {
      "type": "string",
      "format": "date"
    },
    "重读": {
      "type": "object",
      "properties": {
        "field_6": {
          "type": "string",
          "format": "date-time"
        },
        "field_7": {
          "type": "string",
          "format": "date"
        },
        "field_8": {
          "type": "string"
        },
        "field_9": {
          "type": "string"
        }
      },
      "required": [
        "field_6",
        "field_7",
        "field_8",
        "field_9"
      ]
    }
  },
  "required": [
    "购书时间",
    "重读"
  ]
}

随便搞的一个代码。供测试。

翻译字段名

看看如何利用新的 lingo 过程来允许特质标签附带多语言

存在多个超级标签时,应该分开展示

image

我这里其实是用了四个超级标签。但四个超级标签的字段内容都放在一块里去填写了。感觉分开展示的话,会更好。

因为有些书籍可能是购买时,要标注购买的信息。而有些书籍只是看电子书就没必要这样做了。

翻译问题:是否应该根据不同语言配套不同字段内容?

image

平时使用过程中,看着这么多字段,但是单词不认识。虽然我知道去查单词就可以了解,但我想,是不是根据不同语言配套不同的字段内容会更好?

从用户体验上,看见用不上的字段和不理解的内容,就感觉这个东西好难,不会用啊。

Cannot read properties of undefined (reading 'map')

caught TypeError: Cannot read properties of undefined (reading 'map')
    at eval (index.js:44:25)
    at Array.map (<anonymous>)
    at getSuperTagTraits (index.js:42:29)
    at getFullSchemaFromCurrentTiddler (index.js:89:21)
    at SupertagFormWidget.render (index.js:122:45)
    at Widget.renderChildren (widget.js:632:15)
    at ElementWidget.render (element.js:84:7)
    at Widget.renderChildren (widget.js:632:15)
    at ListItemWidget.render (list.js:342:7)
    at Widget.renderChildren (widget.js:632:15)
const traits = tags.map((traitTitle) => {
截屏2023-05-29 16 18 44

如何让用户自定义字段名及对应的字段值?

如果用户可以简单轻松地自定义一些字段名及对应的字段值来选择,那么这个插件将变得更有用。而且可以考虑改名为超级表单插件。我感觉只用来实现任务管理还没有真正发挥出其功能来。

我再仔细看看文档,看能不能找出自定义的方法来。

支持在展示下拉列表时翻译枚举值

具体的值不要翻译,这样保存到字段里的永远是英文,方便筛选器识别。

但是展示UI的时候,先看看能不能拼上 lingo-base。可能需要允许字段级别的 lingo base,不然 enum 一般没有 / 不好拼出字段名

用特质的方式来实现超级标签

在每个乔木下方的模板上查询当前所加的标签的标签,然后看这些标签是否带有超级标签特制的系统标签
但有一个测试就意味着接受它上面的所有字段,没法只选择其中的一些字段
在特制标签上可以声明一下自己使用的字段名到标准,知道你们之间的映射以及可以解释一下这些字段名并提供密码来提供对呃表单的定制化
这样可以解决超级标签的名字没法本地化的问题,因为中间相当于隔了一层,想要本地化的时候,可以创建一个新的本地化的,然后加上那些特质标签就好了

如何改进时间格式的编辑体验

image

如何改进这类时间格式的编辑体验?因为鼠标老是滑不到我要选择的内容。滑过去了又要再滑过来,要浪费不少时间,而且特别容易心态爆炸。

我在网上找不到可以直接在shcema字段里填写选择样式的。

目前是需要返回像17:30这样的数据,因为后面还需要依赖这个排序。

sub task ording字段有问题

因为会一直往下列出内容

\\\\\\\\\\\\\\\\\\\\\\\

我怀疑是筛选器递归出了问题。有待求证并解决。

如何让微件与里面的内容结合起来?

{
  "type": "object",
  "properties": {
    "pppp": {
      "type": "string",
      "enum": [
        <$list filter="[has[pppp]]">"<$text text={{{ [<currentTiddler>get[pppp]] }}}/>",</$list>"0"
      ]
    }
  }
}

我写了一下,但 并没有生效。我以为会和echarts图表一样生效。

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.