oldcomputernerd.com/md/sample.md

55 lines
3.3 KiB
Markdown
Raw Normal View History

2023-07-23 14:06:48 +00:00
## Markdown file 2
This file was linked to from our first file. I want to see if it will still be wrapped in the plugin header and footer. If it is, then we're golden!
Also, I want to see how the paragraphing works with this markdown parser. Will it give me a nice clean break between paragraphs, and legible line wraps, or will it be crushed and stretch and ugly like some of these parsers tend to work. I'm just rambling on here, in order to make this paragraph as long as I can manage. If this works well, I won't even need HUGO by the time I'm done!
So, this is where another lengthy paragraph would start. I'm not going to carry on too long. I just want to see about the gap between the two paragraphs. I also want to see what it looks like to have sub-headingsin a document. So, let's start a sub-heading.
## Sub-Heading
I've started a new sub-heading here. Let's see what this looks like. Another thing I'm curious
about, is how the plugin will respond to actual html tags in the markdown. For example, an
IFrame with a video embed:
<iframe class="rumble" width="640" height="360" src="https://rumble.com/embed/v2wv48o/?pub=2vcrn" frameborder="0" allowfullscreen style="margin-left:20%"></iframe>
## Next Test
Ok, so embedding an IFrame works out of the box. But, what about more complicated things, like divs or snippets of javascript? Lets see how that works out. First, here's a div with a span inside of it.
<div><span style="border-style: double; color: yellow;margin-left:30%;padding:2px">This is some text inside of the custom span</span></div>
Well, that's just grand! It seems that I can drop *any* html I want into *any* markdown I want, and it will render just fine! Ok, but what about, say, syntax hilighting, which requires a javascript?. Let's find out. For this, all I *should* need to do, is provide a markdown codefence, specifying the language, because the apache plugin will render it as `<pre><code class="language-whatever">` which is what both highlight.js and prism.js use. In this case, we'll make a python snippet. The key issue here, is that I already have css theming for the code fence. So, will the javascript override it, merge with it, or be ignored? We shall see:
```language-python
print('Hello, World!', end=' | ')
print(100, end=' | ')
print(5 + 5)
vowels = ['a', 'e', 'i', 'o', 'u']
popped_item = vowels.pop()
print(popped_item)
print(vowels)
```
And there we have it! Highlight.js works, but it overrides my global css, essentially overlaying the pseudo-amber-screen I created, with it's own theme. That's fine, for now. I picked one as close as possible to my theming, but more work will be needed in the future.
If don't want to use the highlighting, I can always just use a generic (unlabelled) fence:
```language-nohighlight
10 PRINT "HELLO"
20 GOTO 10
```
## Final Test
Now, can we add an Iframe with a display of plain text in a different file? If I can do that, then I could even show you this particular markdown file in its raw form. So, you can see there's no special trickery here, beyond the magic of the markdown plugin for Apache2.
The index.md file:
<iframe src="/txt/index.txt" style="margin-left:20%;width:60%;height:480px;border:none;"></iframe>
The sample.md file (the one you're reading now):
<iframe src="/txt/sample.txt" style="margin-left:20%;width:60%;height:480px;border:none;"></iframe>