Skip to content

feat: add Html type - #14935

Merged
Vtec234 merged 9 commits into
masterfrom
html-type
Oct 1, 2026
Merged

Vtec234 merged 9 commits into
masterfrom
html-type

Conversation

@Vtec234

@Vtec234 Vtec234 commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

This PR adds a type Lean.Data.Html of HTML forests — aimed primarily at authoring HTML (as opposed to internal representation in a web server, etc) — as well as a renderer that produces a String object.

Rendering directly into FS.Stream is out of scope for this PR.

The associated downstream-lean4 PR adopts the new type and renderer throughout packages included in the release process.

@Vtec234 Vtec234 added the downstream Request a downstream-lean4 adaptation PR. label Aug 27, 2026
@Vtec234
Vtec234 changed the base branch from master to downstream-green August 27, 2026 04:08
@github-actions github-actions Bot added toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN labels Aug 27, 2026
@leanprover-bot leanprover-bot added the builds-manual CI has verified that the Lean Language Reference builds against this PR label Aug 27, 2026
@leanprover-bot

leanprover-bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Aug 27, 2026
@mathlib-lean-pr-testing

mathlib-lean-pr-testing Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

Mathlib CI status (docs):

Comment thread src/Lean/Data/Html/Basic.lean Outdated
Comment thread src/Lean/Data/Html/Basic.lean Outdated
Comment thread src/Lean/Data/Html/Basic.lean Outdated
Comment thread src/Lean/Data/Html/Basic.lean Outdated
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Aug 31, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Aug 31, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Aug 31, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Sep 2, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Sep 2, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Sep 2, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Sep 2, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Sep 2, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Sep 2, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Sep 2, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Sep 2, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Sep 2, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Sep 2, 2026
Comment thread src/Lean/Data/Html/Basic.lean Outdated

namespace Lean

/-- A forest of HTML trees.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/-- A forest of HTML trees.
/--
A forest of HTML trees.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also expand this a little bit, because "forest of trees" may not be immediately obvious.

What about something like:

HTML content, which may be either a single node or a sequence of sibling nodes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed wording. To clarify - why does the newline matter?

Comment thread src/Lean/Data/Html/Basic.lean Outdated
This type is optimized for convenient authoring of HTML documents.
It is not formally related to
the [HTML DOM representation](https://html.spec.whatwg.org/dev/dom.html).
It is analogous to React's [Fragment](https://react.dev/reference/react/Fragment). -/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It is analogous to React's [Fragment](https://react.dev/reference/react/Fragment). -/
It is analogous to React's [Fragment](https://react.dev/reference/react/Fragment).
-/

How stable is that link? We don't yet have a link checker as part of Lean CI for external links.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has existed since 2023. React have moved their docs across domains once already, although the old link from 2018 (https://reactjs.org/docs/fragments.html) continues to work.

Comment thread src/Lean/Data/Html/Basic.lean Outdated
Comment thread src/Lean/Data/Html/Basic.lean Outdated
Comment thread src/Lean/Data/Html/Basic.lean Outdated
Comment thread src/Lean/Data/Html/Basic.lean Outdated
Comment thread src/Lean/Data/Html/Basic.lean Outdated
Comment thread src/Lean/Data/Html/Basic.lean Outdated
Comment thread src/Lean/Data/Html/Printer.lean Outdated
Comment thread src/Lean/Data/Html/Printer.lean Outdated
@Vtec234
Vtec234 force-pushed the html-type branch 2 times, most recently from c9c2cd6 to 3d62c05 Compare September 22, 2026 22:07
@Vtec234
Vtec234 removed this pull request from stack #15148 October 1, 2026 22:32
@Vtec234
Vtec234 changed the base branch from downstream-green to master October 1, 2026 22:32
@Vtec234
Vtec234 added this pull request to the merge queue Oct 1, 2026
Merged via the queue into master with commit 001a6b6 Oct 1, 2026
21 checks passed
@Vtec234
Vtec234 deleted the html-type branch October 2, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-manual CI has verified that the Lean Language Reference builds against this PR builds-mathlib CI has verified that Mathlib builds against this PR changelog-added downstream Request a downstream-lean4 adaptation PR. mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants