Skip to content

Commit

Permalink
Font update & Code Highlighting (google#6420)
Browse files Browse the repository at this point in the history
* Changes title fonts to use Google Sans

* Enables code highlighting
  • Loading branch information
petele authored Jul 24, 2018
1 parent 813a948 commit 5e4d84c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion devsiteParseHTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def parse(requestPath, fileLocation, content, lang='en'):
context['footerLinks'] = item['linkboxes']

# Replaces <pre> tags with prettyprint enabled tags
body = re.sub(r'^<pre>(?m)', r'<pre class="prettyprint">', body)
body = re.sub(r'^<pre>(?m)', r'<pre class="prettyprint devsite-code-highlight">', body)
# Adds code highlighting support, which requires devsite-code-highlight
body = re.sub(r'^<pre class="prettyprint">(?m)', r'<pre class="prettyprint devsite-code-highlight">', body)

context['content'] = body

Expand Down
4 changes: 3 additions & 1 deletion devsiteParseMD.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def parse(requestPath, fileLocation, content, lang='en'):
content = md.convert(content)

# Replaces <pre> tags with prettyprint enabled tags
content = re.sub(r'^<pre>(?m)', r'<pre class="prettyprint">', content)
content = re.sub(r'^<pre>(?m)', r'<pre class="prettyprint devsite-code-highlight">', content)
# Adds code highlighting support, which requires devsite-code-highlight
content = re.sub(r'^<pre class="prettyprint">(?m)', r'<pre class="prettyprint devsite-code-highlight">', content)

# Save the content
context['content'] = content
Expand Down
2 changes: 1 addition & 1 deletion gae/includes/page-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="https://developers.google.com/web/{{ requestPath }}">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,400italic,500,500italic,700,700italic|Roboto+Mono:400,500,700|Material+Icons">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Google+Sans:400|Roboto:400,400italic,500,500italic,700,700italic|Roboto+Mono:400,500,700|Material+Icons">
<link rel="stylesheet" href="/wf-local/styles/devsite-{{ projectYaml.color }}.css">
<title>{{ pageTitle }}</title>
{% include "includes/head-embedded-styles.html" %}
Expand Down
2 changes: 1 addition & 1 deletion gae/page-base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% if fullWidth %}devsite-full-width-page{% endif %}
{% if lowerTabs|length < 2 or not lowerTabs %}devsite-header-no-lower-tabs{% endif %}
{% endspaceless %}"
id="top_of_page">
data-family="endorsed" id="top_of_page">
<div class="devsite-wrapper">
<div class="devsite-top-section-wrapper">
<header class="devsite-top-section nocontent">
Expand Down

0 comments on commit 5e4d84c

Please sign in to comment.