-
-
Notifications
You must be signed in to change notification settings - Fork 380
move "D Reference" pages to /spec/ #896
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
Conversation
I agree.
No, but we should. I'll ask the system administrator to enable it.
But I don't like this solution. It requires two .php files to maintain compatibility with URLs with and without the |
We now have The existing redirects should be migrated to those. We should also see if we have links to redirect pages in existing pages, and either fix those to point to the redirect targets, or leave the HTML meta redirects as is, so the redirects keep working without Apache. |
Note: |
What is the motivation behind this? It looks like a lot of churn for a small benefit. Also, assuming this goes through, the redirect pages should be all generated with a macro. |
Ideally, the redirect pages should be all replaced with a few lines in |
Sweet. Added a commit to use them. Not 100% sure about RewriteBase.
The goal is an indepently searchable language reference. As discussed (a little) here: http://forum.dlang.org/post/mailman.5287.1422186138.9932.digitalmars-d@puremagic.com |
I think this will enable us to search the language spec via google (currently you can't limit searching only to the spec because all pages are in root apparently). |
The benefit is small, but you might be overestimating the amount of "churn" as well. The redirects will make the move transparent to users. |
So, what's the status on this? And is my statement true about making things searchable? It would really be a welcome change. |
Yes, it is true. I have attempted to construct a Google search that only searched the reference, and could not. Even if it is possible, it would require many search operators and filters. |
@andralex If you don't find this pull request acceptable as it is now, we can only change the location of the generated .html files, without moving the .dd files. This should avoid most of the "churn" you speak of. |
It makes it even easier to edit these files if you know the language reference is in its own folder. |
Sounds like we could achieve the searching using annotation files. |
Hmm, looks like those files still need to be uploaded manually every time they change, as opposed to auto-discovery like robots.txt or sitemap.xml (or even a parameter to the search widget)... |
I just realized that we can implement this with only .htaccess changes. Make /language/ URLs redirect to non-/language/ locations internally, and non-/language/ URLs redirect to /language/ URLs using a HTTP redirect. |
OK, not really, because of all the relative links to static resources, and because we can't rely on the .htaccess always being in effect (as it would prohibit testing offline). |
Where is the problem, you need to upload the updated pages as well. It's just a matter of generating them automatically. |
You have to use a browser or write an API client, assuming one exists, and then there's the matter of Google account access. OTOH uploading dlang.org is one command. |
I had much less trouble to support |
We shouldn't break that. |
If I get this right, that would mean updating the annotation files when a spec page is added/moved. I'd prefer a more automatic solution.
|
We could reuse our .dpl_rewrite_map.txt file for the redirects. I think a separate search for the language specs is well worth the effort. |
So should we go forward with this? |
I think we should, with the following ultimate purpose in mind: language reference should be accessible for specific versions of the language. For example, lexical is now http://dlang.org/lex.html. We should have http://dlang.org/reference/2.067/lex.html and so on for each version. http://dlang.org/lex.html redirects to the latest version. That way people who work with a specific version of the language can see what the definition was at that release point. |
Not sure we want a redirect, in most cases the intention is to link to the latest version of a page rather than a permalink to whatever version is latest at the time, so I think having the latest version at one location would be better. There's also the issue with search engine indexing that I mentioned before in regards to versioned Phobos docs. How would this be achieved? Forward-porting DDoc files to the current layout and macros, or archiving old HTML files as they were built? Either way, given that this task is non-trivial, and given that we distribute documentation in a variety of formats with the compiler, I doubt that this will add enough value for the effort. |
@aG0aep6G Anyway, if you want to update this we try an expedited merge. Last I looked I didn't see any technical issues with this PR. |
9ee6aad
to
d940988
Compare
Updated. Still going with the Regarding versioned variants of the spec/reference: I think |
Looks like the makefiles need to be updated due to #1129. |
Fixed win32.mak. Apparently I had missed some more files than just the new objc_interface.html. |
Something is wrong. The style, images etc. are broken on the moved pages in the doc autotester, however they look fine when I build them here on Windows. Still, locally there are other issues with the generated docs, e.g. GLINK2 seems to be wrong from inside the language directory. |
Fixed |
Figured it out. The order of rules in posix.mak matters. I think I had fallen in the same trap with the changelog subdir. Autotester displays properly now. |
Could you add a comment to the makefile describing the issue to warn future contributors? |
Even though there are the Apache redirects, we need to ensure this PR doesn't create broken links when not under Apache, for the CHM and offline HTML documentation. One example is the link to |
Done.
I used the |
I see a few more broken links that look related to this PR:
|
cpp0x.html is not being built (not changed in this PR). So that's expected.
Changed the only spot I could find that could end up with that.
Fixed. Otherwise, I can't find these links, except from phobos. These are from the .chm file and that includes phobos, right? Should I make phobos/druntime PRs so that we can test everything together? |
Yep.
Yes, and ideally they should be merged simultaneously too. |
Ok, that'll have to wait until tomorrow, though. Maybe we can decide on a name for the directory until then. Ping @MartinNowak @andralex: Which one shall it be, /language/, /spec/, or /reference/? |
I'm preapproving this as a step in a good direction. @CyberShadow please take over the merging process once your concerns are addressed. FWIW I personally have a mild preference for /spec/ over /language/ but out of respect I'll leave it to the folks involved in the work. |
Adding redirects so that the old URLs stay functional. Links to the moved pages are updated in a separate commit.
Assuming that dlang.org.ddoc's GLINK2 macro is for links to language reference pages only.
6920297
to
7aced8d
Compare
Changed to /spec/, squashed down to two commits, made companion PRs: |
@CyberShadow: I just noticed your PR against my branch. After a little git adventure, I think I managed to include it properly. |
Thanks, will have a look again tomorrow :) |
Alright, Let's Do This. |
move "D Reference" pages to /spec/
I guess we can now add the search option in the dropdown? |
I'm waiting for google to pick up the new locations. So far it seems to have only found some of the pages: https://www.google.de/search?q=site%3Adlang.org%2Fspec |
Adding redirects so that the old URLs stay functional.
This is mostly moving pages, creating redirects, and updating links.
Non-bulk changes are:
$(ROOT)/language/*
. I'm assuming thatGLINK2 is for links to /language/ pages only.
I used HTML meta refresh for the redirects, because we use it already (e.g. appendices.html).
That technique has at least one major flaw: it loses the fragment/anchor/hash-thingy. E.g., http://dlang.org/appendices.html#copyright redirects to http://dlang.org/dstyle.html, losing the
#copyright
part.I'd rather use HTTP 301 redirects, but I don't know how to go about it.
Do we have .htaccess and mod_rewrite?
Do we have PHP and would MultiViews load
foo.html.php
whenfoo.html
is requested?As a next step, I'm going to add a search box option for the language reference, when Google has indexed the new locations.