GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - BaseMax/TinyTagEngineJS: Javascript: Sometimes you need to get input from the user that contains the symbols you want to tag, and render these tags.

BranchesTags
Open more actions menu

Latest commit

 

History

27 Commits
27 Commits

Folders and files

NameName
Last commit message
Last commit date
LICENSE
LICENSE
 
 
README.md
README.md
 
 
demo.png
demo.png
 
 
example.html
example.html
 
 
tag-engine.js
tag-engine.js
 
 

Repository files navigation

Tiny TagEngine JS

Sometimes you need to get input from the user that contains the symbols you want to tag.

By this tiny library you are able to convert input text into your own tags and renders these.

It can be used in React/Vuejs as well, although the example I implemented has been implemented in Pure JS.

Demo - Tiny TagEngine JS

Input

<center>[feature:1]</center><br>[feature:2]<hr>[mine:1234]<hr>[your:hi]<hr>[slider:12123]<hr>[myown:234234]<hr>...<p>Hello!</p>

Output

<center><feature id=></feature></center><br><feature id=></feature><hr><mine id=></mine><hr><your id=></your><hr><slider id=></slider><hr><myown id=></myown><hr>...<p>Hello!</p>

Demo

If you are going to test and watch a demo, the demo available online on: https://basemax.github.io/TinyTagEngineJS/example.html

Using

If you are going to use .js script on GitHub, you can use https://raw.githubusercontent.com/BaseMax/TinyTagEngineJS/main/tag-engine.js url.

Load this:

<script src="https://raw.githubusercontent.com/BaseMax/TinyTagEngineJS/main/tag-engine.js" type="text/javascript"></script>

And next:

const input = `<center>[feature:1]</center><br>[feature:2]<hr>[mine:1234]<hr>[your:hi]<hr>[slider:12123]<hr>[myown:234234]<hr>...<p>Hello!</p>`;
const res = tag_engine(input, {
    "feature": (id) => `<feature id=${id}></feature>`,
    "slider": (id) => `<slider id=${id}></slider>`,
    "myown": (id) => `<myown id=${id}></myown>`,
    "your": (id) => `<your id=${id}></your>`,
    "mine": (id) => `<mine id=${id}></mine>`,
});
console.log(res);

© Copyright Max Base, 2021

About

Javascript: Sometimes you need to get input from the user that contains the symbols you want to tag, and render these tags.

basemax.github.io/TinyTagEngineJS/example.html

Topics

htmljstag-enginetemplate-enginetemplate-engine-htmltemplate-engine-js

Resources

Readme
GPL-3.0 license
Activity

Stars

4 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.