Adding Custom Markdown to Middleman - ruby

Environment
Middleman (Latest), Red Carpet MD Renderer
Problem
I'd like to make definition lists using custom Markdown
Background
I'm new to MD, let alone making a custom parser for it. While I've read several articles, I feel like I'm missing something because they don't seem to work.
Research
http://aalvarez.me/blog/posts/custom-markdown-in-middleman.html
Great article, but too specific in examples that don't directly relate to making a definition list.
http://eng.rightscale.com/2015/10/14/custom-markdown-in-middleman.html
Closer, but this seemed overly verbose for something seemingly more simple.
https://github.com/vmg/redcarpet
I've read the docs, but I can't figure out how to apply this to middleman. As the two previous articles mentioned, middleman docs don't really explain how to override the red carpet renderer.
I'm totally open to solutions that exist. I just can't seem to find any!
Thanks

Related

I need to create a website that looks like this

I got an assignment to create a website that looks like this. I have all of the images but I am stuck.
I am a pretty rusty coder.
Some of the things I can't seem to get are.
Image cropping: how do I make it so that it shows part of an image.
Moving objects around: do I use float or grid or flex?
Overall just feeling overwhelmed. Help?
Good test project I would recommend you get you requirements on this down first, like ACVM stated then you have to also consider your strength on this requirement the break down to sprints and chunks/milestones before you start coding.
Language I would recommend for easy development:
php - to handle mailing and contact us
html5 and css5 - creating the layout/design (preferably bootstrap check wrapbootstrap.com and startbootstrap.com)

create a simple (and visible!) UI slider in Unity 5

![enter image description here][1]please I need some help, this should apparently be something very simple and basic to do, but maybe I'm missing something.
I'm quite newbie to Unity3d, I had no much problem with creating a somewhat flashy 2.D scene (I mean 2D with different layers in Z level), scripts, etc. But I'm having trouble to create a "UI Slider" object: when I create it, it just shows nothing on screen. How can I make it visible? I just need to create a very simple, plain slider whose value can be controlled at runtime by means of a script.
thanks.
Well.. since you give nothing to go on, I suggest that you take a look at a tutorial for the UI:
https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/using-the-ui-tools
If you have troubles after this tutorial, come back with an example of your problem to make people more willing to sacrifice their time in helping you.
Hope this is somewhat useful
Take a look at the Unity3D docs here.
http://docs.unity3d.com/Manual/script-Slider.html
It should have what you are looking for.

Documentation for three.js controls?

three.js comes with many useful controls, which cause camera movement in response to keyboard and mouse input.
They are all at https://github.com/mrdoob/three.js/blob/master/examples/js/controls and accessed in the code as e.g.THREE.OrbitControls .
However, I can't find any documentation or comments that says what situation to use what control for or what they are intended to do.
Can anyone point me to this information, or do I have to analyze the code to figure out if, for example, I prefer FlyControls to FirstPersonControls?
The documentation for the controls does exist, but it was deleted from the repository here. Seems like a bizarre thing to do, but there is an explanation of sorts here. I guess the docs were very incomplete anyway and it was easier to delete them than to finish them. :-p
The source code for most of the controls contains pretty decent comments. I know this isnt as good as proper documentation but it really helps to get a handle on how to set up the controls
The Controls are named by their purpose or the idea they implement. OrbitControls allow you to orbit around some kind of object. Same for Trackball-Controls although the trackball-scheme implies that the camera will rotate around without the up-Axis staying as it was like in orbit-controls. Fly and FPS-Controls are self-explanatory.
Just try the examples and you will see what the difference is. No need to analyse code. Just depends on what you want to achieve.

How to make a website menu exactly like the one right here on stackoverflow on ASP.NET MVC 4?

