Adding a CMS to Your Flask Web App Transcripts
Chapter: Markdown as our format
Lecture: Adding markdown content

Login or purchase this course to watch this video and the rest of the course contents.
0:00 here we are back in our app and just quick Heads up. Now we're moving over to chapter eight. I made a copy of the code.
0:08 We just finished from chapter seven, moved it over to chapter eight. So follow along there. Now,
0:13 here we are, in our amp we can go over and we can go to our pages. And we saw that we have this really cool way to add these
0:21 pages in here. We have to write HTML. I'd rather write mark down. So that's what we're gonna do in this section.
0:26 We're gonna write some mark down here and notice there's no help Page, And if I click help, it's a 404 So what we want to do is
0:34 we want to create this help page, and instead of going and writing a new view method and a template and all that
0:40 kind of stuff were not going to touch the code and redeploy the website. We're just going to use our CMS.
0:46 That's what it's four is adding features to our site. So we want to go to slash health Here. Let's add a new page. It's getting help with Pipi.
0:56 I you are. L just help. And in here, let's write some markdown. So I'm gonna write a little bit of it here,
1:04 and then we're going to just drop the rest of it in, but I want to talk a little bit about the HTML so we'll have something like
1:09 Do you need help installing a package? Here are a few tips now we had a We want a bulleted list of three main options burst. Do you have pip installed?
1:23 Second, we're gonna put a little bulleted lists and on mark down, you make bulleted list with the stars. Or you can also use dashes either fine,
1:31 but notice. Unlike Riel editor, if I hit, enter here. Well, there's no, like, continuation of the dot or anything like that.
1:38 Now we have is pip from the correct Python. Right? We do have this Python two versus Python.
1:46 Three thing You always gotta juggle at least of the moment. Have do you have permissions to install?
1:54 Now we want to use our mark down to emphasize some things like have pip installed That's just super. Call that out.
2:00 And the way we do that in Mark Duggan's we have double stars on both ends And if we want this toe, have a proper, like code.
2:06 Look, we say back, take them cake. The key above your tab button there. Right, So that'll look like code. Not here. This is also like that.
2:17 I have. Let's put here. It will say correct Python and permissions to install. And then we want to have a header.
2:27 We could have each one. If we have one of these things and we have a title, it'll be something to the effect of you have pip installed right?
2:36 Something that will be the first step. First main area we have to these Italy each two h three. This is actually gonna be that each one on the page.
2:44 So we're gonna put two and so on, right? And there's a bunch more. We got it right. But notice we have to completely know this.
2:51 You have to know that. Well, double stars on both ends of a set of words is going to bold them and we get even if we're good at it,
3:00 we get no help. Like if I knew that, but I just want to hit this and hit command be all it does right now
3:05 is bring on my bookmarks, which is not what I wanted. Right? And when I hit enter here, it doesn't continue it. I get No, there's just a lot of things.
3:12 Even if you know, mark down. This is not ideal. But if you don't know mark down. This will be really frustrating. So first,
3:18 let me copy over what we have for the whole page. So you have to watch me type about this documentation.
3:24 Here we go. OK, see the scroll bar pasted a whole bunch of stuff here. Now we should be able to go and use our CMS to add this
3:31 page. Yes. Getting help with Pipi eyes there. And if I click on this, it's gonna be pretty awesome, right? We're gonna have our nice HelpAge.
3:39 Yeah, exactly what I hoped we would see. This is so nice. No, this is not nice. Obviously this is being treated as HTML.
3:49 That's right. So markdown is not magic. It doesn't just turn into HTML. We have to tell our program.
3:56 Hey, you're given one type of input and we want to transform that into another In this case, given mark down,
4:01 let's transform that into each team l we can show on the page, but having it over in our admin section where we can go back and edit Here
4:11 we can edit this mark down turns out to be a lot nicer than working directly


Talk Python's Mastodon Michael Kennedy's Mastodon