Skip to content

feat: Add an option for /doc/html that renders as HTML#10016

Open
martinthomson wants to merge 4 commits intoietf-tools:mainfrom
martinthomson:html-html
Open

feat: Add an option for /doc/html that renders as HTML#10016
martinthomson wants to merge 4 commits intoietf-tools:mainfrom
martinthomson:html-html

Conversation

@martinthomson
Copy link
Copy Markdown
Contributor

This tries to make the HTML rendering look good, using the native bootstrap styling as much as I can be bothered to do for now.

I've retained the HTML-that-looks-like-text default.

Preview:

image

Dark:

image

This tries to make the HTML rendering look good, using the native
bootstrap styling as much as I can be bothered to do for now.
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 27, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.54%. Comparing base (ff75680) to head (32f25ee).
⚠️ Report is 109 commits behind head on main.

Files with missing lines Patch % Lines
ietf/doc/views_doc.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10016      +/-   ##
==========================================
- Coverage   88.55%   88.54%   -0.01%     
==========================================
  Files         317      317              
  Lines       42343    42387      +44     
==========================================
+ Hits        37496    37531      +35     
- Misses       4847     4856       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@martinthomson martinthomson changed the title Add an option for /doc/html that renders as HTML feat: Add an option for /doc/html that renders as HTML Nov 27, 2025
@martinthomson
Copy link
Copy Markdown
Contributor Author

@larseggert, you might have some insight into whether this is complete enough to preview given your experience of how this was put together.

Copy link
Copy Markdown
Collaborator

@larseggert larseggert left a comment

Choose a reason for hiding this comment

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

LGTM in terms of the code. (Which wasn't pretty to begin with.) We should somehow remove display options ratehr than adding them, but 🤷.

Nit: Why is the metadata block not left-adjusted? Having it kinda-but-not-quite centered looks weird to me.

@martinthomson
Copy link
Copy Markdown
Contributor Author

The metadata block is left-adjusted, but I haven't spent a lot of time tweaking anything here, so some of the sizes are probably off, based on the choice of fonts and other things. So the left padding, which needs to be long enough to handle the longest possible label in that block, is probably a little bit more generous than it needs to be. I spotted a few minor errors like that; there will likely be more, but it might be OK as a non-default option to iterate that way.

martinthomson added a commit to martinthomson/datatracker that referenced this pull request Nov 28, 2025
This is a little hacky in that it relies on xml2rfc inserting `<dd
class="break"></dd>` after each reference, but that seems to be
something that we can rely on consistently across the series.

This is, as far as I can tell, character-for-character identical to the
placement used in xml2rfc's text generation output.  I had to make a
small tweak to the layout for regular definition lists as well, but
that's fairly minor (it was missing an indent).

See martinthomson/rfc-txt-html#13 for a
discussion on the fix.

Based on ietf-tools#10016, but this could be retargeted at main if that makes more
sense.
@martinthomson
Copy link
Copy Markdown
Contributor Author

The test failures here seem unrelated:

FAIL: test_leadership_wg (ietf.group.tests.GroupLeadershipTests.test_leadership_wg)

@kesara
Copy link
Copy Markdown
Member

kesara commented Dec 9, 2025

@martinthomson, Is your motivation behind this to add an option to display HTML similar to what xml2rfc --html output?

Copy link
Copy Markdown
Member

@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

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

My comment about proliferation of styles on #10024 really belongs here, I guess. Another option is ok with me now, but wouldn't want the number to keep growing.

@martinthomson
Copy link
Copy Markdown
Contributor Author

@kesara, more or less. Though it's not that simple. The stylesheet needs to integrate with datatracker to pick up things like light/dark modes, colors, and fonts.

I acknowledge the style proliferation, but I think we have people who want non-txt-looking HTML, even if the "brand" is monospaced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants