Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Section namespaces #53

Closed
NQNStudios opened this issue Dec 23, 2017 · 4 comments
Closed

Section namespaces #53

NQNStudios opened this issue Dec 23, 2017 · 4 comments

Comments

@NQNStudios
Copy link
Collaborator

NQNStudios commented Dec 23, 2017

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
Copy link
Owner

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

invicticide added a commit that referenced this issue Dec 24, 2017
Also simplified file paths in error messages to be project-relative so they're not so verbose and ugly
@invicticide
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants