Gist -- how to set the height and width of an embedded Gist - gist

For purposes of embedding very long Gists from Github in a Wordpress blog, what code will permit me to set the height so that vertical scroll-bars are generated? Something around 500px would be perfect.
EDIT: The issue is now resolved, but I spent so much time on this issue, I believe it would be helpful to have a thread dedicated to that issue. I've posted an answer below that is working.

<style type="text/css">
.gist {width:500px !important;}
.gist-file
.gist-data {max-height: 500px;max-width: 500px;}
</style>
<script src="https://gist.github.com/user-name/123456789.js"></script>
Example: Boilerplate webpage borrowed from : http://www.dummies.com/how-to/content/a-sample-web-page-in-html.html [The answer works as advertised as of February 24, 2016 with Firefox 44.0.2 on OSX Snow Leopard 10.6.8.]
<html>
<!-- Text between angle brackets is an HTML tag and is not displayed.
Most tags, such as the HTML and /HTML tags that surround the contents of
a page, come in pairs; some tags, like HR, for a horizontal rule, stand
alone. Comments, such as the text you're reading, are not displayed when
the Web page is shown. The information between the HEAD and /HEAD tags is
not displayed. The information between the BODY and /BODY tags is displayed.-->
<head>
<title>Enter a title, displayed at the top of the window.</title>
</head>
<!-- The information between the BODY and /BODY tags is displayed.-->
<style type="text/css">
.gist {width:300px !important;}
.gist-file
.gist-data {max-height: 300px;max-width: 300px;}
</style>
<body>
<h1>Enter the main heading, usually the same as the title.</h1>
<p>Be <b>bold</b> in stating your key points. Put them in a list: </p>
<ul>
<li>The first item in your list</li>
<li>The second item; <i>italicize</i> key words</li>
</ul>
<p>Improve your image by including an image. </p>
<p><img src="http://www.mygifs.com/CoverImage.gif" alt="A Great HTML Resource"></p>
<p>Add a link to your favorite Web site.
Break up your page with a horizontal rule or two. </p>
<hr>
<p>Finally, link to another page in your own Web site.</p>
<!-- And add a copyright notice.-->
<p>© Wiley Publishing, 2011</p>
<script src="https://gist.github.com/lawlist/12345678.js"></script>
</body>
</html>

None of the above answers work anymore. Here is the updated CSS that displays the gist correctly with visible scrollbars where needed.
.gist {
max-width:350px;
overflow:auto;
}
.gist .blob-wrapper.data {
max-height:200px;
overflow:auto;
}
See this blog post for example:
How to set custom height and width of embedded Github Gist.

They seem to have changed something, so now you need to do this:
<style type="text/css"> .gist {width:500px; overflow:auto} .gist .file-data {max-height: 500px;max-width: 500px;} </style>

If your gist is inside an iFrame, which is generated and you can't access since it's and embedded HTML, you might want to take a look at this.

Related

hide text from inbox preview MailChimp

While I have added inbox preview text for MailChimp, I would like to stop it also showing the 'view this email in your browser text' in the inbox preview text.
Is there a way to hide text from inbox preview in an html template for Mailchimp?
To fix this you will need a pre-header. A pre-header is a line of code you place just after the <body> opening tag which hides whatever is in it visually. Doing this - you can have what you want to display in the email preview without taking in any of the miscellaneous content (for example view in browser links).
<!--[if !mso]><!-->
<span style="display:none !important; visiblility:hidden; opacity:0px; color:transparent; height:0px; width:0px; mso-hide:all; max-height:0px; max-width:0px; line-height:0px; overflow:hidden;">Type your teaser content here.</span>
<!--<![endif]-->
In the above example of a preheader, you can see many different things going on. First up we have the <!--[if !mso]><!--> snippet. This will ensure anything encased between that and the <!--<![endif]--> statement will not be rendered in a Microsoft client. This is done because of Outlooks limited CSS support.
Next, we have a span stag with various CSS elements to hide the content within it. Then contained within the span tags is the content you'd want to appear in the preview of the email client.

Tumblr read more expand on the same page

I'm developing a Tumblr site.
When the user clicks on the "read more", the content is revealed and expanded on the same page,how can I do this?
As Tumblr is reworking the UI for editing, the Read More tool may have been hidden from you. Reset your preferences to use the Rich Text Editor to edit posts. The Read More tool is between the bulleted list tool and the image tool. See the screenshot.
Ok, It's a simple script, but it works. Add this code in your theme before tag (or as it should be):
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.spa').click(function(){
$(this).parent().children('div.spb').toggle('normal');
return false;
});
});
</script>
<style type="text/css">
.spb{display:none;}
.spa{cursor:pointer;display:block;}
.spa:after{display:block;content: "{lang:Read more}";margin-bottom:10px;}
</style>
Now, when you write a new text, add to it those things.
Text before Spoiler
<div class="spb">
Text after Spoiler
</div>

text resize none how to apply inline

i found out the right answer (not to adjust text size on rotation !)
Preserve HTML font-size when iPhone orientation changes from portrait to landscape
but being very naive to css how to use it inline ?
i used as follows, but it did not work
<html>
<head>
</head>
<body style ="-webkit-text-size-adjust: none;">
<font face="Arial" size="9";>< a href="mailto:subject= mysub&attachment=myatt.doc"> mail this< /a>< br/>< b>< i>Header< /i>< /b>< br/></ font>
</body>
</html>
The example you point to is a style on the html tag, not the body tag as you have done. I suggest you try:
<html style="-webkit-text-size-adjust:none;">
and see how that works. Or you can just put the style into your head section like so:
<head>
<style type="text/css">
html {
-webkit-text-size-adjust: none; /* Prevent font scaling in landscape */
}
</style>
</head>
Interesting trick, I haven't actually ever done this myself.

view trac on mobile devices (iphone, android, etc)

Our team uses Trac heavily for project management, and I need to view the Trac site from time to time. Yet, it's really inconvenient to view the Trac site from the mobile device (it's an iphone in my case).
I wonder if there is any existing hack / plugin / template / css suite that could help display Trac better on the mobile devices? I thought some <meta> tags and css positioning should make the trick, yet I could not google out much from this.
any help is appreciated.
thx a lot!
Consider reading TracInterfaceCustomization in Trac's wiki for a start, more specifically about using style.css as I agree that you'll certainly need to change site-wide styles.
Ready-made themes are available at trac-hacks.org. Maybe you'll find something suiting your need at least a bit better than Trac default for a quicker start.
And finally the ThemeEnginePlugin seems like a great tool to put your ideas into reality quickly, although I've never tested this on my own by now. Good luck.
Ok, it took me a while to work out this. This is not perfect, neither good, but at least it looks a little better for me.
here is what I have done:
in the folder of [trac root]/templates/, add or edit the site.html, which contains the following:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/" py:strip="">
<head py:match="head" py:attrs="select('#*')">
<meta name="viewport" content="initial-scale=1.0, width=device-width, height=device-height, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
${select('*|comment()|text()')}
<link media="handheld, screen and (max-device-width: 480px)" href="/htdocs-trac/css/trac-mobile.css" type="text/css" rel="stylesheet" />
</head>
<!--! Custom match templates go here -->
</html>
the above would add a new CSS link of /htdocs-trac/css/trac-mobile.css for every Trac page, and then u could put the mobile-device-only styles inside the css file, in my case, the css file contains:
.nav li {
white-space: normal;
}
#mainnav *:link, #mainnav *:visited {
padding: 0 10px;
}
#mainnav *:link, #mainnav *:visited {
padding: 0 0px;
}
#header h1 {
margin: 0;
}
honestly, it ONLY makes the title bar appeared better, and the button not collided. But a lot of places use table based layout, and (seems) could not be solved by css easily.
Hope it helps for others.

What do meta-if tags in Tumblr do?

The example Tumblr gives is
<html>
<head>
<!-- DEFAULTS -->
<meta name="if:Show people I follow" content="1"/>
<meta name="if:Reverse pagination" content="0"/>
</head>
<body>
{block:IfNotReversePagination}
Previous Next
{/block:IfNotReversePagination}
{block:IfReversePagination}
Next Previous
{/block:IfReversePagination}
{block:IfShowPeopleIFollow}
<div id="following">...</div>
{/block:IfShowPeopleIFollow}
</body>
</html>
For these meta-if tags, when I change content="1" to content="0" or content="" nothing seems to happen to the appearance of my tumblr.
I don't understand what these meta-if tags do.
According to Tumblr: By including the special meta-if tags in your theme, users can easily toggle options you define. This is useful for showing or hiding different widgets or design elements.
I understood this as you can show/hide different design elements by changing the content value ie. content="0", content="1", content="". But nothing seems to happen to the design if I do this.
I googled this and I can't find any explanation elaborating on what Tumblr says. Can someone please explain?
Tumblr uses meta tags to save preferences of the theme. Meta if will cause that user gets a new checkbox on the Appearance menu. If its checked than the
<div id="following">...</div>
will be shown on your page.
So there should be new div element in the page source and three dots displayed on the page.
What Bojan Dević said is correct. Although, I would like to address the other half of your question, as well. content="1" automatically sets the element to be shown, or as content="0" makes it hidden.