I started using asp.net MVC 4 and I don't quite understand how could I accomplish simple tasks like making a simple navigation menu for my website, I would like it to be just like the one here on stackoverflow where the images change on mouse over and also link to their corresponding pages.
what used to be a few minutes of work with HTML (in Dreamweaver for example) now takes much much more time and thought (at least for me).
Investigating about the 3 elements I've mentioned got me here:
How to show an image- even that is not easy, I have looked everywhere for something that looks like an ideal solution but couldn't find any! even here on stackoverflow, some solutions are involving writing long lines of code in the name of "Helpers", and I could dig into it but there are so many different solutions, and I wouldn't know which one is right.. why can't there be just one standardized solution?
How to link an image- also an issue, that i understand that I need to set the controller in the parameters list but again I ran into and issue that I might have found the solution for I just need to test it, I have read that I could have different methods inside of one controller and in this way I will not have to have one controller for each link. I will try that, better solutions are welcomed.
How to swap an image on mouse over- also looks crazy for me, I have found one solution where there are long lines of code for this here: http://www.codeproject.com/Tips/329596/MVC-3-Helper-for-Hover-Images
I am kind of disappointed that just for putting up the logo image and linking it I spend days! I do have background in .net c# HTML+CSS etc'.. so I am asking myself (and you guys) why does it have to be so unclear and not friendly?
Come on.. what am I missing? is there any library of helpers everybody is using or something like that?
I am still in the process of learning MVC 4 and I know I'll get it but I would've expected accomplishing these kind of simple tasks a lot faster.
also, in Microsoft examples, I have never found an example where they put a logo or a menu image, it is always plain text! so annoying and frustrating...
I will very much appreciate any help..
Thanks a lot!
Roy.
Start with http://www.asp.net/mvc/mvc3 and understand what are the paradigms of it and what is the differance between webform and mvc systesm.
Basically you need to understand how the masterpages are evolved in mvc or what is the replacement of master pages in mvc.
This is clue to what you want to achieve.
Now if you want to put the Image button in which if you hover and color will change then you need to do following steps.
Create a button first e.g
Html.ActionLink("YourButtonName", "Index", null, new
{#class="hoverButton" })
Now you need to create two classes in your css file with name hoverButton which contains property to show image and hoverButton:hover show image when you hover over the link. Like following.
hoverButton {
margin-bottom: 10px;
width: 160px;
height:160px;
display:block;
background:transparent url('Button.png') center top no-repeat;
}
.hoverButton:hover {
background-image: url('hoverButton.png');
}
This way when you hover over to button it will display different image in mvc view menu item.
Hope you understand the concept and it helps.

Using Mathematica to build presentations and documents

I use Mma mainly to solve relatively small problems.
I want to start using it also to prepare my presentations and documents, but I am having troubles to learn how to do it from the embedded help, and I guess some good resources may be available elsewhere.
Do you know any useful pointers (books, papers, videos ...)?
Do you have a "bag of tricks" to post here?
Edit
This question received two answers so far (#mzabsky's and Mr.Wizard's) and although both are useful, perhaps my concerns are much more basic. So I am posting an example of the kind of things I am unable to do (or understand how to discern how others did them).
I took the following example from The Mathematica Journal (the notebook at the left on the following image - click on the image to see full size):
So, some issues, just to get the idea of my troubles:
1) I copied the text to my .nb on the right, formatted it with the same style (text), but the appearance is different, so I guess the style definition is different. How can I copy the style definitions from one .nb to the other?
2) The table below the text block doesn't have an attached style. How was it formatted? Where is the background color defined?
I would like pointers to read (or videos to look, or whatever) about these issues. I don't want you to write down here a book on Mathematica formatting!
Summary of the links posted in answers
A Mathgroup thread (John Browne) and here (David Park and
Selwyn Hollis)
Advice from Bob Ueland
The Writing Assistant Palette
David Park's notes
Simon's documents
Tips for Mathematica SlideShow presenters
Notebook formatting
Presentations with Mathematica
Videos
Tips for Mathematica Slide Show Presenters
How to - Automatic Slide Show
Create a Lecture Notebook
I use Mathematica to take lecture notes in real time without any major issues (while the proud TeX guys struggle hard to keep up :) ). I have also used it for most math-related homework/assignments I wrote during past two and half years on university.
Before you start, you may want to look at some of these video tutorials.
Also, a few recommendations from me:
Keyboard shortcuts are the key to type fast. Ctrl+9 for inline math cell, Ctrl+6 for superscript, etc.
Learn symbol identifiers for the "esc - symbol - esc" notation. "sum" for Sum, "es" for empty set...you can find list of these in the Mathematica documentation. I have encountered only very few symbols I wanted to type that don't have the esc notation name (for example, leftwards double arrow or double right tee).
Type all math-related stuff into inline math cells. The math cell will do some of the math related formatting for you - put spaces where they belong, render all variables and symbols in italics, etc.
Use the preformatted templates found in "New"->"Styled Notebook".
Do not use ENTER for breaklines, individual paragraph should go into separate text cells (Ctrl+Shift+D) so Mathematica can break the content into individual pages/slides correctly.
In-built Mathematica PDF export sucks big-time; I use CutePDF printer for this.
Also, save often and back up often (Dropbox/Syncplicity are the ideal solution), one misplaced keyboard shortcut can turn hundred hours of work worth document into a goulash (trust me, been there) :)
Example of lecture notes I took in real-time during lecture (it is in Czech, but that doesn't matter much).
I agree with all that mzabsky said in his answer.
Here's a few of extra things:
I find it useful to make statements using a Text or DisplayFormula cell then manually group a Mathematica check/proof to the statement which is then collapsed and can be displayed when you want.
The Writing Assistant Palette has quite a few useful constructions in it that you can learn from.
Finally, I found it really useful to make my own style sheet for a couple reasons:
1) the built-in ones are a bit ugly; 2) it really helps you to understand how the notebooks work.
To see examples of the stylesheet I made (which I don't claim to be perfect - I didn't bother making it work in all screen environments) look at some of the files in ftp://ftp.physics.uwa.edu.au/pub/MATH2200/2010/. I use a similar stylesheet in all of my notes - I have many research projects primarily contained in Mma notebooks, eg http://arxiv.org/abs/1102.3043.
Like Mr Wizard, I also recommend David Park's notes as a starting point. Also, you should study stylesheets that you like by going to the Format menu and clicking "Edit Stylesheet". Don't forget to follow the links through the cascade of stylesheets (version 6 onwards).
To answer the questions in your edit: Once you are viewing a notebook's stylesheet, you can save it, edit it, and use it in your own documents. Stylesheets in
$UserBaseDirectory/SystemFiles/FrontEnd/StyleSheets are automatically available in the menu. You can then use that stylesheet in any notebook by simply selecting it from the menu.
The formating in the screenshot that you posted is all contained in the stylesheet. This includes the grey background in the table.
Addendum:
When distributing notebooks to others, if the stylesheet is external from the notebook, then other people will not see it as you do. To include the stylesheet into the current notebook, you need code like
ss = StyleDefinitions /. Options[EvaluationNotebook[]]
fn = ToFileName[{$UserBaseDirectory, "SystemFiles", "FrontEnd", "StyleSheets"}, ss]
If[FileExistsQ[fn],
style=Get[fn];SetOptions[EvaluationNotebook[],StyleDefinitions->style];,
Print["Can not find file"]]
(Assuming the file is in stored in the conventional place)
Here's an EmbedStylesheet.m that is an improved version of the above.
A Mathgroup thread on embedded stylesheets, particularly here (John Browne) and here (David Park and Selwyn Hollis) might be of interest.
I find stylesheets problematical. In particular I don't like having to remember to embed a stylesheet before I give the notebook to someone else, or before I try to print from an unfamiliar computer. However, along with David Park's tutorial (referenced above by Mr Wizard), I find this advice from Bob Ueland very useful.
If you browse the back-issues of The Mathematica Journal you will see that articles are available in Notebook format. These may be a useful reference.
Edit
I cannot recall a good formatting tutorial at the moment. You can use Show Expression (Win: Shift+Ctrl+E) to view the code expression for a block, such as the table in your example. While one may not enter code by hand in the same form, it can give indications of the options or methods that are used. Code can also be procedurally produced as needed.
I will add links as I find or recall them.
David Park's StyleSheet creation notes
Tips for Mathematica SlideShow presenters
These are brief, but may still be useful:
Notebook formatting
Presentations with Mathematica

Resources