Shoes3 / ebook

An interactive eBook written in Shoes.
2 stars 0 forks source link

Handle single md better #14

Open ccoupe opened 7 years ago

ccoupe commented 7 years ago

I came across a README.md that was structured in an interesting way that I'm pretty sure would not fit with what we've done so far. It had a couple of paragraphs of how to install the gem followed by an in-page menu of created with md ordered lists, and sub lists 'ol, ul' in html terms that pointed to html page anchors ( url#my-2.3) And then the actual document with anchors mixed in to the headers. Very clever. I should have saved the url but it's easy enough to modify our README.md to create that.

IanTrudel commented 7 years ago

Header anchors seems something we can handle. It's basically a link as in [link](#anchor).

ccoupe commented 7 years ago

seems something we can handle. It's basically a link as in link.

Actually, it's not that simple w/o some vicious and ugly special casing in the kramdown parsers. It can be done but no one is going to like it. We don't have way to move inside a single document.

ccoupe commented 7 years ago

What has to be done here is a lot like if we had Shoes-manual.md in one big file. Currently the generated Shoes/Ruby to be evaluate is tied to a file name (.md) because in the general case there can be many md files in many directories - sections (or chapters if you like). The show_render navigation code knows that.

It's certainly possible to call a different set of Kramdown parsers/converters - we already detect this situation as 'one file', 'no menus' and it just barely gives a Shoes experience. That said, it's a lot of work.

ccoupe commented 7 years ago

I actually have something to work with. This the README.md (Tests/single/foobar.md) deeplook-begin

Obviously it should not display double subsub-sections, and only the second displays something. The screen capture is 'Harder Install' and it shows many problems with the generated Shoes/Ruby. Some problems will be easy and some not so easy.