Outline-style text files

I would love to have an option to disable markdown rendering of a document. It would make Notenik suitable for outline-style text files (eg those generated with Bike).

The setting could be at collection level or document level.

Section 3.6.9 of the Knowledge Base (accessible from the Help menu) discusses the built-in outlining Collection, if that helps.

Thanks for that. Unfortunately, that is different from what I’m looking for. I have hundreds of simple text outlines stored in The Archive, but Notenik offers features that I really like and I would like to migrate.

The idea is to outline structure text files with tabs (using a standard editor or a tool like Bike) - see example below. The Notenik editor displays everything perfectly, but once it switches to Display, then the rendering destroys the structure.

Example:
level 1
level 2.1
level 2.1.1
level 2.2
level 2.2.1
level 2.2.2
level 2
level 2.2

the example above failed because the editor stripped out the tabs … sorry

That structure is maintained not in the display of the file itself as you note but in the right hand List panel.

I’m not familiar with the Bike format itself but it sounds like it contains the entire outline, where the outline Collection consists of a separate file for each topic in the outline.

Some work to convert, no doubt.

Thank you for looking into this.

Your focus is on the outline structure of the documents (as you have mentioned before, the knowledge base is an example of that). I need that too, but what I’m missing in Notenik is the simple ability to display a text file ‘raw’, no rendering (& no stripping of tabs). One way to visualise what I’m after is this: take Notenik’s knowledge base, leave its outline document structure unchanged, but change each of its component documents to plain text files (not md files).

I’m already using Notenik with conventional markdown files and it works very well for that, but I will have to abandon the idea of using it with simple text files.

Yes, not even wrapping the text in <pre> tags will honor tabs. I suppose this is an issue for @hbowie to address.

Thanks for your suggestion, @marimba!

Something like this certainly sounds doable.

Let me just ask a few questions.

  1. Are we talking about plain text files, with no metadata that you want Notenik to pay attention to?

  2. Would it make sense to trigger this behavior with some sort of initial directive line at the top of each text file?

  3. Or would it make more sense to have it as a Collection option?

Looking forward to some dialogue on how to best implement something like this.

Thank you Herb & Mike for engaging with this.

In answer to your questions:

  1. the files are plain text files, but I would prefer to keep the metadata. That would preserve Notenik’s power in working with those files. Of course, the ideal solution would be to make the metadata optional.

  2. To trigger the behaviour: it would be OK to have it as a directive in the metadata. Alternatively, one could use the file extension (txt for text files; md for markdown). I prefer the latter.

  3. ideally, a collection would have a mixture of markdown & plain text files. There could, however, be a default setting for a collection when creating a new file.

Patrick

@marimba Thanks for your answers. These are helpful. Let me think some more about this while I work on some other issues.

1 Like

I have attempted to address this in 11.7.0. I think I’ve covered all of your requests. The way it’s implemented is a little tricky. There’s a new field type now, called Text Format. If you add a field of this type to a Collection template, then you will see a field in the user interface that allows you to choose between Markdown and Plain Text. However, rather than storing values for this field in the metadata of your Notes, Notenik will use the file extension to indicate your choice. (By making this a field, the user can choose the appropriate text format type when adding a new Note, or change it for an existing Note.)

The full description of the new feature is in the Knowledge Base.

Looking forward to hearing how this works out for you! Let me know if I’ve left any rough edges, and I can try to sand them off in the next release.

That’s great news. I’ve already started using it and my first impressions are very positive.

I’ve encountered one issue so far: I have created a number of text files (they work well) and one markdown file so far (with links to text files). When closing the collection and reopening it: the markdown file setting has been changed to text file.

Thanks again for your amazing response.

Patrick

I forgot to mention that when I manually change the file extension of the markdown file to md the problem goes away

Thanks for the feedback. Glad it seems to be generally working well!

I played around a bit with the test Collection I created and so far I haven’t been able to reproduce the problem you’re seeing.

Let me try to confirm my understanding of your situation.

  1. When you open your Collection, and look at the Collection settings, it shows a preferred file extension of ‘md’.

  2. Your collection folder (when viewed in the Finder) contains a file named ‘template.md’.

  3. You have one Note that shows a Text format of Markdown, and it contains wiki links to a couple of other Notes with Text Formats of Plain Text.

  4. When you close the Collection and reopen it, the Note that previously had a text format of Markdown now has a text format of Plain Text. And when you look at it in the Finder, the file now has a file extension of txt instead of md.

Am I understanding correctly?

Thanks, Herb.

  1. the default file extension setting for my test Collection is ‘txt’

  2. the collection folder contains template.txt (not template.md)

  3. I now have several notes with Text Format: Markdown. They contain wiki links to Notes with Text Format: Plain Text (and also to some Notes with Text Format: Markdown)

  4. When I create a Note with Text Format: Markdown. It saves it as a txt file and next time I open Notenik, it is shown as a Plain Text file. That behaviour is consistent.

  5. When I change the file extension of such a Note (which I need to display as Markdown) manually from .txt to .md I get behaviour I cannot reproduce. I’ve had several of these files being changed back from .md to .txt by Notenik itself. However, it is not editing the md file that does it, it is something else. I will have to experiment more to see what action(s) makes it change the extension.

Overall though, I really like the approach very much.

One question would it be possible to make wiki links in a Note with Text Format: Plain Text active? That would be great to have. No rush, of course.

Thanks again.

Patrick

OK. I see the problem. The default file extension setting for the Collection needs to be ‘md’ (or at least something other than ‘txt’). This is because Notenik is not generally prescriptive about the file extension you use. If you specify a text format of plain text, then Notenik will assign a file extension of ‘txt’. But if you specify a text format of Markdown, then Notenik will assign whatever file extension you’ve specified at the Collection level. So, if you’ve specified ‘txt’ at the Collection level, then Markdown files will get assigned an extension of ‘txt’ as well, and then Notenik can no longer tell the Markdown files from the Plain Text files.

I imagine what you’re wanting is for new Notes to default to the Plain Text format, but at this point, there is no way to do that.

In answer to your question about wiki links from plain text to Markdown, I didn’t envision that being possible (since wiki links are part of the Markdown parsing).

On the other hand, though, I hadn’t really thought about wiki links from Markdown files to Plain Text files, until you told me you were doing it.

Can you explain your use case a bit more? Bike doesn’t honor the wiki links, does it? (I have a copy of Bike, but haven’t actually been using it, or keeping up with it.)

Ah, thanks for that, Herb. I’ve changed it. It is only a very minor inconvenience for me.

1 Like

I realise that you would to parse the text files. It isn’t actually very important to have wiki links in the txt files. The most important thing is that I have wiki links in md files linking to txt files. That’s working very well now in Notenik.

Bike supports its own link format in txt files, but I wouldn’t want to use them for files residing in Notenik. As you may aware, Bike supports three formats: plain text (which I use in Notenik), OPML and its own format (BIKE) which is actually a subset of html and can be displayed in a browser.

1 Like