Skip to content

Commit

Permalink
Italicize first (wpilibsuite#1434)
Browse files Browse the repository at this point in the history
* Italicize FIRST everywhere

The text "FIRST" appears on the page in a number of spots where we can't italicize it normally in the RST (navbar heading, copywrite notice, etc.) so this JS finds all instances and italicizes.

* Remove extra spaces

Remove extra spaces
  • Loading branch information
Kevin-OConnor authored Sep 29, 2021
1 parent f29b5d9 commit 72f3ce6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/_static/js/italicize_first.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$(document).ready(function () {
// get all body content as a string
var str = document.body.innerHTML;

// find all magic words and wrap them in a <em> tag
var result = str.replace(/(FIRST)/g, "<em>$1</em>");

// set all body content HTML with new processed content
document.body.innerHTML = result;
});
3 changes: 3 additions & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ def setup(app):
# Launch external links in a new tab/window
app.add_js_file("js/external-links-new-tab.js")

# Italicize instances of FIRST
app.add_js_file("js/italicize_first.js")


# -- Options for latex generation --------------------------------------------

Expand Down

0 comments on commit 72f3ce6

Please sign in to comment.