Template talk:Gutenberg author
Template:Gutenberg author is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
Problem, Henry James example
[edit]How do we link, say, Henry James? If we try Henry_James, it will bring up a list of all authors with "Henry James" anywhere in the name. --Prosfilaes 09:33, 4 May 2005 (UTC)
- I wish I had a good answer for that, and it is something I recognized as a flaw. The short answer is not to use the "gutenberg author" template, and make your own external link to: http://www.gutenberg.org/browse/authors/j#a113, the problem with this link is that someone may need to fix it later on. Let me give you some background. . . . Project Gutenberg assigns a code to each author (that is what "j#a113" is the above link). Unfortunely, they do not claim that this code has any permanance. Gutenberg specifically requests that outsiders use one of their canonical URLs, or ones that they pledge to continually support. The canonical URL format for an author is: "John_Q._Public" rather than "q#9999". In some cases it does not work well, and http://www.gutenberg.org/author/Henry_James is a perfect example. On the other hand, this ambiguity is sometimes helpful, as for http://www.gutenberg.org/author/William_Shakespeare because it also shows the category for his spurious works, that otherwise a user would not see if he went to http://www.gutenberg.org/browse/authors/s#a65. --Eoghanacht 16:48, 2005 May 4 (UTC)
- You now can use id=Henry_James_(1843-1916) to disambiguate. Works by Henry James at Project Gutenberg You can also give (42-) or (-42) if the other date is unknown. The parens and the hyphen are required. For any question regarding the Project Gutenberg web site contact me at webmaster@gutenberg.org . We are very interested in collaborating with Wikipedia, so we'll quickly fix anything that can be fixed. --Marcello 10:36, 15 July 2005 (UTC)
- It is advised to use the author's ID. Henry James's ID is 113. Which gives: {{Gutenberg author | id=113 |name=Henry James}}
- As mentioned on the template page: "id = number' will skip the author search result page and go direct to the author page. This is preferable."
- PS: To find the ID number: Go to any book by Henry James (example), click on the last breadcrumb at top left where it says "> 86 by Henry James", it will lead to https://www.gutenberg.org/ebooks/author/113 (where 113 is the ID number)" -- - Cy21 ➜ discuss 19:25, 4 June 2018 (UTC)
See also: new pge.rastko.net link.
[edit]For authors who wrote largely in Cyrillic languages (as well as many others), they may have more works on pge.rastko.net than on the U.S. Gutenberg site. There's now a template for them too. See Template:Gutenberg-europe author.
*{{gutenberg-europe author|id=5579|name=Vuk Stefanović Karadžić}}
which generates
If someone would like to write Project Gutenberg Europe, it'd be much appreciated; red links are ugly.
Note that PGE also mirrors all of the U.S. Gutenberg content. Only etexts with IDs above 100000 on pge.rastko.net are PGE-specific. Unless there's PGE-specific content, there's no compelling reason to have two links to identical material. Enjoy! grendel|khan 14:19, 7 October 2005 (UTC)
New simpler syntax.
[edit]The template is backwards-compatible. but it now supports leaving out the name entirely.
Thus, on Theodor Hertzka, the code
- {{gutenberg author}}
produces
Substitutions can still be used as before if the link doesn't generate properly. grendel|khan 09:20, 26 July 2006 (UTC)
Something to watch out for is if this is used in an article which is later moved to a different title, resulting in a broken link. Andrew Sly 02:14, 19 August 2006 (UTC)
Internet Archive and Google Books
[edit]Would there be interest in creating a template that incorporates all three services (PG, IA, GB). Here is an example from Alfred Russel Wallace:
- Works by Alfred Russel Wallace at Project Gutenberg
- Works by Alfred Russel Wallace at Internet Archive
- Works by Alfred Russel Wallace at Google Books
Do we need separate author templates for each service, or a single template?
-- Stbalbach 04:29, 14 April 2007 (UTC)
editprotected
[edit]{{editprotected}}
I request an admin to add cs.wiki link to cs:Šablona:Gutenberg autor. Thanks. Jan.Kamenicek (talk) 22:02, 27 March 2008 (UTC)
- I've moved all the categories and interwikis to Template:Gutenberg author/doc, so you can add anything you need to yourself. Happy‑melon 21:17, 28 March 2008 (UTC)
gutenberg.org has changed since 28 March 2008
[edit]For example : Dick, Philip K., 1928-1982 each book and author now has a unique URL :
- www.gutenberg.org/ebooks/<num>
- www.gutenberg.org/ebooks/author/<num>
a unified Gutenberg template should be possible, such as :
- {{Gutenberg|no=40964|name=Tony and the Beetles|author=Dick, Philip K., 1928-1982|authornum=33399}}
Xb2u7Zjzc32 (talk) 14:33, 1 February 2014 (UTC)
- I think this is badly needed e.g. Margaret_of_Navarre. For this author, Gutenberg's bibrec gives author id "Marguerite, Queen, consort of Henry II, King of Navarre, 1492-1549" [for example] Just try and get any author id that works. I have. There isn't any. But the author num of 32596 should work great! So: any hope of getting this unified Gutenberg template? Thanks! Cloudjpk (talk) 18:28, 5 February 2015 (UTC)
Protocol-relative URL
[edit]This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Since both http://www.gutenberg.org/
and https://www.gutenberg.org/
work, please switch this template to protocol-relative URL. Thanks. --bender235 (talk) 05:51, 29 March 2015 (UTC)
- Done --Redrose64 (talk) 11:55, 29 March 2015 (UTC)
Convert to new Lua module
[edit]This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
The template has been re-written as Lua Module:Gutenberg. Edit request is to replace this:
- [//www.gutenberg.org/author/{{{1|{{{id|{{PAGENAMEE}}}}}}}} Works by {{{2|{{{name|{{PAGENAMEBASE}}}}}}}}] at [[Project Gutenberg]]
With this:
- <includeonly>{{#invoke:Gutenberg|author}}</includeonly>
The testcases page Template:Gutenberg author/testcases shows it working. The new Lua code adds an additional important feature allowing the argument |id=
to be to either the author name, or the author number (they go to different pages at the PG website). The behavior is otherwise exactly the same, there are no new or deleted arguments. See the testcases page which shows the old and new templates side by side - they are identical (except when a number is used since that is a new feature with the Lua version). -- GreenC 00:11, 4 October 2015 (UTC)
- @Green Cardamom: Thanks for making this! It's nice to see more Wikipedians interested in Lua. :) My first thought was that it's probably not too hard to just add the new feature in template code, as there isn't really anything in the module that needs to be done in Lua. Although I think that Lua has several advantages over template code anyway, you should be careful when converting simple templates like this one, as it makes them less accessible to editors who don't know Lua. Here are my thoughts about the module itself:
- You need to support
args[1]
for the ID andargs[2]
for the name, as these parameters are already in use and not supporting them will break transclusions. - In the template, the ID falls back to
{{PAGENAMEE}}
, but not providing an ID is an error in the module. Might some transclusions be relying on this feature? - You should use the same Lua pattern as is done at Template:PAGENAMEBASE (
%s+%([^%(]-%)$
), otherwise it will lead to unexpected behaviour on some pages. For example, we have some pages that have more than one pair of parentheses in the title. In fact, it might be worth converting PAGENAMEBASE to Lua as well so that you could just load it from here. - If you are going to output an error for the ID, you should probably make it a Big Red error. You can do that by using the
error()
function, which puts the page in Category:Pages with script errors and gives you a stack trace when you click on the error message. Or if you just want wikitext, you can wrap the error message in<strong class="error">...</strong>
. - To avoid checking for
args.foo == "" or args.foo == nil
both times, you can use Module:Arguments, or just define your own stripArgument function. Then you can just saynot args.foo
. Module:Arguments also has a "wrappers" option, so that when the module is used from Template:Gutenberg author it will use the parent frame, but when it is used from other pages,{{#invoke:Gutenberg|author|id=foo|name=bar}}
will still work.
- You need to support
- That's everything that I can think of for now - let me know if you have any questions about any of them. — Mr. Stradivarius ♪ talk ♪ 03:05, 4 October 2015 (UTC)
- Wow thanks for the great feedback. The reason I'd like to use Lua is because Wikidata now has fields for the Gutenberg ID number, and I hope to eventually populate Wikidata and have the template pull info from there so users don't need to worry what the ID is. That's down the road though, for now getting the Lua template in place with the new ID feature since there are some pages that need it. I'll take a look at the rest of your suggestions and ping when done. Regards. -- GreenC 03:45, 4 October 2015 (UTC)
@Mr. Stradivarius: :
- I searched and out of 9191 uses of the template, 22 were missing the id argument. They are now added. I'd prefer not to add support for positional parameters (or no parameters), it makes the script more complex, is no longer needed and will make future upgrades more difficult with inconsistent data.
- Re: pagenamebase, changed
name = mw.title.getCurrentTitle().text
toname = mw.title.getCurrentTitle().basePageTitle.text
. It seems to work but I don't know how to test it. Do you know of an example article where multiple paren pairs are used? - Returns error() when there is no id parameter.
- Added function trimArg() .. prefer that over the complexity of Module:Arguments, it can be added in the future.
-- GreenC 17:06, 4 October 2015 (UTC)
- @Green Cardamom: Thanks for the reply. About your points:
- Supporting args[1] and args[2] needn't make the module more complex - it can be as simple as this. When you checked for missing IDs, did you also check to see whether
{{{1}}}
and{{{2}}}
were in use? If you've replaced them then you can remove them from the template if you want, but it really isn't that much trouble to support them. - PAGENAMEBASE isn't the same as
mw.title.getCurrentTitle().basePageTitle.text
. The base page is the page without the final subpage, but PAGENAMEBASE is a template that finds the page name without the final parentheses. - You can just call
error()
without returning it, as it will stop execution of the module anyway.
- Supporting args[1] and args[2] needn't make the module more complex - it can be as simple as this. When you checked for missing IDs, did you also check to see whether
- Best — Mr. Stradivarius ♪ talk ♪ 01:55, 5 October 2015 (UTC)
- @Mr. Stradivarius: (this is on my watchlist no need to ping, if it's on yours I'll stop pinging).
- Ahh I see now, that's clever using the "or" in
id = trimArg(args[1]) or trimArg(args.id)
. Come to think of it I didn't search non-article space (talk pages etc) for legacy usage, which is about 80 pages. Those could be checked and fixed if needed, but it wouldn't hurt to leave the args[1] feature. The search was for negative existence of "id=" (or "id =") within Gutenberg author template instances. - Great. I didn't know how to add PAGENAMEBASE. Glad you did so.
- Thanks for your help with the code. -- GreenC 04:55, 5 October 2015 (UTC)
- No worries. I think it's all ready now, so I've updated the template. — Mr. Stradivarius ♪ talk ♪ 06:18, 5 October 2015 (UTC)
https problem
[edit]One problem; the documentation says using id=number is preferable and goes to the unsecure, http, version of the page. The template actually generates a secure https URL. The latter does not seem to work. Compare:
I don’t know if this a temporary issue or they do not support https. Either the module needs fixing or the documentation updating.--JohnBlackburnewordsdeeds 16:51, 5 October 2015 (UTC)
- @JohnBlackburne: - it works for me not seeing any problem. What browser are you using? What URL do you see in the second instance? What happens when you click on it? Thanks. (BTW I fixed the documentation it should have been https. Also the template is Protocol Relative, meaning it will generate http or https dynamically depending on your browser's ability). -- GreenC 17:11, 5 October 2015 (UTC)
- Safari. I get a generic warning page with the following on it:
Safari Can’t Open the Page Safari can’t open the page “https://www.gutenberg.org/ebooks/author/6950” because Safari can’t establish a secure connection to the server “www.gutenberg.org”.
- Every page I try with https gives the same outcome. Nothing wrong with https on my Mac otherwise I would not be able to connect to WP or half the sites I visit.--JohnBlackburnewordsdeeds 18:01, 5 October 2015 (UTC)
- And sorry quoting has mangled the URL. It’s the same as in the template above, i.e. https://www.gutenberg.org/ebooks/author/6950--JohnBlackburnewordsdeeds 18:03, 5 October 2015 (UTC)
- Some more info: Safari’s error log has:
Failed to load resource: An SSL error has occurred and a secure connection to the server cannot be made
- No idea what that means.--JohnBlackburnewordsdeeds 18:05, 5 October 2015 (UTC)
- @JohnBlackburne: - I'm able to replicate this problem using a different browser on a PC. It looks like the Gutenberg site has a problem. The best solution is to remove https support when going to an id=# -- GreenC 19:48, 5 October 2015 (UTC)
- Yes, it doesn’t look like a browser or OS issue. My search on the error message found mostly server-side solutions. The error is possibly always there, but some browsers ignore or work around it. It’s not just those with id=# but all secure urls with https to their site in my testing.--JohnBlackburnewordsdeeds 19:53, 5 October 2015 (UTC)
- Ahh shoot you're right it's also when using a id=name. I wonder why no one reported this before, possibly a temporary problem? Anyway we need to get the module to use http for the time being while this problem exists. I have a request in with an admin since I don't have perms to make the change. -- GreenC 20:01, 5 October 2015 (UTC)
- Yes, it doesn’t look like a browser or OS issue. My search on the error message found mostly server-side solutions. The error is possibly always there, but some browsers ignore or work around it. It’s not just those with id=# but all secure urls with https to their site in my testing.--JohnBlackburnewordsdeeds 19:53, 5 October 2015 (UTC)
- @JohnBlackburne: - I'm able to replicate this problem using a different browser on a PC. It looks like the Gutenberg site has a problem. The best solution is to remove https support when going to an id=# -- GreenC 19:48, 5 October 2015 (UTC)
https now works and the template should be fixed to point to httpS. 83.145.195.17 (talk) 15:12, 17 December 2016 (UTC)
- Done. -- GreenC 16:16, 17 December 2016 (UTC)
Site appears to be having problems with https again.
Example: Works by Gutenberg author at Project Gutenberg WHuis (talk) 15:38, 7 June 2018 (UTC)
Update to Lua code
[edit]This edit request to Module:Gutenberg has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
- Request: Replace current code at Module:Gutenberg with latest revision at Module:Gutenberg/sandbox (diff)
- Changes:
- Minor edits to comments
- Added conversion of "<space>" to "+" so users won't need to worry. For example currently it requires
{{Gutenberg author id=Dickens,+Charles}}
and breaks if{{Gutenberg author id=Dickens, Charles}}
. This will fix. - Added new function p.Australia for Template:Gutenberg Australia. This template was created in 2005 and was rarely used due poor design + poor design of the PG Australia website. I've have created new documentation for the template so it works for both books and authors as a single template, and produces better output consistent with other similar templates. It is not backwards compat but I will manually update the 9 pages currently using it.
- Other relevant pages:
-- GreenC 01:41, 8 October 2015 (UTC)
- Done — Martin (MSGJ · talk) 11:35, 8 October 2015 (UTC)
Update to Lua code
[edit]This edit request to Module:Gutenberg has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
- Request: Replace current code at Module:Gutenberg with latest revision at Module:Gutenberg/sandbox[2]
- Changes
- Add ability to have [space] in id (correction to previous edit request above)
- Fix bug in Gutenberg Australia where the "Works by" is not part of the external link.
- Add new paramater "coda"
Tests on testcases pages here and here. -- GreenC 17:32, 12 December 2015 (UTC)
- Would you like to make the edit yourself? — Martin (MSGJ · talk) 14:40, 14 December 2015 (UTC)
- Yes :) Thank you for the permission grant. -- GreenC 16:38, 14 December 2015 (UTC)
Update to Lua code (January 2017)
[edit]This edit request to Module:Gutenberg has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
- Request: Replace current code at Module:Gutenberg with latest revision at Module:Gutenberg/sandbox[3]
- Changes:
- Add new function p.Canada
- used in Template:FadedPage
- Add new function p.Canada
- Faded Page is the book archive for Distributed Proofreaders Canada.
Testcase pages: [4]. EncyclopediaUpdaticus (talk) 15:51, 30 January 2017 (UTC)
French Wikipedia
[edit]I am interested in porting my template, Template:FadedPage to the French Wikipedia. Does the same setup for this code exist over there? EncyclopediaUpdaticus (talk) 15:02, 15 February 2017 (UTC)
- No they are using a simple wikitext template not Lua based. One might be able to copy the Lua module there, translating the few words needed for display. -- GreenC 19:06, 15 February 2017 (UTC)
Template-protected edit request on 19 April 2022
[edit]This edit request to Module:Gutenberg has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
I recommend replacing:
local urlheadname = "https://www.gutenberg.org/author/" local urlheadnumb = "https://www.gutenberg.org/ebooks/author/"
with
local urlheadname = "https://gutenberg.org/author/" local urlheadnumb = "https://gutenberg.org/ebooks/author/"
removing "www." as it is unnecessary. Սահակ/Sahak (talk) 14:15, 19 April 2022 (UTC)
- Not done: removal of "www" is unnecessary, because the links work perfectly just as they are. "If it aint broke, don't 'fix' it!" It's okay to make trivial edits like this; however, it is better to make them along with at least one non-trivial edit. P.I. Ellsworth - ed. put'r there 17:43, 19 April 2022 (UTC)