refactor: more consistent tags to make it easier to iterate over, #524

This commit is contained in:
Jun Yang
2022-11-27 17:29:44 +08:00
parent 4e1a30a20c
commit 1380ac931a
19 changed files with 225 additions and 82 deletions
+16
View File
@@ -0,0 +1,16 @@
import { Liquid } from 'liquidjs'
import { getOutputs } from './get-outputs'
const engine = new Liquid({
root: __dirname,
extname: '.liquid'
})
const templates = engine.parseFileSync('todolist')
for (const output of getOutputs(templates)) {
const token = output.token
const [line, col] = token.getPosition()
const text = token.getText()
console.log(`[${line}:${col}] ${text}`)
}