Skip to content

Commit 1f4bce9

Browse files
HTML: add warning to page when built with build-preview
1 parent 2d897ad commit 1f4bce9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

css/components/elements/_misc-content.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ article.theorem-like .emphasis {
151151
overflow-x: auto;
152152
}
153153

154+
.preview-build-warning {
155+
background-color: rgb(249, 240, 240);
156+
border: 2px solid rgb(202, 38, 38);
157+
border-radius: 2px;
158+
color: #333;
159+
padding: 10px;
160+
margin: 10px 0;
161+
}
154162

155163

156164
/* Adapted from William Hammond (attributed to David Carlisle) */

xsl/pretext-html.xsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11042,6 +11042,9 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
1104211042
</xsl:attribute>
1104311043
</xsl:if>
1104411044
<div id="ptx-content" class="ptx-content">
11045+
<xsl:if test="$b-build-preview">
11046+
<div class="preview-build-warning">Preview build. Links and knowls that cross pages may not function correctly.</div>
11047+
</xsl:if>
1104511048
<xsl:if test="$b-printable">
1104611049
<xsl:apply-templates select="." mode="print-button"/>
1104711050
</xsl:if>

0 commit comments

Comments
 (0)