Skip to content

Commit c78bbf8

Browse files
HTML: add warning to page when built with build-preview
1 parent 2845f08 commit c78bbf8

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

css/components/elements/_misc-content.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,16 @@ article.theorem-like .emphasis {
155155
font-style: oblique;
156156
}
157157

158+
.preview-build-warning {
159+
background-color: rgb(249, 240, 240);
160+
border: 2px solid rgb(202, 38, 38);
161+
border-radius: 2px;
162+
color: #333;
163+
padding: 10px;
164+
margin: 10px 0;
165+
}
166+
167+
158168
/* Adapted from William Hammond (attributed to David Carlisle) */
159169
/* "mathjax-users" Google Group, 2015-12-27 */
160170

xsl/pretext-html.xsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11204,6 +11204,9 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
1120411204
</xsl:attribute>
1120511205
</xsl:if>
1120611206
<div id="ptx-content" class="ptx-content">
11207+
<xsl:if test="$b-build-preview">
11208+
<div class="preview-build-warning">Preview build. Links and knowls that cross pages may not function correctly.</div>
11209+
</xsl:if>
1120711210
<xsl:if test="$b-printable">
1120811211
<div class="print-preview-header">
1120911212
<xsl:apply-templates select="." mode="print-preview-header"/>

0 commit comments

Comments
 (0)