Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit51a106e

Browse files
committed
Import <cxx-codeblock>.
Also update <pre> margins so they reflect the spacing in the LaTeXversion of the standard.
2 parentsf7fa000 +72d1d45 commit51a106e

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

‎base.css‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ p:first-child, ul, ol {margin-top: 0}
7474
del {text-decoration: line-through;color:#8B0040;}
7575
ins {text-decoration: underline;color:#005100;}
7676

77-
pre {margin-left:1em; }
77+
pre {
78+
margin-left:1em;
79+
margin-top:.5em;
80+
margin-bottom:.5em;
81+
}
7882
pre>code {display: inline-block; }
7983

8084

‎codeblock.html‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!-- Copyright 2014 Google Inc. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
-->
15+
16+
<!-- Code Block
17+
Code block elements are used to wrap program fragments in C++.
18+
19+
For improved source clarity, this element removes leading and trailing
20+
whitespace from its contents.
21+
22+
This element also prevents the HTML parser from ending a surrounding <p> tag
23+
when it sees the opening <pre>.
24+
25+
TODO: This could call into a syntax highlighter that styles
26+
comments correctly.
27+
-->
28+
<polymer-elementname="cxx-codeblock">
29+
<template>
30+
<style>
31+
:host { display: block; }
32+
</style>
33+
<pre><code><content></content></code></pre>
34+
</template>
35+
<script>
36+
Polymer('cxx-codeblock',{
37+
attached:function(){
38+
if(this.firstChild.nodeType==Node.TEXT_NODE)
39+
this.firstChild.nodeValue=this.firstChild.nodeValue.replace(/^\s+/,'');
40+
if(this.lastChild.nodeType==Node.TEXT_NODE)
41+
this.lastChild.nodeValue=this.lastChild.nodeValue.replace(/\s+$/,'');
42+
}
43+
});
44+
</script>
45+
</polymer-element>
46+

‎framework.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@
3737
<linkrel="import"href="term.html"/>
3838
<linkrel="import"href="publish.html"/>
3939
<linkrel="import"href="range.html"/>
40+
<linkrel="import"href="codeblock.html"/>
4041
<linkrel="import"href="grammar.html"/>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp