Notebook 3.0.0, Leap-day Snapshot

I’ve been stalled on Notebook development for the last month or so, and I’m not ready to dive back into it in a big way; nor is Notebook 3.0.0 finished, by any stretch of the imagine. Nevertheless it’s reasonably stable at the moment, and there’s quite a lot of interesting stuff in it, so I’ve built Windows, Linux, and Mac OSX executables based on today’s snapshot of the code. You can find them at the Notebook development website. Bugs can be posted at the same place, and users can feel free to contact me questions or problems.

Section Numbers

Another feature that’s probably been asked for, that I’d like myself, is auto-numbering of sections. In the style which I prefer, top-level sections are numbered “1.”, “2.”, “3.”, subsections are numbered “1.1”, “1.2”, “1.3”, and subsubsections are numbered “1.1.1”, “1.1.2”, “1.1.3”.

In Notebook markup, sections are created by adding first, second, and third-level headers, i.e.,

  = Main Section =

  Random verbiage...

  == First Subsection ==

  blah, blah, blah...

  == Second Subsection ==

  yadda, yadda, yadda...

In classic Notebook, the section headers are just the strings that appear here: “Main Section”, “First Subsection”, and so forth. But now you can have them automatically numbered, i.e., “1. Main Section”, “1.1 First Subsection”, etc. All you need to do is add a “meta parameter” somewhere to the text of your page, like this:

  #meta sectionNumbers

Meta parameters were added toward the end of Notebook 2.1 development, and were never really used for anything. This is the first documented meta parameter; its presence simply turns on section numbering.

Of course, this just whets my appetite for additional features. For example:

  • How about a floating table-of-contents at the top right of the page? Click on a section and jump there!
  • And then, clicking on a section header should probably take you back to the top of the page, where the table-of-contents is.
  • And there should probably be a preferences item that turns on auto-section-numbering for all “nbm3” pages.
  • And probably you should be able to choose your preferred style of section numbering

I don’t say that all of these are going to go in immediately, mind you…though the table-of-contents would be really slick.

At long last: Numbered Lists

One of things Notebook users have been asking for almost from the beginning is numbered list, like this:

  1. First
  2. Second
  3. Third
    1. Third, Part 1
    2. Third, Part 2

My latest development build supports this, using MediaWiki-like syntax:

  # First
  # Second
  # Third
  ## Third, Part 1
  ## Third, Part 2

It isn’t quite ready for prime time; there’s a bug in the HTML widget I use for rendering “nbm3” markup that’s preventing me from assigning the numbers properly, and working around it would require significant changes in how I render a page. The Tkhtml3 developer, Dan Kennedy, has fixed the problem; I just don’t have that version of the widget yet.

I might decide to revamp my rendering scheme anyway, as it would produce more typical HTML than my current scheme. But the bottom line is that the next release of Notebook will support numbered lists.

Notebook Markup: Headers and Whitespace

In Notebook 2, you can add section headers into your pages. This, for example, gets turned into a first-level header:

    = All About Penguins =

Or, rather, it sometimes gets turned into a first-level header. There pretty much has to be a blank line before it; if you enter something like the following, your header will become part of the previous paragraph:

    ...end of previous sentence.
    = All About Penguins =

Also, in Notebook 2 you have to remember the space characters; this won’t work:

    =All About Penguins=

I’ve fixed all of these things in the new parser, which is a good thing. However, there are still some issues.

In normal HTML, text marked as a header will typically get separated from the preceding and following paragraphs by a certain amount of whitespace. In Notebook 2, by contrast, you get blank lines where you put blank lines in the text of your page. That means you always get at least one blank line before a header (since, as I noted above, it isn’t a header without one) and you get a blank line after a header only if you want one. That is, this gives you a blank line:

    = All About Penguins =

    Penguins are fierce creatures who roam the Antarctic veldt.

And this doesn’t:

    = All About Penguins =
    Penguins are fierce creatures who roam the Antarctic veldt.

I can retain this behavior, or I can change it so that blank lines before and after the header line in the input are ignored, and the header always gets whitespace before and after.

Any one have any thoughts one way or the other?

Notebook 3 Markup Design

I’m beginning to contemplate extending and changing Notebook’s preferred markup for Notebook 3. The plan is as follows:

  • Notebook 2 markup (nbm2) will continue to be supported indefinitely. In Notebook 3, you can choose the kind of markup you want to use, page by page.
  • Notebook 3 markup (nbm3) will be based on nbm2, but won’t be identical. It will be extended (i.e., with support for tables) and may have other changes designed to make it easier to use, easier to parse, more powerful, or all three.
  • If nbm3 turns out not to simply be a superset of nbm2, I expect to provide a translator between nbm2 and nbm3 so that you can easily update your old pages if you would like to.

In short, while I’m not setting out to define something entirely different, I’m open to making significant changes as well.

So…if there’s something about the existing notebook markup that you dislike, or something that you’d like to have, please get in touch! (Note that there are already quite a few requests in the bug tracker.)

I’ll give an example: In nbm3, enclosing a word or phrase in stars *really* ought to make it boldface, as that’s a convention most of use in e-mail and other plain text anyway. So nbm3 might handle boldface like this:

  • Star-notation, i.e., *this is bold*, might replace apostrophe notation, i.e., '''this is bold'''; or we might support both.
  • The older <b>this is bold</b> notation will be retained, as it can work in cases where one of the other forms would be ambiguous.

If you’ve got opinions, let them be heard!