MatHML and SVG
What to do some matHML and SVG directly in html. well now you can. in html5 supoert was added for mathML and SVG. The HTML syntax of HTML5 allows for MathML and SVG elements to be used inside a document.
Video Transcript
00:00And let's now jump into our editor.
00:04If you're one of our members, you
00:05can download the source code.
00:06It's organized based on basically folders.
00:09So now we're in the third video, or fourth video really,
00:12but the third part where you actually have code.
00:15And I want to start a new topic, and then we're
00:17going to go back into actually seeing
00:18a few samples of the different attributes that
00:20are going to be used, and a few of the different elements
00:23that are going to be used.
00:24And I'm just going to use sample cases,
00:26because really the goal here is just
00:28to tease you into opening up a document.
00:30The document is not that long.
00:32Looking into modernize, looking into the website
00:34that Carol said, the W3C schools,
00:36making sure that you know which elements are still a support,
00:39and then just start using them.
00:40There really isn't a lot to learn about them,
00:42so there's no point in wasting too much time on them.
00:44I do want to talk about a few really cool stuff.
00:47One of the really cool stuff is the support
00:49of a few different technologies that you can now
00:52go and get a whole book and start
00:53learning about these different stuff.
00:55One is MathML.
00:56MathML is actually really cool, really useful,
00:58especially if you're into educating
01:00or you're into mathematics.
01:02And MathML enables you to show mathematical equations
01:10inside of HTML.
01:11So now it's formally supported in HTML5,
01:14which means whenever all the browsers are
01:15going to be supported, you're going to be for sure.
01:18You're not going to need any JavaScript.
01:19You're not going to need anything, just basic XML.
01:21So if you look at an example code of it's just
01:25a lot of basically nodes that look like HTML that basically
01:28create all the different shapes together.
01:30And there's actually tools that you could output into MathML.
01:35And if you're a mathematician, you already know about them.
01:37And if you're not, then you could create,
01:39whenever you have a need for math-related stuff,
01:42just do a little Google search, find a tool,
01:45or start tweaking with these different elements.
01:48So what I want to do, I'm just going to take this code,
01:50and I'm going to just drop it into our little sample here.
01:54And I'm just going to paste it right into our body,
01:56and I'm going to click on Save.
01:57And now I'm going to open up my browser, open up Safari.
02:00And I'm just going to click on Refresh
02:02so we could see our math equation.
02:03And here we go.
02:04We have a nice, beautiful math equation,
02:06which we could never do on our own without the MathML.
02:10I had it really easy, very simple.
02:11Obviously, I'm not going to go into the syntax itself,
02:13because that would be a whole new category of its own.
02:16But it's really just visual elements.
02:18So it's not very complicated.
02:19It's more about looking at the elements
02:21and starting to play with them.
02:25Now, this is actually supported in most browsers.
02:27So if I check this on Firefox, Firefox already
02:30supports it as well.
02:31So it's actually quite well supported.
02:33And obviously, you could see there's
02:34a big difference of visual aesthetically between the two.
02:37But they both actually do quite a good job
02:39at showing our mathematical equations.
02:42One is bigger than the other, technically,
02:45when I'm looking at this right now.
02:46And they seem prettier on Firefox than they do on Safari.
02:53But that's less important, because when
02:54you're talking about math equations,
02:55it's really about making sure that they render correctly
02:58and that people could see them.
02:59So let's look at the next topic.
03:01The next topic of the new type of stuff
03:03that are introduced into HTML5 is SGML.
03:08And if you're an animator, if you've
03:09been working with 3D animations,
03:11if you've been working with XML rendered elements,
03:16you've already met SVG in your history.
03:20Now, if you haven't really, SVG, all it really is
03:23is the XML language to represent vectors that are built
03:27in a lot of different vector tools.
03:28So there's quite a lot of vector tools
03:29that basically output to SVG.
03:32With that said, the support is still limited right now.
03:35But basically, what the W3C wants to happen with HTML5
03:39is SVG will just be natively supported in the browser.
03:42You don't even need to use an external file.
03:45You could actually just grab a sample.
03:46And I took you a little bit of a complex example on purpose.
03:49And you could just paste it right into your browser.
03:52And again, you could grab these source files from our source
03:55files.
03:55I know we're not going into the details of the SVG language
03:58itself.
03:59And if we just check this out on our Safari browser first,
04:03we'll see that it actually, well,
04:05let's look at Safari first.
04:06And in our Safari, if I refresh this,
04:07now we have here a square.
04:09You can see the square.
04:11Well, you probably don't see it.
04:12But if we look into my code, we'll see that in my code,
04:15there's actually a halo around it.
04:18So we're creating this blurry, different Gaussian blur that
04:23was supposed to be on here.
04:24And we don't really see it.
04:25We kind of see it, but not really.
04:26And if we check it out on Safari, we'll
04:29see that if I refresh on Safari,
04:30we're going to see exactly what I really wanted.
04:32So basically, the support is not 100% there yet.
04:37But the beauty of it is that some of the basic SVG stuff,
04:40such as creating a square, or creating a circle,
04:42or creating really basic shapes, are really easy to do now.
04:45No need for JavaScript, no need for anything.
04:47No need for cavity, either.
04:49You could just, right away, create it in SVG.
04:52Obviously, if you're working for a specific browser,
04:55such as you're going to take a browser
04:57and you're going to wrap it into an iPhone application
05:00or such, then it's so much easier,
05:03because you could then work for one browser,
05:05make sure it works on that one,
05:06wrap it up as an iPhone application, done.
05:08And you just build yourself an iPhone application that easy.
05:11And there's quite a lot of tools out there
05:13to build applications out of JavaScript and HTML5.
05:17On top of my head, I can't think about one of them,
05:21but we could upload something on our website,
05:24or if you could think about it and you see this video,
05:26then obviously, just put a link up on our comments
05:29to help other people find that information.
05:32But it's that easy.
05:33A lot of these applications are basically
05:34just build and deploy and done,
05:35and you just build yourself an iPhone application
05:38that's basically just HTML.
05:41All right.
05:42When you say mobile devices,
05:44do you mind that you include an iPad in that?
05:48Oh, absolutely, yeah, yeah.
05:50When you say mobile, that's what you mean by mobile.
05:53It's not just phones, correct?
05:54Yeah, I think the best categories for mobiles today,
05:56early in 2012, would probably be iOS devices,
06:00which would be Apple devices, iPhone, Apple, iPad,
06:05iPod, iPod Touch, and then you have the Android devices.
06:11And obviously, you have also the BlackBerry devices.
06:15Actually, there are actually tools
06:16that you could just render directly into Android,
06:18or render directly into iPhone,
06:20just create an application that you could sell then.
06:23So if you created an interactive book,
06:26you could create that book in HTML,
06:29sell it for 99 cents on the iPhone store,
06:33or the Android store, or the BlackBerry store.
06:35Very, very easy to do it,
06:36because there's actually tools
06:37that really guide you through the process.
06:38All you have to know is your HTML and JavaScript,
06:41and you're set to go.
06:42And by the way, side note, same is true with Flash.
06:45So if you know how to build Flash applications,
06:46you could quite easily build Flash applications,
06:49then render them out into iPhone, or Android, or iOS.
06:57There's a few other phone vendors,
06:58but obviously, they're less critical and less important.
07:01I know there was one that was basically just JavaScript,
07:06which I can't remember, but I had to.
07:09It's the Palm Pre, which is just JavaScript and HTML,
07:13basically.
07:14The application you build doesn't even need to convert.
07:16It's just basic native JavaScript.
07:19Okay.
07:20All right, that covers this topic.
07:25And you just showed me this,
07:28probably in two different browsers,
07:30one was better than the other.
07:32Would you say that all the browsers
07:34are working towards accommodating HTML5,
07:38or they wanna do that, or they're not gonna do that?
07:44They definitely will.
07:45All the browser vendors
07:47are basically negotiating with the W3C,
07:50and they're actually the browser manufacturers,
07:53if it's IE, if it's Google, if it's Safari,
07:58they're all sitting in those meetings.
07:59Also, Adobe are sitting in those meetings,
08:00and they're together deciding the future of the browsers.
08:04So all the browsers are not there yet,
08:06because it's still a draft.
08:07And some of the browsers are deciding
08:09to create some features,
08:10while others are deciding to work on other features.
08:13It's still a work in progress,
08:14but if you look at it two years from now,
08:17three years from now,
08:18when the drafts are completely finalized,
08:20it's all gonna fall in place.
08:22Unfortunately, right now,
08:24especially because there's such a big hype about HTML5,
08:26you're gonna have to build HTML5 applications,
08:29and you just have to worry about
08:30how it works in different types of browsers,
08:32especially when we're talking about
08:34the new functionality stuff.
08:35Now, fortunately for us,
08:36the CSS didn't really change that much.
08:39So if you're working with HTML5,
08:40and you're just building it using CSS,
08:43you don't really have anything to worry about,
08:44because visually, everything's gonna be the same.
08:46The only time where you're gonna have something
08:48to worry about is when you start introducing
08:50the new functionalities, if it's video,
08:52if it's, and which actually,
08:55video is actually quite supported really well
08:57throughout the different browsers.
08:58It only have to render it in different types of videos.
09:00If it's Canvas, some browsers really run quickly,
09:03some browsers really run slowly
09:05when they're running with Canvas.
09:06So there's a lot of research involved with it.
09:09It's not a copy paste, definitely not,
09:11unless you know what browser you're targeting,
09:14which obviously makes your life so much easier.
