Live data from Hacker News

Show HN: Markdown page – Create a web page with just markdown

github.com

81–86 of 86 posts

Re: Show HN: Markdown page – Create a web page with just markdown

#82
post #6

I like it a lot, both concept and execution. Little nitpicking: > Create a webpage by just writing markdown, nothing else! The „nothing else” bit looks inaccurate, there’s a script tag at the very beginning.

Nitpicking more: raw html (including script tags) is valid markdown! So it technically is markdown and nothing else.

Noted! Then again, super nitpicking, if that script tag in the beginning is part of the markdown document, then it should also be displayed in the final document.

Re: Show HN: Markdown page – Create a web page with just markdown

#83
post #62

Earlier quoted context omitted.

> You are editing a website, but don't have control over the server-side code. You don't have control over the server-side code, but it will let you inject tags into the content? That seems a bit weird.

GitHub pages is literally like this, no?

You're right, though GHP is a bad example since it includes a Markdown renderer.

Re: Show HN: Markdown page – Create a web page with just markdown

#84

So how does this work exactly? It looks like you wrote a script.js file, which calls showdown.js library (converting markdown to html). A uglified version called `md-page` is made pulling both resources Basically, the script does following 1) wait for page to load 2) add css-styles via javascript 3) shove all the markdown in a variable "markdown", passing it as one giant string 4) Add settings for showdown.js 5) Rewr…

yep. you're 100% on the money. no wizardry here. Couple of extra features like ability to hash link, and external url open in new window. but that it

https://github.com/oscarmorrison/md-page/blob/master/script....

Line 43 to 48, I am not entirely sure what that hashlink does. What is the setTimeout function for? Could you expand on that?

Re: Show HN: Markdown page – Create a web page with just markdown

#85

Earlier quoted context omitted.

yep. you're 100% on the money. no wizardry here. Couple of extra features like ability to hash link, and external url open in new window. but that it

https://github.com/oscarmorrison/md-page/blob/master/script.... Line 43 to 48, I am not entirely sure what that hashlink does. What is the setTimeout function for? Could you expand on that?

It's to make linking to headers work. Eg oscarmorridon.com/md-page#code

As the element doesn't exist at time of first load this is a work around to focus on id once content is rendered in html

Re: Show HN: Markdown page – Create a web page with just markdown

#86

Earlier quoted context omitted.

https://github.com/oscarmorrison/md-page/blob/master/script.... Line 43 to 48, I am not entirely sure what that hashlink does. What is the setTimeout function for? Could you expand on that?

It's to make linking to headers work. Eg oscarmorridon.com/md-page#code As the element doesn't exist at time of first load this is a work around to focus on id once content is rendered in html

* https://oscarmorrison.com/md-page/#code
Post reply on HN