Skip to content

Commit

Permalink
Merge pull request #383 from LimoWanKenobi/code_blocks_width_in_safari
Browse files Browse the repository at this point in the history
Fixes code-block's width in safari
  • Loading branch information
tpetricek committed Feb 2, 2016
2 parents a1e0d8f + b78f7dc commit 5baf9eb
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 89 deletions.
31 changes: 16 additions & 15 deletions docs/files/content/style.css
@@ -1,7 +1,7 @@
@import url(https://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono|Open+Sans:400,600,700);

/*--------------------------------------------------------------------------
Formatting for F# code snippets
/*--------------------------------------------------------------------------
Formatting for F# code snippets
/*--------------------------------------------------------------------------*/

/* strings --- and stlyes for other string related formats */
Expand Down Expand Up @@ -40,7 +40,7 @@ span.prep { color:#af75c1; }
span.fsi { color:#808080; }

/* omitted */
span.omitted {
span.omitted {
background:#3c4e52;
border-radius:5px;
color:#808080;
Expand All @@ -59,7 +59,7 @@ table.pre pre {
padding:0px;
margin:0px;
border:none;
}
}
table.pre, pre.fssnip, pre {
line-height:13pt;
border:1px solid #d8d8d8;
Expand All @@ -71,7 +71,8 @@ table.pre, pre.fssnip, pre {
background-color:#212d30;
padding:10px;
border-radius:5px;
color:#d1d1d1;
color:#d1d1d1;
max-width: none;
}
pre.fssnip code {
font: 9pt 'Droid Sans Mono',consolas,monospace;
Expand All @@ -91,7 +92,7 @@ table.pre td.lines {
width:30px;
}

/*--------------------------------------------------------------------------
/*--------------------------------------------------------------------------
Formatting for page & standard document content
/*--------------------------------------------------------------------------*/

Expand Down Expand Up @@ -159,7 +160,7 @@ td.title, thead {
#main li { font-size: 11pt; margin: 5px 0px 5px 0px; }
#main strong { font-weight:700; }

/*--------------------------------------------------------------------------
/*--------------------------------------------------------------------------
Formatting for API reference
/*--------------------------------------------------------------------------*/

Expand Down Expand Up @@ -191,8 +192,8 @@ td.title, thead {
.github-link .normal { display: block; }
.github-link:hover .normal { display: none; }

/*--------------------------------------------------------------------------
Links
/*--------------------------------------------------------------------------
Links
/*--------------------------------------------------------------------------*/

h1 a, h1 a:hover, h1 a:focus,
Expand All @@ -202,14 +203,14 @@ h4 a, h4 a:hover, h4 a:focus,
h5 a, h5 a:hover, h5 a:focus,
h6 a, h6 a:hover, h6 a:focus { color : inherit; text-decoration : inherit; outline:none }

/*--------------------------------------------------------------------------
Additional formatting for the homepage
/*--------------------------------------------------------------------------
Additional formatting for the homepage
/*--------------------------------------------------------------------------*/

#nuget {
#nuget {
margin-top:20px;
font-size: 11pt;
padding:20px;
font-size: 11pt;
padding:20px;
}

#nuget pre {
Expand All @@ -221,4 +222,4 @@ h6 a, h6 a:hover, h6 a:focus { color : inherit; text-decoration : inherit; outli
border-style:none;
color: #e0e0e0;
margin-top:15px;
}
}
31 changes: 16 additions & 15 deletions docs/files/content/style_light.css
@@ -1,7 +1,7 @@
@import url(https://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono|Open+Sans:400,600,700);

/*--------------------------------------------------------------------------
Formatting for F# code snippets
/*--------------------------------------------------------------------------
Formatting for F# code snippets
/*--------------------------------------------------------------------------*/

/* identifier */
Expand Down Expand Up @@ -41,7 +41,7 @@ span.prep { color:#0000ff; }
span.fsi { color:#808080; }

/* omitted */
span.omitted {
span.omitted {
background:#3c4e52;
border-radius:5px;
color:#808080;
Expand All @@ -60,7 +60,7 @@ table.pre pre {
padding:0px;
margin:0px;
border:none;
}
}
table.pre, pre.fssnip, pre {
line-height:13pt;
border:1px solid #d8d8d8;
Expand All @@ -72,7 +72,8 @@ table.pre, pre.fssnip, pre {
background-color:#fdfdfd;
padding:10px;
border-radius:5px;
color:#000000;
color:#000000;
max-width: none;
}
pre.fssnip code {
font: 9pt 'Droid Sans Mono',consolas,monospace;
Expand All @@ -92,7 +93,7 @@ table.pre td.lines {
width:30px;
}

/*--------------------------------------------------------------------------
/*--------------------------------------------------------------------------
Formatting for page & standard document content
/*--------------------------------------------------------------------------*/

Expand Down Expand Up @@ -160,7 +161,7 @@ td.title, thead {
#main li { font-size: 11pt; margin: 5px 0px 5px 0px; }
#main strong { font-weight:700; }

/*--------------------------------------------------------------------------
/*--------------------------------------------------------------------------
Formatting for API reference
/*--------------------------------------------------------------------------*/

Expand Down Expand Up @@ -192,8 +193,8 @@ td.title, thead {
.github-link .normal { display: block; }
.github-link:hover .normal { display: none; }

/*--------------------------------------------------------------------------
Links
/*--------------------------------------------------------------------------
Links
/*--------------------------------------------------------------------------*/

h1 a, h1 a:hover, h1 a:focus,
Expand All @@ -203,14 +204,14 @@ h4 a, h4 a:hover, h4 a:focus,
h5 a, h5 a:hover, h5 a:focus,
h6 a, h6 a:hover, h6 a:focus { color : inherit; text-decoration : inherit; outline:none }

/*--------------------------------------------------------------------------
Additional formatting for the homepage
/*--------------------------------------------------------------------------
Additional formatting for the homepage
/*--------------------------------------------------------------------------*/

#nuget {
#nuget {
margin-top:20px;
font-size: 11pt;
padding:20px;
font-size: 11pt;
padding:20px;
}

#nuget pre {
Expand All @@ -222,4 +223,4 @@ h6 a, h6 a:hover, h6 a:focus { color : inherit; text-decoration : inherit; outli
border-style:none;
color: #e0e0e0;
margin-top:15px;
}
}
1 change: 0 additions & 1 deletion docs/tools/template-sidebyside.cshtml
Expand Up @@ -8,7 +8,6 @@
<meta name="author" content="@Properties["project-author"]">

<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
Expand Down
1 change: 0 additions & 1 deletion docs/tools/template.cshtml
Expand Up @@ -8,7 +8,6 @@
<meta name="author" content="@Properties["project-author"]">

<script src="https://code.jquery.com/jquery-1.8.0.js"></script>
<script src="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
Expand Down
43 changes: 21 additions & 22 deletions misc/literate/output/demo-doc.html
Expand Up @@ -2,17 +2,16 @@
<html lang="en">
<head>
<meta charset="utf-8">
<!--
<!--
The Literate sample
parameters will be replaced with the
parameters will be replaced with the
document title extracted from the <h1> element or
file name, if there is no <h1> heading
-->
<title>Literate sample
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://code.jquery.com/jquery-1.8.0.js"></script>
<script src="http://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
Expand All @@ -30,12 +29,12 @@
<div class="span10" id="main">
<h1>Literate sample</h1>

<p>This file demonstrates how to write Markdown document with
embedded F# snippets that can be transformed into nice HTML
<p>This file demonstrates how to write Markdown document with
embedded F# snippets that can be transformed into nice HTML
using the <code>literate.fsx</code> script from the <a href="http://tpetricek.github.com/FSharp.Formatting">F# Formatting
package</a>.</p>

<p>In this case, the document itself is a valid Markdown and
<p>In this case, the document itself is a valid Markdown and
you can use standard Markdown features to format the text:</p>

<ul>
Expand All @@ -47,9 +46,9 @@ <h1>Literate sample</h1>

<h2>Writing F# code</h2>

<p>In standard Markdown, you can include code snippets by
writing a block indented by four spaces and the code
snippet will be turned into a <code>&lt;pre&gt;</code> element. If you do
<p>In standard Markdown, you can include code snippets by
writing a block indented by four spaces and the code
snippet will be turned into a <code>&lt;pre&gt;</code> element. If you do
the same using Literate F# tool, the code is turned into
a nicely formatted F# snippet:</p>

Expand All @@ -64,8 +63,8 @@ <h2>Writing F# code</h2>
</td>
<td class="snippet"><pre class="fssnip">
<span class="c">/// The Hello World of functional languages!</span>
<span class="k">let</span> <span class="k">rec</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="f">factorial</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="i">x</span> <span class="o">=</span>
<span class="k">if</span> <span onmouseout="hideTip(event, 'fs2', 3)" onmouseover="showTip(event, 'fs2', 3)" class="i">x</span> <span class="o">=</span> <span class="n">0</span> <span class="k">then</span> <span class="n">1</span>
<span class="k">let</span> <span class="k">rec</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="f">factorial</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="i">x</span> <span class="o">=</span>
<span class="k">if</span> <span onmouseout="hideTip(event, 'fs2', 3)" onmouseover="showTip(event, 'fs2', 3)" class="i">x</span> <span class="o">=</span> <span class="n">0</span> <span class="k">then</span> <span class="n">1</span>
<span class="k">else</span> <span onmouseout="hideTip(event, 'fs2', 4)" onmouseover="showTip(event, 'fs2', 4)" class="i">x</span> <span class="o">*</span> (<span onmouseout="hideTip(event, 'fs1', 5)" onmouseover="showTip(event, 'fs1', 5)" class="f">factorial</span> (<span onmouseout="hideTip(event, 'fs2', 6)" onmouseover="showTip(event, 'fs2', 6)" class="i">x</span> <span class="o">-</span> <span class="n">1</span>))

<span class="k">let</span> <span onmouseout="hideTip(event, 'fs3', 7)" onmouseover="showTip(event, 'fs3', 7)" class="i">f10</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs1', 8)" onmouseover="showTip(event, 'fs1', 8)" class="f">factorial</span> <span class="n">10</span>
Expand All @@ -76,14 +75,14 @@ <h2>Writing F# code</h2>

<h2>Hiding code</h2>

<p>If you want to include some code in the source code,
but omit it from the output, you can use the <code>hide</code>
command. You can also use <code>module=...</code> to specify that
the snippet should be placed in a separate module
<p>If you want to include some code in the source code,
but omit it from the output, you can use the <code>hide</code>
command. You can also use <code>module=...</code> to specify that
the snippet should be placed in a separate module
(e.g. to avoid duplicate definitions).</p>

<p>The value will be deffined in the F# code that is
processed and so you can use it from other (visible)
<p>The value will be deffined in the F# code that is
processed and so you can use it from other (visible)
code and get correct tool tips:</p>

<table class="pre"><tr><td class="lines"><pre class="fssnip">
Expand All @@ -99,9 +98,9 @@ <h2>Hiding code</h2>

<h2>Including other snippets</h2>

<p>When writing literate programs as Markdown documents,
you can also include snippets in other languages.
These will not be colorized and processed as F#
<p>When writing literate programs as Markdown documents,
you can also include snippets in other languages.
These will not be colorized and processed as F#
code samples:</p>

<table class="pre"><tr><td><pre lang="csharp">Console.WriteLine(<span class="s">"Hello world!"</span>);
Expand All @@ -116,10 +115,10 @@ <h2>Including other snippets</h2>
<div class="tip" id="fs4">val answer : int<br /><br />Full name: demo.answer</div>
<div class="tip" id="fs5">module Hidden<br /><br />from demo</div>
<div class="tip" id="fs6">val answer : int<br /><br />Full name: demo.Hidden.answer<br /><em><br /><br />&#160;This is a hidden answer</em></div>

</div>
<div class="span1"></div>
</div>
</div>
</body>
</html>
</html>

0 comments on commit 5baf9eb

Please sign in to comment.