invicticide / fractive

Fractive is a free, open-source, Markdown-based hypertext authoring tool for writing interactive fiction.
http://fractive.io
Other
37 stars 5 forks source link

Section namespaces #53

Closed NQNStudios closed 6 years ago

NQNStudios commented 6 years ago

With projects of a certain size, it will be necessary to allow disambiguation between duplicate section names. This could be handled automatically by making each source file a namespace, or they could be organized by subfolders, or they could be defined manually somehow.

Maybe namespaces are organized by file automatically, but are invisible until disambiguation is necessary. For example, a link to section {@Section3} will automatically direct to {{Section3}} declared in a different file, unless {{Section3}} is declared in the current file, in which case the local instance takes precedence. To disambiguate, we could use the syntax {@otherfile/Section3}.

invicticide commented 6 years ago

All {@otherfile/section} links would break if sections are ever reorganized into a different file, requiring manual fixup by the author. I think I'd rather see authors handle this with a naming convention of their own choice, like {{Chapter1-Intro}} vs {{Chapter2-Intro}} for example.

NQNStudios commented 6 years ago

I don't know. Seems like a lot of work, and there must be something we could do behind the scenes to make it easier.

NQNStudios commented 6 years ago

At least, a compiler warning for duplicate section id's would be great.

invicticide commented 6 years ago

There is a known issue here where the reported line number of the duplicate section definition may be wrong (it mostly seems to just be zero). That's being tracked on #59.