mirror of
https://github.com/boostorg/website-v2.git
synced 2026-01-19 04:42:17 +00:00
This commit is contained in:
@@ -11,7 +11,9 @@ repos:
|
||||
- id: check-merge-conflict
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
exclude: ^core/tests/content/boost_release[a-zA-Z_]+.html
|
||||
- id: trailing-whitespace
|
||||
exclude: ^core/tests/content/boost_release[a-zA-Z_]+.html
|
||||
- repo: https://github.com/ambv/black
|
||||
rev: 23.3.0
|
||||
hooks:
|
||||
|
||||
@@ -45,6 +45,7 @@ REMOVE_TAGS = [
|
||||
# very prominent header
|
||||
# /docs/libs/1_82_0/libs/locale/doc/html/index.html
|
||||
("div", {"id": "top"}),
|
||||
("div", {"id": "footer"}),
|
||||
# almost every other page has this as a header
|
||||
("table", {"cellpadding": "2", "width": "100%"}),
|
||||
]
|
||||
|
||||
23
core/tests/content/boost_release_notes_filtered_output.html
Normal file
23
core/tests/content/boost_release_notes_filtered_output.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<h2>Version 1.20.1</h2><p><span class='news-date"'>January 10th, 2001 12:00 GMT</span></p><ul>
|
||||
<li>
|
||||
<a class="text-sky-600" href="/boost/compressed_pair.hpp">compressed_pair.hpp</a> minor
|
||||
update fixes test failures of other libraries under VC++.
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a class="text-sky-600" href="/libs/graph/doc/table_of_contents.html">Graph Library</a>
|
||||
minor
|
||||
updates.
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a class="text-sky-600" href="/libs/regex/index.html">Regular Expression Library</a> minor
|
||||
updates.
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
Minor website fixes including missing files in boost_all.zip.
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
101
core/tests/content/boost_release_notes_sample.html
Normal file
101
core/tests/content/boost_release_notes_sample.html
Normal file
@@ -0,0 +1,101 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>Version 1.20.1</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="icon" href="/favicon.ico" type="image/ico" />
|
||||
<link rel="stylesheet" type="text/css" href="/style-v2/section-boost.css" />
|
||||
|
||||
<style type="text/css">
|
||||
/*<![CDATA[*/
|
||||
#content .news-description ul {
|
||||
list-style: none;
|
||||
}
|
||||
#content .news-description ul ul {
|
||||
list-style: circle;
|
||||
}
|
||||
/*]]>*/
|
||||
</style>
|
||||
|
||||
<!--[if IE 7]> <style type="text/css"> body { behavior: url(/style-v2/csshover3.htc); } </style> <![endif]-->
|
||||
<script defer data-domain="original.boost.org" src="https://plausible.io/js/script.js"></script></head>
|
||||
<!-- Don\'t edit this page! It\'s generated by site-tools/site-tools.py -->
|
||||
<body>
|
||||
<div id="heading">
|
||||
<!--#include virtual="/common/heading.html" --> </div>
|
||||
|
||||
<div id="body">
|
||||
<div id="body-inner">
|
||||
<div id="content">
|
||||
<div class="section" id="intro">
|
||||
<div class="section-0">
|
||||
<div class="section-title">
|
||||
<h1>Version 1.20.1</h1>
|
||||
</div>
|
||||
|
||||
<div class="section-body">
|
||||
<h2><span class=
|
||||
"news-title">Version 1.20.1</span></h2>
|
||||
|
||||
<p><span class=news-date">January 10th, 2001 12:00 GMT</span></p>
|
||||
|
||||
|
||||
<div class="news-description">
|
||||
<div class="description">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<div>
|
||||
<a href="/boost/compressed_pair.hpp">compressed_pair.hpp</a> minor
|
||||
update fixes test failures of other libraries under VC++.
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<span class="library"><a href="/libs/graph/doc/table_of_contents.html">Graph Library</a></span>
|
||||
minor
|
||||
updates.
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<span class="library"><a href="/libs/regex/index.html">Regular Expression Library</a></span> minor
|
||||
updates.
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
Minor website fixes including missing files in boost_all.zip.
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="sidebar">
|
||||
<!--#include virtual="/common/sidebar-common.html" --><!--#include virtual="/common/sidebar-boost.html" --> </div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
<div id="footer-left">
|
||||
<div id="copyright">
|
||||
<p>Copyright Rene Rivera 2006-2007.</p>
|
||||
</div><!--#include virtual="/common/footer-license.html" --> </div>
|
||||
|
||||
<div id="footer-right">
|
||||
<!--#include virtual="/common/footer-banners.html" --> </div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -17,9 +17,9 @@ from core.htmlhelper import (
|
||||
remove_tables,
|
||||
remove_tags,
|
||||
style_links,
|
||||
modernize_release_notes,
|
||||
)
|
||||
|
||||
|
||||
BASE_HEAD = """
|
||||
<link rel="stylesheet" href="mystyle.css" />
|
||||
<meta charset="utf-8" />
|
||||
@@ -764,3 +764,14 @@ def test_style_links_no_links():
|
||||
# Assertions
|
||||
for a_tag in soup.find_all("a"):
|
||||
assert new_class_name in a_tag.get("class", []), "Class not added to link"
|
||||
|
||||
|
||||
def test_modernize_release_notes():
|
||||
content = open("core/tests/content/boost_release_notes_sample.html", "rb").read()
|
||||
output = modernize_release_notes(content)
|
||||
expected_output = (
|
||||
open("core/tests/content/boost_release_notes_filtered_output.html")
|
||||
.read()
|
||||
.strip()
|
||||
)
|
||||
assert output == expected_output
|
||||
|
||||
Reference in New Issue
Block a user