When I test my website using capybara-webkit and I take a screenshot, #font-face declarations in CSS are ignored.
This is especially bad because I am using FontAwesome, so there will be major differences to how the page is displayed in a real browser.
How to reproduce: https://gist.github.com/anonymous/4948827
Output: http://i.imgur.com/5lsrleY.jpg
Is there any way to fix this?
Some research shows that it is entirely possible to render custom fonts in Capybara-Webkit, the same as with PhantomJS. This PhantomJS Forum Post identifies the trouble issues. A quick summary:
SVG Fonts work best.
OTF fonts tend not to work.
It should be fixed with Qt5, so check what version of Qt you've built against.
Depending on the version of qt that capybara-webkit is built against, webkit needs non-localhost urls whitelisted. That includes meta references to external assets such as fonts.
To make that happen globally, add this to spec_helper.rb in the rspec configuration block:
config.before(:each) do
page.driver.allow_url("the-domain-name.com")
end
If you have a before :each already, just throw it in there instead. allow_url also accepts an array of strings.
I've placed a comment in your gist to this effect.
Related
I have a small wiki using MediaWiki 1.26.2 for personal use, within in one article with this section of text:
<source enclose=div lang=php>
$wgGroupPermissions['*']['createaccount'] = false;
</source>
And it is showing the next result:
Instead of this:
I mean, is formatted but without coloring at all, my understanding is that it should be colorful regardless the skin the wiki is using, so is there a configuration that I'm missing?
Seems there are still the same problems with SyntaxHighlight_GeSHi on MediaWiki 1.32.
Alternative is: Highlightjs
(it uses js for syntax highlihting)
It works out of box, even not necessary changing previously defining code syntax from SyntaxHighlight_GeSHi.
The syntax highlighter extension is bundled with recent MediaWiki installations, but not installed by default. You need to enable it in your LocalSettings.php, like this (for MediaWiki 1.24 and newer):
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
I was able to solved the problem, I'm posting the solution just in case someone else gets the same issue. I have my Wiki hosted in godaddy.com and as part of the service you can install Application out the box, one of them is MediaWiki, which already has the SyntaxHighlight extension installed.
For some reason I don't have clear enough, this extension was not working properly, so I decided to install the extension by my own from here and this time it worked like a charm.
I need to add support for IE8 and possible previous versions using Susy 2 but there is very limited documentation that described how to do this.
I know in Susy 1 there was a lt-ie9 fallback tag to use against breakpoint declarations but that doesn't seem to work for Susy 2.
Is there any documentation for IE8 support or other way this can be achieved?
Susy doesn't exactly "support" specific browsers — since that would be determined feature-by-feature. I think media-queries are the only place you may need a fallback for IE8, and fallback options still exist for that. You can find all the docs inline with other information about media handling. We have some basic media-query tools built in, and additional support for the Breakpoint plugin. The built-in mixin is now called susy-breakpoint() and accepts a $no-query argument for managing your fallback.
I've found this post Jekyll, modify the way some html tags are rendered
Which does explain how to extend redcarpet itself.
But what else needs to be done in order to get such extension to work?
What name does the extension correspond to in the _config.yml ?
Do I need to include anything in my gem file?
If I simply change "markdown: redcarpet" to "markdown: RedcarpetMod" github pages will send a main telling me that there were syntax errors in the first markdown file it tries to process.
Your stumbling block here is GitHub pages — the answer given by #cyrusza in the question you've linked works fine (I am using it to modify redcarpet's rendering on one of my sites). GitHub pages, however, runs in safe mode which means that it does not allow custom plugins at all and instead only supports a few specific plugins.
Check the Plugins page in the Jekyll documentation for the note about safe mode (in the first blue box), and the GitHub Pages help page about plugins for the list of which plugins are allowed.
I am having trouble trying to rake assets:precompile in my rails 3.1 app. I keep getting the following error:
rake aborted!
Invalid CSS after "...und-image: url(": expected ")", was "<%= asset_path(..."
It seems that the erb preprocessor is not being invokeb but my file is called style.css.scss.erb. Any suggestions?
Ruby documentation seems a bit unclear on a few things such as the usage of the asset_path and other such helper in stylesheets. Anyways this is what I did to get around the exact same problem:
I decided to do this the SASS-way by changing my stylesheet extensions from css to scss.
The image references in my code were changed from
background-image: url(<%= asset_path 'blah.png' %>);
to
background-image: image-url("blah.png");
I found the necessary documentation on the sass helpers on one of the RailsGuides
I've also added the config.assets.digest = true line to my config/appliction.rb file because that seemed to get my output HTML to refer to the hashed filenames. Without the digest flag set to true I get all of my link tags starting off with <link href="/assets/print.css?body=1" ... or <href="/assets/favicon.png"... which pretty much defies the purpose of using the assets pipeline. Especially the favicon file will still be cached by the servers and CDN's along the way.Explicitely setting the digest flag to true gets me <link href="/assets/print-e47f5a48af04ce6854c840d74cd28fba.css?body=1" and <link href="/assets/favicon-15fb5e00d868940bc32db7996e10f594.png" ...
Change the file extension from
xxx.scss.css
to
xxx.scss.css.erb
and everything shoule be fine
Even though an answer has already been accepted, and my specific solution may not have solved the OP's issue, this question was the top google hit so thought this might help someone else. I couldn't accept the idea of having to change all my stylesheets to use the SASS-style asset paths instead of ERB-style, because ERB should work. After some digging, I realized that I had so many files with embedded ruby asset_path helpers, and I had missed one in the app/assets/stylesheets directory that still had just a .css extension (forgot to add .erb). Also, I was including vendor.css, and that included one other file in vendor/assets/stylesheets that needed the .erb. Finally, I was using an older version of svn which still used the .svn directories at every level of the hierarchy, and since I had a 'require_tree .' in application.css, the .svn-base files may have been getting compiled as well, and obviously wouldn't be run through the erb processor. Fixing all the above got me working again.
This is a sass-rails error, as discussed here.
I had the same question and found out that the solution is by installing sass-rais-path.
This gets Rails to work SASS + ERB as expected, even though you may continue using the asset_path helper.
I love compass (SASS) and HAML. I've been using staticmatic for building static web pages. Staticmatic seams outdated (no updates, bugs). What are the alternatives?
What I would like:
$ preview .
> Server started ad port XXXX
> Now you can use Compass and HAML
:). So... no configuratio, no directory structure, just haml and sass files.
I am currently using Compass/Sass/Haml with middleman. https://github.com/tdreyno/middleman It is very easy to use, and runs a sinatra in the background so you can see your changes live in your web browser.
After you are done editing and previewing your markup it builds static HTML from your stack of Compass/Sass/Haml. See https://github.com/tdreyno/middleman/wiki for usage.
This requires no conf at all except to tell it which templating engines you are using at setup so I think it is exactly what you are looking for.
You can try jekyll. I think it doesn't work with sass and haml out of the box but you can look at plugins
Don't forget Nanoc. While it is a little involved, it has some slightly more powerful features than StaticMatic. It does depend on a directory however. :/
There are just a ton of static generators around, most of them in Ruby. I'm planning to use Frank for the next few static projects.
It uses Tilt to support a ton of template engines
It has a concept of layouts, which go in a separate layouts folder, and templates can have a metadata header, but other than that it's very minimal.