News for hackers. Stuff that matters.
Re:Text-Only Websites by noir_lord on Wednesday June 24, 2020 @02:31PM (#23631952)
I wrote a <100 lines of python that takes a nested set of markdown files and outputs a mirror structure rendered as HTML (any file starting with a _ is skipped for works in progress), threw tufte.css on top of it and I have a page that loads in 9ms over wifi and renders so close to instant it's not worth measure.

Has syntax highlighting as well, beyond that I wrote it myself because it let me do exactly what I wanted the way I wanted.

Code is here if it's any use to you https://kopy.io/ibFMc

It supports Jinja templates and you can put meta data in the header so you can choose what template you want, override the title etc.

If you don't override the title 10-tricks-to-foo becomes "10 tricks to foo" automatically

I've used that script to write technical documentation as well, I just swapped out the template and everything else stayed the same, in terms of time to value reward it's up there for the most useful code I've written in a long time.

Re:Text-Only Websites by gen220 on Thursday June 25, 2020 @02:44PM (#23644049)
Out of curiosity, did you consider using pandoc? https://pandoc.org/MANUAL.html

For context/the uninitiaatd, I think of pandoc as the "postgres" of markdown-to-<blessed_format>: you can build your own text-format-converter, but oftentimes you can get 90% of the way there with pandoc, and fill in the rest with custom filters and elbow grease.

To whet your appetite, I have a personal site that checks your boxes, where the build script is basically one long invocation of pandoc and xargs. In my experience and that of others', building on top of pandoc can get you to quite satisfying places and workflows (e.g. https://www.gwern.net/About).

(Also, fwiw, we use it at my place of work for writing versioned technical documentation, as well.)

Keep on plain-texting! :)

Re:Text-Only Websites by noir_lord on Thursday June 25, 2020 @03:53PM (#23644834)
I've used it in the past but I reach for Python most of the time.
Re:Text-Only Websites by AndrewStephens on Wednesday June 24, 2020 @02:41PM (#23632104)
Are you me? That is almost exactly what I did, even including the part about tufte.css and syntax highlighting.

I ended up exporting all of my old blog posts from WordPress. Rebuilding the entire site (~370 pages) takes about 4 seconds.

The biggest problem I found was that I had to modify tufte.css to make it work well on mobile.

Care to post your site?

Mine, if you are curious: https://sheep.horse/

Re:Text-Only Websites by noir_lord on Wednesday June 24, 2020 @02:48PM (#23632189)
Great minds, my site is on my real name and I'd rather not connect my user name with my handle so publicly, it's got nowhere near the amount of content yours has though.

In my case there is a certain irony in writing it in Python the lazy way since I'm a full stack dev who writes typescript, js and PHP for work.

Never trust a builder with a finished house I guess applies, I didn't want anything I'd have to maintain.

Re:Text-Only Websites by yobananaboy on Thursday June 25, 2020 @02:04PM (#23643610)
I really like the margin notes layout of your site! Might have to steal that.

edit: oh wait that's what the Tufte css is! What tweaks did you end up making?

Re:Text-Only Websites by bradley_taunt on Friday June 26, 2020 @08:48AM (#23651380)
Not to be annoying and plug my own projects, but I've tweaked Tufte CSS to work within a jekyll theme: https://et-jekyll.netlify.app/
Re:Text-Only Websites by AndrewStephens on Friday June 26, 2020 @06:19AM (#23650426)
It might have changed recently, but tufte.css used to behave badly in portrait (say on a mobile phone, or just with a narrow browser window.) Part of the problem is just the design works a lot better in landscape.

It took me a lot of fiddling before I managed to find an acceptable compromise.

If I was going to start again I might consider implementing the margin notes differently. They interact oddly with each other and image captions.