Sorry to sound cynical but this 10-15 minutes of work?
Show HN: Markdown page – Create a web page with just markdown
81–86 of 86 posts
Re: Show HN: Markdown page – Create a web page with just markdown
#82I 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.
Re: Show HN: Markdown page – Create a web page with just markdown
#83Earlier 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?
Re: Show HN: Markdown page – Create a web page with just markdown
#84So 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
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
#85Earlier 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?
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
#86Earlier 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