[PR #841] [CLOSED] feat: add constants syntax #1070

Closed
opened 2026-02-17 17:21:40 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/841
Author: @hntrl
Created: 10/11/2025
Status: Closed

Base: mainHead: hunter/model-tags


📝 Commits (3)

  • 8485d4e feat: add constants syntax
  • 230c560 Merge branch 'main' into hunter/model-tags
  • 1d257d5 Merge branch 'main' into hunter/model-tags

📊 Changes

4 files changed (+119 additions, -0 deletions)

View changed files

pipeline/preprocessors/constants_map.py (+16 -0)
pipeline/preprocessors/handle_constants.py (+44 -0)
📝 pipeline/preprocessors/markdown_preprocessor.py (+4 -0)
tests/unit_tests/test_handle_constants.py (+55 -0)

📄 Description

chatty-g cooked this one up. basic idea is that we specify what the "latest and greatest" model/model strings is this constants map once and use it throughout docs:

Summary

  • Introduce a reusable CONSTANTS_MAP registry so docs can reference shared strings with the $[...] token syntax.
  • Add a replace_constants preprocessor that swaps tokens for their mapped values, leaves unknown constants untouched, and supports escaping.
  • Wire the new substitution step into preprocess_markdown and cover the behaviour with focused unit tests, including a smoke test of the full markdown pipeline.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/841 **Author:** [@hntrl](https://github.com/hntrl) **Created:** 10/11/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `hunter/model-tags` --- ### 📝 Commits (3) - [`8485d4e`](https://github.com/langchain-ai/docs/commit/8485d4e376ad534108fbb1f1a7eda175e3471c1c) feat: add constants syntax - [`230c560`](https://github.com/langchain-ai/docs/commit/230c5600c6e3c953ca5e1802b3e8afc8478ef4be) Merge branch 'main' into hunter/model-tags - [`1d257d5`](https://github.com/langchain-ai/docs/commit/1d257d5f0d3df9ca83fdb2efa05cb0ec89899fb6) Merge branch 'main' into hunter/model-tags ### 📊 Changes **4 files changed** (+119 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `pipeline/preprocessors/constants_map.py` (+16 -0) ➕ `pipeline/preprocessors/handle_constants.py` (+44 -0) 📝 `pipeline/preprocessors/markdown_preprocessor.py` (+4 -0) ➕ `tests/unit_tests/test_handle_constants.py` (+55 -0) </details> ### 📄 Description chatty-g cooked this one up. basic idea is that we specify what the "latest and greatest" model/model strings is this constants map once and use it throughout docs: ### Summary - Introduce a reusable CONSTANTS_MAP registry so docs can reference shared strings with the $[...] token syntax. - Add a replace_constants preprocessor that swaps tokens for their mapped values, leaves unknown constants untouched, and supports escaping. - Wire the new substitution step into preprocess_markdown and cover the behaviour with focused unit tests, including a smoke test of the full markdown pipeline. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-17 17:21:40 -05:00
yindo closed this issue 2026-02-17 17:21:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#1070