Cant get properties (sp-colon-sp) to work

This is basic documented functionality, so I’m sure I’m doing something wrong.

To review what I understand: There are two forms for tagging FoldingText documents.

  1. Tags are quick inline tokens, beginning with @, with an optional string argument. The expectation is that if present, the string will be brief.

  2. Properties are single tokens, at the beginning of a line, followed by : (space-colon-space). A free-form string may optionally follow the : marker.

There is no semantic difference. The two words are just names for the two ways to create the same thing.

Okay?

I have a FoldingText document open (it’s empty, I run into it in a populated document, too). I type

@fixme(this is a problem)

It turns gray and responds to clicks by focusing on @fixme tags. It shows up in search and navigation as I expect.

Next, I try

fixme : this is a problem

Neither the tag nor the content show up in any navigation affordance. It does not change color, nor does it behave as a link. Instead, the tag word is italicized.

Leading whitespace doesn’t matter. (I had hopes for putting @fixme(etc) into a comment in a Ruby codeblock, but no luck, and it doesn’t matter.)

I’m doing something wrong. What is it?


  • FoldingText — 2.0.2 (738); it and the following plugins were installed the evening of 7-Aug-2014 US CDT promptly after download
    • filter
    • jmk_panel
  • typography
  • Mac OS X Mavericks — 10.9.4 (13E28)

user.less includes

@fontFamily: Input Sans;

and nothing else outside of comments.

This part isn’t true, they are used for similar purposes (attache some attribute to a node) but the implementation is different. And generally there’s more UI support for “@” style tags… such as clicking to filter. Also properties aren’t added to the owning line as CSS styling, while tags are.

Generally for your own tags I would suggest using “@” tags. Where properties are more useful is in implementing modes. For like the timer/stopwatch mode that needs a place to store a reference date. In that case it could also be stored in a “@” tag, but I think its cleaner to do in a property.

Jesse

Just in case this isn’t immediately apparent:

Difference between tags and properties

Tags are inline strings in the text of a node @alert(2014-08-17 14:00),

  • but properties are children of the node, and have their own indented line.

For example, if we script the addition of a property to each of these 3 lines:

#### Difference between tags and properties
Tags are inline strings in the text of a node @alert(2014-08-17 14:00),
- but properties are children of the node, and have their own indented line.

Using this:

function(editor, options) {
	var	tree=editor.tree(), lstNodes=tree.nodes();

	lstNodes.forEach(function(oNode) {
		oNode.addPropertyNode('propName','propVal');
	});
}

The result is:

#### Difference between tags and properties
propName : propVal
Tags are inline strings in the text of a node @alert(2014-08-17 14:00),
	propName : propVal
- but properties are children of the node, and have their own indented line.
		propName : propVal

In which the key:value property pairs are indented children of the nodes they belong to.

(NOTE: In order to ensure that lists are by default always subordinated to (collapsible under) preceding body text, list items are always treated as already having one indent, even when there is no tab character before the bullet. To indent a note or property under a list item, we need one tab to establish parity, and a 2nd one to properly nest our note or property as a child.

The property node attached to the heading above needs no indent because non-heading material always descends from any heading that precedes)

Conclusion

For most purposes, property nodes may not be the format you are looking for.
As Jesse suggests, usually simpler to use a tag string …

I knew I was missing something, and I’m glad for the clarification. Thank you.

Either I should read the documentation more closely, or the docs don’t make the distinction clear. I’m under deadline for another project, so I can’t do my duty and determine which is true.