Live data from Hacker News

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

github.com

21–30 of 86 posts

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

#22

Honestly, I prefer writing directly plain html5 with implicit tags. I cannot see any advantage of markdown over html for this particular usage.

It's easier to read? It's easier to write?

it is just as easy to read and write as markdown, and it does not require javascript libraries to be rendered

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

#23

Earlier quoted context omitted.

Sometimes I just want to get some information out there on the internet, and rather than sharing a Evernote page or having to create a webpage I can just write markdown. Main use-case is when I want to share a markdown doc in a private GitHub repo, with a public url e.g http://oscarmorrison.com/md-page/oimasdoijasdmadeupurl-01231...

Very cool. Thanks for sharing. Btw, I got an SSL certificate error when I went to check out your site. I know there's a few different ways to account for this when serving up a website from github, but I'd welcome guidance on what the best practice is for fixing this.

Hey @jonnydubowsky thanks for catching that. Just fixed it all up now, so should be good. This is what I did to fix https://gist.github.com/cvan/8630f847f579f90e0c014dc5199c337...

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

#24
Props for the simplicity in getting something published. That's really cool.

Along similar lines, I went back to LibreOffice recently and made a few web pages with it, just to try it out. It worked better than I expected.

After adding a simple PHP controller to the mix, injecting some CSS for responsiveness and other tags as needed, I have been impressed with how easy it makes publishing. If a single-pager is what's needed (or multi-pagers perhaps; I just haven't tried it yet), if what matters most is getting links and information public, it's a useful tool.

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

#25
Throwing in to the list of alternatives to this: http://mdwiki.info which actually does not even require you to create a .html file, but just plain .md files and a standard/template version of mdwiki as index.html.

Disclaimer: I am the author of it, and it is nowadays unmaintained.

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

#26
post #7

A neat party trick, but what actual use-case is there that isn't better served by server-side Markdown to HTML conversion?

Back in 2013 I did a similar thing for a client with a popular code library.

Their documentation was written in markdown and the site was hosted on static hosting, so no server-side conversion.

Although the web page chrome (navigation, etc) was in HTML, they wanted the documentation to be in markdown under the hood after upload. They didn’t want to use any kind of conversion prior to uploading because they needed to make on-the-fly changes to the documentation after upload without writing in HTML.

So we opted to go with client-side markdown to html conversion on pageload. complete with a clickable legend and tabs to switch between language implementations for code examples.

Putting the markdown inside regular page formatting tags wasn’t reliable, as different browsers did different things to the content (for example some browsers converted “&” to “&” and the indentations for code was not respected). So we had to store the markdown in some sort of preformatted tag block.

However

 required special escaping of code characters ( , &, etc).

So we opted to go with using a little-known tag to store the markdown as search-engine indexable code. Since content inside will be read as plaintext instead of being formatted by the browser, it was also great for being the input of a client-side markdown-to-html converter.

It worked quite well. If you want to see it in action it’s at https://www.genivia.com/dev.html

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

#29
The flicker when loading the page sucks. I guess displaying Markdown in case of failure is not the worst thing, but it would be nice if there was a possible way to allow getting rid of the flicker at the cost of not having a graceful fallback.

One way you could accomplish this is by supporting script tags for this, like wrapping the page in:

    ...
...as an optional way to use the library. Browsers won't (shouldn't?) try to render the contents of the script tag before you get to it, so it would act like a typical SPA.

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

#30
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) Rewrite entire markdown on page to HTML via showdown.js

6) Append to body and render

I could fork it and add breakpoints / run debugger but this is what I got from looking at source code

Post reply on HN