-
Notifications
You must be signed in to change notification settings - Fork 124
Possible clash with index.html and a top-level name index #585
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
Comments
Some ideas for solutions: Under the directory for the library:
Nice thing about this, is that we would no longer need to append |
One other thing to consider is that these docs will be hosted in a number of different places (api.dartlang.org, random github.io pages, dartdocs.org, ...) and IDEs and other tools will want to be able to construct URLs that point to libraries/classes/members in order to jump to hosted docs. So having a simple, reproducible scheme to map from a library/symbol/member to a URL or path would be a good thing. For things like storing into a Some things we could take advantage of are that
Here's a possible layout:
|
or:
|
@keertip what was the case that forced us to append |
Would an IDE know the filename (e.g. I'm hesitant to bake in the file name into a URL structure that should otherwise use "logical" names. The file name seems like an implementation detail. I'm leaning towards #585 (comment) |
I found it: "There was a case where the library (path) had a property and class of the same name, and so dartdoc was not getting the links right." More specifically, there is a getter called style and a class called Style. In a case-insensitive file system, these will clash. There's a generalized issue here: Dart has case-sensitive names, but file-systems don't necessarily. In Dart, you can do:
So, what's a generalized solution to creating filenames that never clash, yet are still SEOable and still logically discoverable? Some research:
I think we need to worry about not clashing with files we introduce (like, index.html) and not clashing with similar names of the same "type" (class, function, etc). We should support this:
and generate two files. I don't think we need to support:
The requirements I can come up with are:
I believe we need to, at a minimum:
[1] types == function, class, property, etc |
So how about
The index for the library need not be called We could also use the file name for the library index, then the IDE will not have to special case for anonymous libraries. |
Could a top-level name ever be the same as a library? If so, not sure we could create @devoncarew wanted to keep it "easy" for tools to take a name and construct a URL to the docs. Would In general, using |
There is no rule that says the library name is unique, so maybe we could do |
So go ahead with |
Looking at #585 (comment) I think we'd potentially get a clash with a library name and a class name. Class names and library names can clash, can't they? So, putting We could do |
sgtm! |
Consider the case where a library has a top-level name called
index
.This will clash and overwrite the
index.html
we generate inside the directory for the library docs.The text was updated successfully, but these errors were encountered: