docs: lead README and pubspec with chat template rendering - #23
Merged
Merged
Conversation
This was referenced Sep 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Puts chat template rendering first on pub.dev: README, Example tab, pubspec description and topics. Docs and metadata only; no behavior change.
What changed
dart pub add dinja, and a runnable Qwen2.5-style example with a system message, a user turn, a tool andadd_generation_prompt. Then Why dinja, input marking, template analysis, a comparison withpackage:jinja, and scope. Removed the false "zero-dependency" claim and the^1.1.0pin.example/chat_template_example.dartis now the README example, andexample/README.mdshows it inline with its output.# pathcomment. Thelib/dinja.dartlibrary doc also dropped "zero-dependency".Topics: pub.dev's
doc/topics.yamlhas no alias for any of them, sojinja2is not merged intojinja.topic:jinjaalready listsjinja_minimal, andtopic:jinja2listed only dinja.security(100+ packages) andai(100+) are too broad, andpromptis used by terminal-prompt packages. pub.dev's text search indexes only the description, the README and API symbols (mem_index.dart), not topics. So the description keepsJinja2, and the README keepsprompt,templateand ahuggingfacetoken (huggingface.co).How each claim was verified
test/llama_cross_test.dartfrom llama.cpp7fe450e1tests/test-jinja.cppgives no diff, anddart test test/llama_cross_test.dartreports +279 ~11. llama.cpp's owntest-jinjaat7fe450e1skips the same 11 asNotImplemented.test-jinja -pywith Jinja2 3.1.6 passes 290/290 with 0 failures.test/fixtures/templateshas 50 files with 45 distinct contents. InstrumentingTemplate.renderand runningtest/templatesshowed that all 45 are rendered.test-jinjaat7fe450e1(0 failures) and through Jinja2 3.1.6 in llama.cpp's transformers-style sandbox (match).common/jinja:tools/servercallscommon_chat_templates_apply, andcommon/chat.cpprunsjinja::runtime.dart test -p chromeanddart test -p chrome -c dart2wasmontest/srcandtest/llama_cross_test.dartboth report +790 ~11. pana tags all six platforms andis:wasm-ready.dinjaand imports it inchat_template_handler.dart.format:extends,block,include,import,rawandwitheach throwParserException, and'%s'|format(1)renders%s.package:jinja: the wording comes from its README ("server-side template engine … template inheritance").Gates
dart formatclean ·dart analyzeno issues ·dart test+892 ~11 ·dart pub publish --dry-run0 warnings · pana 160/160.