Using TiddlyWiki to write a book, in this case non-fiction

Do you know of or have you used tiddlywiki to write a book?

I am looking for “prior art” on this before I start writting my own book :nerd_face:

I have just done a fairly extensive search here in talk.tiddlywiki to find if there was examples of wiki editions for a book author to use. Although I have often responded to authors asking about using tiddlywiki for this purpose, I have not found any substantial examples, although there are a few plugins and tools with an honerable mention to clsturgeon.github.io/MemoryKeeper/ and https://groktiddlywiki.com as an example but also refnotes and a few others.

I hope to avoid starting from scratch, but will if I must, because writting a book is a substantial effort that could really benifit from TiddlyWiki support. Dont count on ever seeing my book, this is my first attempt and I dont even know if I can do it.

I am seeking information about actual book authorship if possible.

Thanks in Advance.

2 Likes

I know @xcazin was (is?) very involved in how to make TW useful for professional book publishing.

I also know I saw a TW based book (in a TW, not on paper) perhaps 10 years ago but I don’t recall who or where to find it. It was a book about… was it love or self-help? Something in that direction. Poetically written if I recall. Of course, it is pretty much up to the author to define what exactly qualifies as a “book in TW”.

From a technical viewpoint, I’d say that creating a book with TW is very much a matter of CSS (!) It would be wonderful if there was a generic “book writing theme” or “book writing edition”. Alternatively, a route without CSS might be some setup to export the tiddler content into some dedicated book authoring software.

1 Like

Thanks @twMat for your responce, in this case I plan to keep the book private and eventually publish on paper and/or and ebook. I assume your focus on CSS relates to putting it online?

No no, regardless if the plan is online or paper, I’d say it is very much a styling matter - or how would you otherwise control the appearance of the output from the html document? If you print, or even just use the browsers preview print tool, the necessity for special styling of a TW is immediately obvious… typography, color schemes, text alignment, line spacing, margins, page element layout, …

…but if it is a merely a book for yourself then, obviously, I can’t say what matters :slight_smile:

3 Likes

BTW, I’ve by now co-written several books for use in my elementary school science classes. I wish I could do this in TW, especially considering how low the standards are for my use case, but it has not been practically possible because of the complexity of the pages. Here’s a sample page… it is just totally impractical to create in TW:

image

But maybe your use case will not be image heavy and with special formatting needs like this.

3 Likes

Interestingly here I do not think of those aspects of writing a book, to me its all about text, content and its structure. Perhaps wrongly, but I thought the details of layout and appearance would be decided in the end, by the publisher, I think of it more as using a type writer, perhaps showing my age. During my youth I marveled at the golf ball IBM electric type writer.

Of course it is different if you are going from writing to publish online when the author is likely responsible for the beginning to end. Including diagrams, layout and “type setting”.

  • I am all for doing what you say but feel I first need to focus on the text.

I did expect to spend some time in diagrams or images to illustrate some concepts, as I do when writing instructions, as I have done for manuals. But that is an example of when it goes from my head to the reader. My book idea is more of a text based book. :thinking:

[Edited] For example would streams, and later the related fusion be a good way to wwrite a book, allowing sections to be written in chapter (tiddlers) allowing sections to be reordered as needed, although initialy heirachical they are collapsed at the end of the day into a linear text.

  • Perhaps one could author a whole book in streams but view and read it is a consolodated view?
  • In understand there are a number of bible implementations but that has a lot of references and labling I am not interested in.

No, but I’ve done a legal document that runs to a few dozen pages, with very small content tiddlers recursively transcluded into longer and longer ones, until the chapters are wrapped in one main tiddler. Similar structures should be useful for non-fiction books. But I don’t know if it breaks down at scale. And to @twMat’s point, there is no complex formatting required for this. That might be a deal-breaker.

There has been a fair bit of discussion recently on print css. I think we’re getting close to the point where we can print substantial documents with a small amount of CSS. I don’t know if that extends to book length. I can think of several gaps. For instance, I can’t find any way to ensure that chapters start on odd-numbered pages. Nor can I find a good way to make a reference to a dynamic page number. (For example, “See Table 3.1 on page 74”). But we can go pretty far at this point.

As to the complex layout, we should be able to create fairly sophisticated layouts in CSS, and most of those will work well when printed. As to your sample page, we can do paragraphs, headers, tables, and centered images easily. (The off-center bottom one might take more work.) It would be easy enough to create a blank-lines procedure. Perhaps surprisingly, the most challenging thing I see on that page are the bottom-right floating question numbers, [1] and [2]. I can’t immediately see how to do those, although I’m sure it’s possible.

2 Likes

Oops, I guess that’s already there:

break-before: right ensures that a chapter begins on the right-hand page. Off to test this!

Update: This didn’t work in a naive test. I’ll try again when I have more time.

I have a hunch I have seen something about this. I think you can use a CSS calc to get the number of pages to do page X of Y, given that you can test if the page number for being odd or even. Then force a page break if needed, which adds another page and places the content on that next page ie the odd or even one. But I am not sure.

Printing

I would like to reserve the possibility to generate a final book, but it is not yet my intention, however I may need to “give the book away” :laughing: in the end. Not that this necessarily stops me achieving what I want to do with this book, but that is another story :nerd_face:

The main thing I want is tools to help write and organise.

Also tools to assist with draft sections, ensuring I revisit and take them out of preliminary draft, then later out of draft altogether. Similarly with their placement in the book.

  • Of course I need footnotes, links, book and authors references etc… so need them to work with streams. This may be the hard part.

I am currently thinking I may base the book on a tiddler for each chapter, then using streams divide it into sections and smaller units as desired, however ultimately collapsing the resulting hierarchy into a flatter one (primarily Chapters and Sections).

I think I would like to see the automatic streams tiddlers get renamed into searchable titles, allowing me to search based on title only, and/or content. Then if something does not belong, pulling it out of the heirachy, and keeping it for placement elsewhere if needed.

Like essays, I think I need to later present introduction and conclusions on chapters and sections that telegraphs what is to come, or summarises susinctly (yes I must fix my spelling and grammer checker) as I am prolific with typos.

At the moment I need ideas about how brainstorm then to write and structure a book.

You might find this thread interesting. It describes a flexible way of combining block/outline tiddlers into larger components.

However, I’m still in the early stages of designing an edit UI for the components that uses. It’s not proving particularly easy. The closest analogy would be to Streams, but my use-case is different enough that I can’t use it, nor likely even hack my own choices atop it. I may go back to adding content instead, for a while and mull this over some more; the edit UI is something I don’t really need myself. But eventually this would be taken over by someone with no prior TW experience, and it would have to be simple to use, and fairly self-explanatory. That’s hard work! :slight_smile:

1 Like

IIRC @CodaCoder uses TW for long-form writing. I think he’s discussed his approach in various threads here over the years, but perhaps he can give you some more targeted advice?

2 Likes

Very much so. For the longest time I called it BK-TW. Then, just a few months ago, “TiddlyBook” arrived in my brain :man_shrugging:. I know. Too slow to catch a cold.

It uses (and expects to use) multiple monitors. It is completely unusable on a single monitor setup.

One day (:roll_eyes:) I may get to the point where it’s sharable. It’s not that it’s “unfinished” (much like TW, it never will be), it’s just bloated with seemed-like-a-good-idea-at-the-time stuff that really (no, I mean, REALLY) needs to be purged, culled, whatever.

A few years back (2015/16-ish @TiddlyTitch?) I dumped the whole of Lord of the Rings into it (yes, in its entirety) just to see how it would stand up. Worked really well and led me to extend its “analysis” tools and annotations capabilities. For example, once a work is suitably “marked up” it’s easy to list every utterance of a specific character, e.g. every word spoken, or thought shared, by Frodo. Vital if you want to ensure consistent “voice”, etc.

Now I use it for everything, just because of the tooling.

Regarding document production:

In Firefox, I’ve printed tiddlers to PDF. Works really well.

In TiddlyBook’s “BookView”, I can export HTML and use Caliber to produce EPUBs. Though I haven’t done that in a while…

4 Likes

Thanks @CodaCoder if you are not in a position to publish an edition yet, I know thats a big ask, is there an example online?

Or could you share any specific structural or key plugins you can advise made it?

My version currently has;

  • Projectify for book, wiki, and other related todo items
  • Streams and some useful customisation 1 stream tiddler per chapter
    • including set to create non-system tiddler nodes, often renamed.
    • Although writting it may be quite heirachical I plan to flatten that to produce the readable book.
  • Relink

Thanks in advance, if you can suggest some of your “best ideas”.

I neglected to address that, above…

Numero uno thing is, the story river does not lend itself well long form document/book construction. Endless scrolling to look for stuff? No thank you.

In TiddlyBook, the story river (and sidebar) is only used for infrastructure development (macros, css, templates, etc) on monitor 4.

Production text (the book chapters) are written in standalone editors spread across the remaining 3 monitors. They sit where they’re placed and stay there.

1 Like

It’s not available online. As a wiki, it would be pointless/useless to host it somewhere (multiple monitors!)

Key plugins:
CM6 (@BurningTreeC’s version, it’s the best).
regexps (@Mark_S)
Bundler (@pmario)
EditorCounter (@telmiger but customized)
debug-log-filter (@Yaisog)
action-timeout (@EricShulman)

Truly, regexps is the “busiest” yet most invisible of them all. TiddlyBook wouldn’t be where it is today without it.

FWIW, I don’t use any of the things you listed.

1 Like

There was a French website (i think it was French) which had started to publish ebooks in TW format. Can’t find a link here (not had a comprehensive search) might be on Google groups?
I appreciate that’s all a bit vague news…

And there are a few Bibles around.

I think it is worth, at least in this thread, to distinguish between what TW actually “features” and what “might be possible” and perhaps “what we want”. I think an official “TW book writing edition” would be an appealing use case to some potential users butthe fact that we don’t have one is an indication that it’s not so simple to create one.

But there is another critical aspect to it, which is why I gave up the book writing on TW, as exemplified with my sample page here above: I may not be overly difficult to achieve such a page - if it was “one page”. But my need is for hundreds of such pages where the task for me as the author should be the authoring, not the tiddly fiddling. One specific example of what I refer to is images; they need correct size, at right place, probably caption, etc. That must all be super simple to set. (In the end I settled for Google Slides, basically Powerpoint, to create my books, which obviously is not a proper “book writing tool” but its ease of use is what sealed the deal, and I’m still happy with it… but I wish it could be TW as that would bring other superior possibilities… )

1 Like

I think general-purpose editions are a hard problem in general (or I would have completed a recipe one ages ago! :frowning: ). My suggestion about your page was that if you could lay this out in a tiddler using your usual TW tools and CSS, then this would be easy enough to incorporate into a book.

To create a book edition, we would need tools to combine small parts into larger wholes (or, streams-fashion, split large parts into bite-size editable pieces. I think we could, if we wanted, find a convention to allow us such an ability:

  • a parent field for any content, with an additional ordering mechanism
  • a children list field
  • a tiddler naming convention that incorporates the hierarchy.

The second one is probably most flexible, but any of them would do.

We could easily write a page-break procedure/macro that allows us to customize pagination, and use the CSS techniques discussed above to handle the rest of it.

But I have no current need for book-writing edition, and, while I would be willing to help, I certainly wouldn’t lead the charge. I am invested in method 3 above, but it’s for a related, but not identical use case.

I don’t quite know what those “usual” tools would be, but I can imagine that such could be created albeit with quite a bit of experimenting. Again, I’m not talking about “a page” but hundreds of different pages, (possibly closer to a thousand come to think of it) so to set up the pages must be minimal effort. To again use “images” as an example it would have to be something that, first, easily gets the images into the TW. I know that importing of images to TW has been substantially improved but I don’t recall the specifics at the moment. But, OK, let’s say all the images were somehow easily imported, as links. This I would actually expect to be rather simple but I’ve never done it so maybe it is not. Then those image-links actually have end up on the book pages tiddlers, easily. They must be easily resized and exactly positioned. Some images should be bigger, some smaller. “Smooth resizing” would probably reqire some flexible drag-the-edges-to-resize feature, so there’s one non-trivial tool to create. Second, I have no idea how it would easily be positioned at arbitrary places, in a smooth way. Manual xy-coordinates is probably out of the question… or possubly acceptable if there’s some kind of directly seen grid on the page? That’s yet another non-existing tool. And how about the text flowing around the image, or not. More features to create. And how about annotations on the images? And, and…

…OK, I think my point should be clear. I gave up pretty quickly.

1 Like

Although it may not be suitable for creating any entire book of pages, see https://tiddlytools.com/#SamplePasteUp for an example of a grid layout tool for creating free-form “paste up” tiddler content.

It uses macro code from TiddlyTools/PasteUp and a ViewTemplate from TiddlyTools/PasteUp/View to provide an interactive grid layout tool. Using this tool, you can place any literal field values, transclusions, widgets or macro output at any arbitrary grid position, and apply CSS to each of those elements to add extra styles to the output. It also supports “layers” so that elements can overlap each other.

To try it, view the above “SamplePasteUp” tiddler and click on the “lock” button (upper-left, above the grid layout). Then, just click on any element displayed in the grid to show a modal dialog to edit that element. The grid also handles drag-and-drop to move/resize elements.

You can also click on the “This is a Sample PasteUp >>” heading above the grid to view a table containing a summary of all the field value definitions, top/left/bottom/right/layer coordinates and added CSS styles. The table cells are directly editable to make changes to the layout, which are immediately refreshed in the grid display.

enjoy,
-e

2 Likes